MCPcopy
hub / github.com/spf13/cobra / GenMarkdownTree

Function GenMarkdownTree

doc/md_docs.go:125–129  ·  view source on GitHub ↗

GenMarkdownTree will generate a markdown page for this command and all descendants in the directory given. The header may be nil. This function may not work correctly if your command names have `-` in them. If you have `cmd` with two subcmds, `sub` and `sub-third`, and `sub` has a subcommand called

(cmd *cobra.Command, dir string)

Source from the content-addressed store, hash-verified

123// and `sub` has a subcommand called `third`, it is undefined which
124// help output will be in the file `cmd-sub-third.1`.
125func GenMarkdownTree(cmd *cobra.Command, dir string) error {
126 identity := func(s string) string { return s }
127 emptyStr := func(s string) string { return "" }
128 return GenMarkdownTreeCustom(cmd, dir, emptyStr, identity)
129}
130
131// GenMarkdownTreeCustom is the same as GenMarkdownTree, but
132// with custom filePrepender and linkHandler.

Callers 1

TestGenMdTreeFunction · 0.85

Calls 1

GenMarkdownTreeCustomFunction · 0.85

Tested by 1

TestGenMdTreeFunction · 0.68