Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markup options in a table format #12

Closed
wants to merge 6 commits into from

Conversation

yudai-nkt
Copy link
Contributor

@yudai-nkt yudai-nkt commented Nov 20, 2020

This PR prints CLI options in a rich table format instead of a plain format we see in terminal. In addition to that, the section name "Options:" is made bold in order to be better aligned with mkdocstrings' heading.

w/o PR:

スクリーンショット 2020-11-21 2 36 35

w/ PR:

スクリーンショット 2020-11-21 2 50 22

(These are fixed in 6f89573) Current implementation has the following restrictions, but I suppose most of the use cases don't fall under these situations.

  • If any of the help messages starts with a hyphen, the resulting table would not be what users expect.
  • If help messages are written in certain languages (Chinese, Japanese and Thai AFAIK), they might contain unwanted whitespaces. I don't think we should care because this could happen in HTML and Markdown in general and is not a critical problem.

Fix #11.

@yudai-nkt yudai-nkt mentioned this pull request Nov 20, 2020
@yudai-nkt
Copy link
Contributor Author

yudai-nkt commented Nov 27, 2020

I added three more columns (i.e., Type, Required, Default) so that these information becomes more recognizable and descriptive. Now the result looks like this and I suppose the table is easier to grasp at first sight.

EDIT: I changed to use the same table format as mkdocstrings' parameters (example and source) and the Required and Default columns are now merged. Sample image is updated accordingly (the previous version can be previewed here).

w/o PR
スクリーンショット 2020-11-28 1 20 37

w/ PR
スクリーンショット 2020-12-09 12 52 29

@florimondmanca
Copy link
Contributor

@yudai-nkt Thanks so much for putting time into this. I commented on #11 — right now I don't think this particular form of the PR is exactly the way we'd like to go; rather, we should look at adding this in a backwards-compatible way. So I'd like to close this for housekeeping purposes only, but be assured that I fully appreciate this contribution and we can continue discussion on ways to get this in on #11. Thanks!

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.

Print options in a sleek table format
2 participants