Expand description
tiny clap help renderer with markdown output and a bit of color.
the flow is simple:
- parse args with clap and send your match arm into
help_command(or the_docsvariant if you registered extra notes) HelpPageturns clap metadata into markdown-friendly structsrendererprints it withtermimad, scrolling automatically if it doesn’t fitHelpThemekeeps colors consistent and swappable
everything is re-exported from here so you rarely need to dig into submodules.
Structs§
- Command
Doc - extra help metadata layered on top of clap output.
- DocRegistry
- holds every command doc and guide for the current program session.
- Help
Args - args for your help command.
- Help
Page - everything we need to print help for a command path.
- Help
Theme - accent-aware theme used by the renderer.
- MadSkin
- A skin defining how a parsed markdown appears on the terminal (fg and bg colors, bold, italic, underline, etc.)
Enums§
- Color
- Represents a color.
- Help
Target - resolved help target (a command path, a guide, or the program root).
Functions§
- apply_
accent - tweak a
MadSkinin-place to carry the accent through headers, bold, strikeouts, etc. - help_
command - handle a
help <topic>command without custom docs. - help_
command_ docs - like
help_commandbut with an attachedDocRegistry. - help_
command_ program - show program help when no command was provided.
- help_
command_ program_ docs - program help with attached docs.
- render_
command_ help - render a help page, falling back to a scrollable view if it doesn’t fit on screen.
- resolve_
help - walk the clap tree to find the thing the user asked for.
- run_
help_ topic - shared execution path for all help entrypoints.
- run_
scrollable_ help - open a scrollable markdown view with keyboard and mouse shortcuts.