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
Although there is an implicit differentiation between required/optional args (<ARG> for required args and [ARG] for optional), but we can't assume every user knows that. This is done automatically when showing the --help in the terminal, but not in the markdown docs (all arguments are shown as <ARG>), which creates an inconsistency.
We need to improve the markdown docs generation to include that information more explicitly.
Desired behavior
Related to #5030 (they can be completed in parallel).
We should add a piece of text to optional arguments so the user can easily differentiate between required/optional arguments.
To do so, the markdown command must be updated as follows. In the generate_arg_markdown function, the value_name is always written as "`<{value_name}>`". This should be changed so that:
if arg.is_required_set() is true, print it as "`<{value_name}>`"
else, print it as "`[{value_name}]`, (optional)"
The text was updated successfully, but these errors were encountered:
adrianbenavides
changed the title
Automatically add an "optional" tag to commands arguments' description when generating markdown docs
Add an "optional" tag to commands arguments' description when generating markdown docs
Jun 21, 2023
Current behavior
Although there is an implicit differentiation between required/optional args (
<ARG>
for required args and[ARG]
for optional), but we can't assume every user knows that. This is done automatically when showing the--help
in the terminal, but not in the markdown docs (all arguments are shown as<ARG>
), which creates an inconsistency.We need to improve the markdown docs generation to include that information more explicitly.
Desired behavior
Related to #5030 (they can be completed in parallel).
We should add a piece of text to optional arguments so the user can easily differentiate between required/optional arguments.
To do so, the
markdown
command must be updated as follows. In thegenerate_arg_markdown
function, thevalue_name
is always written as "`<{value_name}>`". This should be changed so that:arg.is_required_set()
is true, print it as "`<{value_name}>`"The text was updated successfully, but these errors were encountered: