Skip to content

package docgen

import "github.com/cloudboss/unobin/pkg/docgen"

Package docgen renders unobin reference documentation as Markdown for the docs site.

Functions

func APIReference

func APIReference(pkg *doc.Package, fset *token.FileSet) string

APIReference renders a parsed package's exported API as a Markdown page: the package documentation, then its constants, variables, functions, and types, with each type followed by its own constructors and methods. go/doc sorts every group by name, so the output is deterministic.

func CLIReference

func CLIReference(root *cobra.Command) string

CLIReference renders the command tree rooted at root as a single Markdown page: an intro from the root's own description, then one section per visible command, nested by depth. Commands and flags are emitted in lexical order, so the output is identical on every run and can be regenerated without churn.