doc

package
v1.27.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCommands

func AllCommands(cmd *cobra.Command) iter.Seq[*cobra.Command]

AllCommands returns a sequence of all commands in the command tree.

func CountCommands

func CountCommands(cmd *cobra.Command) (count int)

CountCommands returns the number of commands in the command tree.

func IndexFilenames

func IndexFilenames(cmd *cobra.Command, extension string) map[string]string

IndexFilenames returns a map from filename to command path.

Types

type Docs

type Docs struct {
	// Cmd is the command documentation was generated for.
	Cmd *cobra.Command

	// HTML is a map from command path to html contents.
	HTML map[string]string
}

Docs represents html documentation for a cobra.Command.

func MakeDocs

func MakeDocs(cmd *cobra.Command) (Docs, error)

MakeDocs generates html documentation for a cobra.Command.

func (Docs) ServeHTTP

func (d Docs) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for the Docs struct.

Jump to

Keyboard shortcuts

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