Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A while ago, I posted some plans for better documentation: #3181
This PR is a another step towards that plan.
After help
uudoc
now supports clap'safter_help
, which is useful for a lot of utils. We might need to tweak what it looks like, but we can figure that out later.Read directly from markdown file
In #3181, I created a diagram that might be useful in understanding this change. If a file like

numfmt.md
is available,uudoc
will try to read that instead of getting its information fromclap
. The reason for this is that we don't want to feedclap
raw markdown. Instead, we want to render the markdown to something that looks nice in the terminal. For now, I only make one simple change before handing the string toclap
: removing all backticks. So now the online docs forexpr
can look like this:while the CLI help is:
Notice that there are no backticks around EXPRESSION. This change is not super helpful, but it functions as a proof of concept, I suppose.
Next steps
The next step is adding a full markdown parser and render more complicated markdown. We can play with colors, spacing, etc.. Afterwards, we can open issues to convert all utils to this format.