Remove extraneous line from generated markdown (#1311)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
John Olheiser 2021-11-06 06:37:42 -05:00 committed by GitHub
parent 1259f1efc9
commit 12b7dfd08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3 additions and 13 deletions

View File

@ -15,7 +15,7 @@ import (
// The function errors if either parsing or writing of the string fails. // The function errors if either parsing or writing of the string fails.
func (a *App) ToMarkdown() (string, error) { func (a *App) ToMarkdown() (string, error) {
var w bytes.Buffer var w bytes.Buffer
if err := a.writeDocTemplate(&w, 8); err != nil { if err := a.writeDocTemplate(&w, 0); err != nil {
return "", err return "", err
} }
return w.String(), nil return w.String(), nil

View File

@ -74,9 +74,9 @@ OPTIONS:
{{end}}{{end}} {{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 }} {{ .App.Name }}{{ if .App.Usage }} - {{ .App.Usage }}{{ end }}

View File

@ -1,5 +1,3 @@
% greet 8
# NAME # NAME
greet - Some app greet - Some app

View File

@ -1,5 +1,3 @@
% greet 8
# NAME # NAME
greet - Some app greet - Some app

View File

@ -1,5 +1,3 @@
% greet 8
# NAME # NAME
greet - Some app greet - Some app

View File

@ -1,5 +1,3 @@
% greet 8
# NAME # NAME
greet - Some app greet - Some app

View File

@ -1,5 +1,3 @@
% greet 8
# NAME # NAME
greet - Some app greet - Some app