diff --git a/docs/commands.md b/docs/commands.md index 451648e..43e4956 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1,6 +1,6 @@ # NAME -rmk - Reduced management for Kubernetes +RMK CLI - Reduced management for Kubernetes ## SYNOPSIS @@ -16,10 +16,11 @@ rmk ## DESCRIPTION Command line tool for reduced management of the provision of Kubernetes clusters in different environments and management of service releases. -BuiltBy: goreleaser -Commit: 9d85b2c -Date: 2024-07-25T14:59:40Z -Target: linux_amd64 + +**BuiltBy:** goreleaser \ +**Commit:** edbe501 \ +**Date:** 2024-09-02T14:44:39Z \ +**Target:** linux_amd64 **Usage**: diff --git a/docs/release-notes.md b/docs/release-notes.md index aea02f2..d45832e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1 +1,2 @@ -- #27 Configured GitHub Pages documentation generation using MkDocs Materials, mike. +- #27 - Configured GitHub Pages documentation generation using MkDocs Materials, mike. +- #42 - Fixed markdown headers in rmk doc generate command. diff --git a/main.go b/main.go index 0335397..43b93f6 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "sort" + "strings" "github.com/urfave/cli/v2" "go.uber.org/zap" @@ -39,6 +40,44 @@ GLOBAL OPTIONS: GLOBAL OPTIONS: ` + output + `{{range $index, $option := .VisibleFlags}}{{if eq $option.Name "help"}}{{" "}}{{$option}}{{end}}{{end}} ` + + cli.MarkdownDocTemplate = `{{if gt .SectionNum 0}}% {{ .App.Name }} {{ .SectionNum }} + +{{end}}# NAME + +` + strings.ToUpper(name) + ` CLI{{ if .App.Usage }} - {{ .App.Usage }}{{ end }} + +## SYNOPSIS + +{{ .App.Name }} +{{ if .SynopsisArgs }} +` + "```" + ` +{{ range $v := .SynopsisArgs }}{{ $v }}{{ end }}` + "```" + ` +{{ end }}{{ if .App.Description }} +## DESCRIPTION + +Command line tool for reduced management of the provision of Kubernetes clusters in different environments and management of service releases. + +**BuiltBy:** ` + builtBy + ` \ +**Commit:** ` + commit + ` \ +**Date:** ` + date + ` \ +**Target:** ` + target + ` +{{ end }} +**Usage**: + +` + "```" + `{{ if .App.UsageText }} +{{ .App.UsageText }} +{{ else }} +{{ .App.Name }} [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...] +{{ end }}` + "```" + ` +{{ if .GlobalArgs }} +## GLOBAL OPTIONS +{{ range $v := .GlobalArgs }} +{{ $v }}{{ end }} +{{ end }}{{ if .Commands }} +## COMMANDS +{{ range $v := .Commands }} +#{{ $v }}{{ end }}{{ end }}` } func runCLI() *cli.App {