Documentation ¶
Index ¶
- Constants
- func CollectNames(cmd *cobra.Command, options *GeneratorOptions) []string
- func CreateAssembly(assembliesDir string, files []string) error
- func CreateIndexFile(rootCmd *cobra.Command, generationOptions *GeneratorOptions) error
- func CreateModularDocs() error
- func CreateModules(modulesDir string, commandAdocFiles []string) ([]string, error)
- func FlagUsages(f *pflag.FlagSet) string
- func GenAsciidoc(cmd *cobra.Command, w io.Writer) error
- func GenAsciidocCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error
- func GenAsciidocTree(cmd *cobra.Command, options *GeneratorOptions) error
- func GenAsciidocTreeCustom(cmd *cobra.Command, options *GeneratorOptions) error
- func GetNormalizedCommandPath(c *cobra.Command) string
- func GetShortCommandPath(c *cobra.Command) string
- type CommandGroup
- type GeneratorOptions
Constants ¶
const AnnotationName = "docs_category"
Annotation used in top level commands to define categories
Variables ¶
This section is empty.
Functions ¶
func CollectNames ¶
func CollectNames(cmd *cobra.Command, options *GeneratorOptions) []string
func CreateAssembly ¶
func CreateIndexFile ¶
func CreateIndexFile(rootCmd *cobra.Command, generationOptions *GeneratorOptions) error
func CreateModularDocs ¶
func CreateModularDocs() error
CreateModularDocs Create Modular Documentation from the CLI generated docs
func CreateModules ¶
func FlagUsages ¶
FlagUsages returns a string containing the usage information for all flags in the FlagSet.
func GenAsciidoc ¶
GenAsciidoc creates asciidocs documentation
func GenAsciidocCustom ¶
GenAsciidocCustom creates custom asciidoc documentation
func GenAsciidocTree ¶
func GenAsciidocTree(cmd *cobra.Command, options *GeneratorOptions) error
GenAsciidocTree 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 `third`, it is undefined which help output will be in the file `cmd-sub-third.1`.
func GenAsciidocTreeCustom ¶
func GenAsciidocTreeCustom(cmd *cobra.Command, options *GeneratorOptions) error
GenAsciidocTreeCustom
func GetNormalizedCommandPath ¶
GetNormalizedCommandPath returns name of the command without cmd name and with underscore instead of spaces
func GetShortCommandPath ¶
Types ¶
type CommandGroup ¶
type GeneratorOptions ¶
type GeneratorOptions struct { // Directory to write the documentation files Dir string // FileNameGenerator - provides custom file name for each documentation file FileNameGenerator func(cmd *cobra.Command) string // FilePrepender - Prepend content to the generated file (add header) FilePrepender func(string) string // LinkHandler - function to handle links that lets you to transform them to different format LinkHandler func(string) string // GenerateIndex - generate index file GenerateIndex bool // IndexLocation - name and folder of the assembly file (typically ./README.adoc) IndexFile string }
GeneratorOptions all modifiers for the generator