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 ¶
- func CustomNamesHandler(flagDescription, defaultValue string) string
- func GenerateSummary(dir string) error
- func RandomDayDescriptionHandler(flagDescription, defaultValue string) string
- func StrReplaceIfContains(title, old, new string) string
- func WriteDocs(cmd *core.Command, dir string) error
- type FlagDefaultDocumentationHandler
- type SubdirRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomNamesHandler ¶ added in v6.9.0
func GenerateSummary ¶
func RandomDayDescriptionHandler ¶ added in v6.8.2
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 ¶
Types ¶
type FlagDefaultDocumentationHandler ¶ added in v6.8.2
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
}