mkdocs / mkdocs-click

An MkDocs extension to generate documentation for Click command line applications
https://pypi.org/project/mkdocs-click
Apache License 2.0
109 stars 15 forks source link

Markup options in a table format #12

Closed yudai-nkt closed 3 years ago

yudai-nkt commented 3 years ago

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 6f89573f71a1d410351b25dad258ffa004d21965) Current implementation has the following restrictions, but I suppose most of the use cases don't fall under these situations.

Fix #11.

yudai-nkt commented 3 years ago

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 commented 3 years ago

@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!