Merge pull request #4 from kristijanhusak/feature/multiline-description
Add support for multiline description.
This commit is contained in:
commit
624f47911d
@ -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
|
The first field is the filename of the generated vimdoc help file; the second is the description can you provide
|
||||||
with this parameter.
|
with this parameter.
|
||||||
|
|
||||||
|
Multi line description can be written using `\n`.
|
||||||
|
|
||||||
* **norules**
|
* **norules**
|
||||||
|
|
||||||
By default, we generate horizontal rules above level 1-2 headings, as shown below:
|
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
|
// Header and footer
|
||||||
func (v *vimDoc) DocumentHeader(out *bytes.Buffer) {
|
func (v *vimDoc) DocumentHeader(out *bytes.Buffer) {
|
||||||
if len(v.desc) > 0 {
|
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 {
|
} else {
|
||||||
out.WriteString(v.filename)
|
out.WriteString(v.filename)
|
||||||
out.WriteString("\n")
|
out.WriteString("\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user