You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Options are currently documented in a plain format as if they were copy-pasted from a terminal emulator. I'd be happy if they are rendered in a human-readable HTML table.
Thanks for creating mkdocs-click anyway! This package and mkdocstrings leave me no choice but to use Click as an argument parser and makes it possible to make a beautiful documentation for both CLI and Python API.
@yudai-nkt So I've taken a quick look at #12, and that's looking great.
What I'm thinking though is that we might want to let users decide which style they'd like, or at least introduce a table style in a backwards-compatible manner.
I guess what could be feasible would be a new :style: option on the mkdocs-click block, that would toggle which style should be used:
::: mkdocs-click
:module: example.cli
:command: main
:style: table
If we do that, I'd expect the implementation to be purely additive, i.e. the current _make_options() should remain basically untouched, but we'd add a _make_table_options() function and switch between the two in _recursively_make_command_docs().
I need to dig into your codebase to find out how the :option: notation works, but your suggestion totally makes sence.
I want to ask two questions before working on this feature:
what should the default (i.e., current style) be named? plain came to my mind but I appreciate it if you have a better option name.
Adding a new parameter style, which can be either table or plain, to _make_options() like this sounds more straight-forward to me rather than defining two functions. May I ask the reason you want purely additive implementation?
def_make_options(ctx, style="plain"):
ifstyle=="plain":
# format options hereelifstyle=="table":
# format options hereelse:
# raise some ValueError
Activity
yudai-nkt commentedon Nov 20, 2020
Thanks for creating
mkdocs-clickanyway! This package andmkdocstringsleave me no choice but to use Click as an argument parser and makes it possible to make a beautiful documentation for both CLI and Python API.florimondmanca commentedon Dec 8, 2020
@yudai-nkt You're welcome! I just realized there had been some contributor activity on this repo :-) Will be taking a look soon!
florimondmanca commentedon Dec 9, 2020
@yudai-nkt So I've taken a quick look at #12, and that's looking great.
What I'm thinking though is that we might want to let users decide which style they'd like, or at least introduce a
tablestyle in a backwards-compatible manner.I guess what could be feasible would be a new
:style:option on themkdocs-clickblock, that would toggle which style should be used:::: mkdocs-click :module: example.cli :command: main :style: tableIf we do that, I'd expect the implementation to be purely additive, i.e. the current
_make_options()should remain basically untouched, but we'd add a_make_table_options()function and switch between the two in_recursively_make_command_docs().Makes sense?
yudai-nkt commentedon Dec 10, 2020
I need to dig into your codebase to find out how the
:option:notation works, but your suggestion totally makes sence.I want to ask two questions before working on this feature:
plaincame to my mind but I appreciate it if you have a better option name.style, which can be eithertableorplain, to_make_options()like this sounds more straight-forward to me rather than defining two functions. May I ask the reason you want purely additive implementation?florimondmanca commentedon Dec 10, 2020
@yudai-nkt 👍 The
style=...parameter sounds good, as well asplain.yudai-nkt commentedon Dec 12, 2020
#25 is ready for your review, @florimondmanca!