Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMarkdown ¶
func RenderMarkdown(a *clihelp.App, o MarkdownOptions) (changed bool, err error)
RenderMarkdown generates GitHub-friendly markdown help pages for a. It owns exactly the directory Dir: it writes one .md file per command plus an index.md, prunes orphaned .md files it produced earlier (safe, it is the sole owner of that directory), and never touches files outside it.
Generation is gated so a deployed binary (which never sets the CLIHELP_GEN environment variable) stays silent. The on-disk hash file both enables generation and records the last generated state; when the usage tree is unchanged the pass is a no-op. changed reports whether any generation pass ran. A suggestion for committing the pages is printed to stderr only when changed is true.
Additive helper: the markdown materialized in Dir is not tracked by git (the per-app dotfile is gitignored), so committing and pushing the generated pages to the repository is a separate, ordinary `git add`/`commit`/`push` step.
Types ¶
type MarkdownOptions ¶
type MarkdownOptions struct {
// Dir is the directory that receives the generated pages. When empty it
// defaults to "docs/clihelp".
Dir string
}
MarkdownOptions controls markdown help-page generation.