Skip to content

Commit

Permalink
Merge pull request #43 from edenlabllc/feature/RMK-42-fix-markdown-he…
Browse files Browse the repository at this point in the history
…aders-in-rmk-doc-generate-to-display-correctly-in-the-web-documentation

#42 - fix markdown headers in rmk doc generate command
  • Loading branch information
apanasiuk-el authored Sep 2, 2024
2 parents b4e8aee + 455acd0 commit edbe501
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
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

0 comments on commit edbe501

Please sign in to comment.