Add support for multiline description.
This commit is contained in:
parent
9f1dd8eaa4
commit
e31c32b657
@ -50,6 +50,8 @@ provides a more detailed description of what the parameters do.
|
||||
The first field is the filename of the generated vimdoc help file; the second is the description can you provide
|
||||
with this parameter.
|
||||
|
||||
Multi line description can be written using `\n`.
|
||||
|
||||
* **norules**
|
||||
|
||||
By default, we generate horizontal rules above level 1-2 headings, as shown below:
|
||||
|
10
vimdoc.go
10
vimdoc.go
@ -373,7 +373,15 @@ func (v *vimDoc) NormalText(out *bytes.Buffer, text []byte) {
|
||||
// Header and footer
|
||||
func (v *vimDoc) DocumentHeader(out *bytes.Buffer) {
|
||||
if len(v.desc) > 0 {
|
||||
v.writeSplitText(out, []byte(v.filename), []byte(v.desc), " ", 0)
|
||||
parts := strings.Split(v.desc, "\\n")
|
||||
for i, part := range parts {
|
||||
if i == 0 {
|
||||
v.writeSplitText(out, []byte(v.filename), []byte(part), " ", 0)
|
||||
} else {
|
||||
out.WriteString(part)
|
||||
}
|
||||
out.WriteString("\n")
|
||||
}
|
||||
} else {
|
||||
out.WriteString(v.filename)
|
||||
out.WriteString("\n")
|
||||
|
Loading…
Reference in New Issue
Block a user