docgen

package
v3.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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