Support for markdown output in help messages - #30
Open
mgrojo wants to merge 11 commits into
Open
Conversation
Users of CLIC can use this functionality to provide on-line versions of the help messages.
This was referenced Sep 23, 2023
* For consistency with other chapters * It fixes `pandoc` output
The list of options got a line break after each option except for the longest line. The reason is that two or more spaces at the end of a line makes a hard line break in Markdown, but the longest line does not get any padding at the right. This ensures the line break.
There was a problem hiding this comment.
Pull request overview
This PR introduces Markdown-friendly formatting for CLIC help/usage output so applications can publish help pages online while still supporting rich TTY formatting.
Changes:
- Added
CLIC.Markdown(Markdown formatting helpers) andCLIC.Markup(runtime switch between TTY and Markdown formatting). - Extended
CLIC.Subcommand.Instanceformatting interface withTTY_Terminaland adjusted help/usage rendering to use it in key places. - Updated the example app to add a
--markdownflag and route formatting throughCLIC.Markup.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/clic-tty.ads | Fixes a typo in a TTY comment. |
| src/clic-subcommand.ads | Minor comment typo fixes around help-topic docs. |
| src/clic-subcommand-instance.ads | Adds TTY_Terminal generic formal and new iteration APIs. |
| src/clic-subcommand-instance.adb | Uses TTY_Terminal in help/usage and adds iteration implementations. |
| src/clic-markup.ads | New facade API to switch between TTY and Markdown output. |
| src/clic-markup.adb | Implements runtime selection between CLIC.TTY and CLIC.Markdown. |
| src/clic-markdown.ads | New Markdown formatting function declarations. |
| src/clic-markdown.adb | New Markdown formatting function implementations. |
| src/clic-config.ads | Fixes a typo in a comment. |
| example/src/clic_ex-commands.ads | Switches example instantiation to use CLIC.Markup and provides TTY_Terminal. |
| example/src/clic_ex-commands.adb | Adds --markdown switch and toggles Markdown formatting. |
| example/src/clic_ex-commands-subsub.adb | Updates subcommand instantiation to use CLIC.Markup + TTY_Terminal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+105
| procedure Iterate_Commands | ||
| (Process : not null access procedure | ||
| (Group : Ada.Strings.Unbounded.Unbounded_String; | ||
| Cmd : not null Command_Access)); | ||
| -- Iterate over all registered commands sorted by group applying Process | ||
|
|
||
| procedure Iterate_Topics | ||
| (Process : not null access procedure (Cmd : not null Help_Topic_Access)); | ||
| -- Iterate all registered topics applying Process |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mosteo
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Users of CLIC can use this functionality to provide on-line versions of the help messages.