Skip to content

Improve mdox UX#49

Merged
bwplotka merged 2 commits intobwplotka:mainfrom
saswatamcode:tui-ux
Jun 28, 2021
Merged

Improve mdox UX#49
bwplotka merged 2 commits intobwplotka:mainfrom
saswatamcode:tui-ux

Conversation

@saswatamcode
Copy link
Copy Markdown
Collaborator

This PR adds a cli spinner with description for mdox fmt command and adds colored diff for mdox fmt --check command.
This does not change CI logs and only affects output when run on a terminal.
Dependencies added: glamour, yacspin, go-isatty.

Screenshots attached below.

For mdox fmt:
Screenshot 2021-06-20 at 3 16 45 PM
Screenshot 2021-06-20 at 3 18 20 PM

For diffs:
Screenshot 2021-06-20 at 3 24 57 PM
Screenshot 2021-06-20 at 3 26 19 PM

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@saswatamcode saswatamcode requested a review from bwplotka June 20, 2021 14:53
@saswatamcode saswatamcode self-assigned this Jun 20, 2021
Copy link
Copy Markdown
Owner

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just style nit 🤗

Comment on lines +283 to +288
if spin != nil {
err := spin.Stop()
if err != nil {
errs.Add(err)
}
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if spin != nil {
err := spin.Stop()
if err != nil {
errs.Add(err)
}
}
if spin != nil {
errs.Add(spin.Stop())
}

Add checks error already

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

f := New(ctx, opts...)
b := bytes.Buffer{}
if spin != nil {
err := spin.Start()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@saswatamcode saswatamcode requested a review from bwplotka June 25, 2021 02:59
@bwplotka bwplotka merged commit 1b32e8f into bwplotka:main Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants