Skip to content

Commit

Permalink
Remove extraneous line from generated markdown (#1311)
Browse files Browse the repository at this point in the history
Signed-off-by: jolheiser <john.olheiser@gmail.com>
  • Loading branch information
jolheiser committed Nov 6, 2021
1 parent 1259f1e commit 12b7dfd
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs.go
Expand Up @@ -15,7 +15,7 @@ import (
// The function errors if either parsing or writing of the string fails.
func (a *App) ToMarkdown() (string, error) {
var w bytes.Buffer
if err := a.writeDocTemplate(&w, 8); err != nil {
if err := a.writeDocTemplate(&w, 0); err != nil {
return "", err
}
return w.String(), nil
Expand Down
4 changes: 2 additions & 2 deletions template.go
Expand Up @@ -74,9 +74,9 @@ OPTIONS:
{{end}}{{end}}
`

var MarkdownDocTemplate = `% {{ .App.Name }} {{ .SectionNum }}
var MarkdownDocTemplate = `{{if gt .SectionNum 0}}% {{ .App.Name }} {{ .SectionNum }}
# NAME
{{end}}# NAME
{{ .App.Name }}{{ if .App.Usage }} - {{ .App.Usage }}{{ end }}
Expand Down
2 changes: 0 additions & 2 deletions testdata/expected-doc-full.md
@@ -1,5 +1,3 @@
% greet 8

# NAME

greet - Some app
Expand Down
2 changes: 0 additions & 2 deletions testdata/expected-doc-no-authors.md
@@ -1,5 +1,3 @@
% greet 8

# NAME

greet - Some app
Expand Down
2 changes: 0 additions & 2 deletions testdata/expected-doc-no-commands.md
@@ -1,5 +1,3 @@
% greet 8

# NAME

greet - Some app
Expand Down
2 changes: 0 additions & 2 deletions testdata/expected-doc-no-flags.md
@@ -1,5 +1,3 @@
% greet 8

# NAME

greet - Some app
Expand Down
2 changes: 0 additions & 2 deletions testdata/expected-doc-no-usagetext.md
@@ -1,5 +1,3 @@
% greet 8

# NAME

greet - Some app
Expand Down

0 comments on commit 12b7dfd

Please sign in to comment.