diff --git a/docs/release-notes.md b/docs/release-notes.md index cbd77a9..d45832e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,2 +1,2 @@ -- #33 - Added a new GitHub action for RMK commands documentation generation. -- #34 - Added support for Terraform outputs of a boolean type. +- #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 {