Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#42 - fix markdown headers in rmk doc generate command #43

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -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.
39 changes: 39 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"sort"
"strings"

"github.com/urfave/cli/v2"
"go.uber.org/zap"
Expand Down Expand Up @@ -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 {
Expand Down