doc

package
v6.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package doc generates Markdown files and organizes a directory structure that follows the command hierarchy.

The WriteDocs function is the main entry point for generating the documentation. It recursively processes all subcommands and creates the appropriate files and directories based on the command structure, following the rules defined in determineSubdir

The GenerateSummary function is another entry point, which can create a summary.md file containing the table of contents for the generated documentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomNamesHandler added in v6.9.0

func CustomNamesHandler(flagDescription, defaultValue string) string

func GenerateSummary

func GenerateSummary(dir string) error

func RandomDayDescriptionHandler added in v6.8.2

func RandomDayDescriptionHandler(flagDescription, defaultValue string) string

RandomDayDescriptionHandler is a concrete strategy which changes the default value to "Random (Mon-Fri 10:00-16:00)" instead of an actual random day i.e. Thursday

func StrReplaceIfContains

func StrReplaceIfContains(title, old, new string) string

func WriteDocs

func WriteDocs(cmd *core.Command, dir string) error

Types

type FlagDefaultDocumentationHandler added in v6.8.2

type FlagDefaultDocumentationHandler func(flagDescription, defaultValue string) string

FlagDefaultDocumentationHandler is a Strategy for handling pflag default values while generating docs

type SubdirRule added in v6.8.5

type SubdirRule struct {
	// Either a static prefix (e.g. []string{"dbaas","in-memory-db"})
	// or a glob/regex.
	Prefix []string

	// How to build the target path.
	// Use “{1}”, “{2+}” etc to refer to prefix and tail segments.
	// e.g. "Database-as-a-Service/{1}/replicas/{2+}"
	//  - {i}   → the i’th segment
	//  - {i+}  → segments[i]…end, joined by filepath.Separator
	Template string
}

Jump to

Keyboard shortcuts

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