Remove extraneous line from generated markdown (#1311)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
1259f1efc9
commit
12b7dfd08c
2
docs.go
2
docs.go
@ -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
|
||||
|
@ -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 }}
|
||||
|
||||
|
2
testdata/expected-doc-full.md
vendored
2
testdata/expected-doc-full.md
vendored
@ -1,5 +1,3 @@
|
||||
% greet 8
|
||||
|
||||
# NAME
|
||||
|
||||
greet - Some app
|
||||
|
2
testdata/expected-doc-no-authors.md
vendored
2
testdata/expected-doc-no-authors.md
vendored
@ -1,5 +1,3 @@
|
||||
% greet 8
|
||||
|
||||
# NAME
|
||||
|
||||
greet - Some app
|
||||
|
2
testdata/expected-doc-no-commands.md
vendored
2
testdata/expected-doc-no-commands.md
vendored
@ -1,5 +1,3 @@
|
||||
% greet 8
|
||||
|
||||
# NAME
|
||||
|
||||
greet - Some app
|
||||
|
2
testdata/expected-doc-no-flags.md
vendored
2
testdata/expected-doc-no-flags.md
vendored
@ -1,5 +1,3 @@
|
||||
% greet 8
|
||||
|
||||
# NAME
|
||||
|
||||
greet - Some app
|
||||
|
2
testdata/expected-doc-no-usagetext.md
vendored
2
testdata/expected-doc-no-usagetext.md
vendored
@ -1,5 +1,3 @@
|
||||
% greet 8
|
||||
|
||||
# NAME
|
||||
|
||||
greet - Some app
|
||||
|
Loading…
Reference in New Issue
Block a user