docgen

package
v3.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package docgen 提供把 gcli 命令/应用导出为 markdown 与 man page(roff) 文档的能力。

对标 cobra 的 cobra/doc(GenMarkdownTree/GenManTree),纯新增、零破坏,仅依赖 gcli 公开内省 API。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppMarkdown

func AppMarkdown(app *gcli.App) string

AppMarkdown 渲染应用概览文档: 标题/描述 + 顶层命令列表(含相对链接)。

func CmdMan

func CmdMan(c *gcli.Command) string

CmdMan 渲染单个命令为 man page(roff 格式)。

func CmdMarkdown

func CmdMarkdown(c *gcli.Command) string

CmdMarkdown 渲染单个命令为 markdown 文档(cobra 风格)。

func ManTree

func ManTree(app *gcli.App, dir string) error

ManTree 在 dir 下为每个命令(含子命令递归)写一个 `.1` 文件(命名同 markdown, 扩展名 .1)。

func MarkdownTree

func MarkdownTree(app *gcli.App, dir string) error

MarkdownTree 在 dir 下为每个命令(含子命令递归)写一个 `.md`, 另写 `index.md`(= AppMarkdown)。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL