@@ -13,14 +13,29 @@ Notes
1313- vimdoc format "spec":
1414 - [ : help help-writing] ( https://neovim.io/doc/user/helphelp.html#help-writing )
1515 - https://github.com/nanotee/vimdoc-notes
16- - ` (code_block) ` is contained by ` (line) ` because ` > ` can start a code block at the end of a line.
16+ - whitespace is intentionally captured in ` (word) ` , because it is often necessary to be
17+ able to correctly layout vim help files (especially old/legacy).
18+ - ` (codeblock) ` is contained by ` (line) ` because ` > ` can start a code block at the end of a line.
19+ - ` (column_heading) ` is contained by ` (line) ` because ` > ` (to close
20+ a ` (codeblock) ` can appear at the start of ` (column_heading) ` .
21+ - ` h1 ` ("Heading 1"): ` ====== ` followed by text and optional ` *tags* ` .
22+ - ` h2 ` ("Heading 2"): ` ------ ` followed by text and optional ` *tags* ` .
23+ - ` h3 ` ("Heading 3"): only UPPERCASE WORDS, followed by optional ` *tags* ` .
1724
1825Known issues
1926------------
2027
21- - ` line ` in a ` code_block ` does not contain ` word ` atoms, it's just the full
28+ - ` line_li ` ("list item") is _ experimental_ . It doesn't support nesting yet and
29+ it may not work well; you can treat it as a normal ` line ` for layout purposes.
30+ - ` codeblock ` ">" must not be preceded only by tabs, a space char is required (" >").
31+ See ` :help lcs-tab ` for example. Currently the grammar doesn't enforce this.
32+ - ` codeblock ` terminated by an "implicit stop" (i.e. no terminating ` < ` )
33+ consumes the first char of the terminating line, and continues the parent
34+ ` block ` , preventing top-level forms like ` h1 ` , ` h2 ` from being recognized
35+ until a blank line is encountered.
36+ - ` line ` in a ` codeblock ` does not contain ` word ` atoms, it's just the full
2237 raw text line including whitespace. This is somewhat dictated by its
23- "preformatted" nature; parsing the contents implies loading a "child"
38+ "preformatted" nature; parsing the contents would require loading a "child"
2439 language (injection). See [ #2 ] ( https://github.com/vigoux/tree-sitter-vimdoc/issues/2 ) .
2540- ` url ` doesn't handle _ surrounding_ parens. E.g. ` (https://example.com/#yay) ` yields ` word `
2641- ` url ` doesn't handle _ nested_ parens. E.g. ` (https://example.com/(foo)#yay) `
3752- ` line_noeol ` is a special-case to support documents that don't end in EOL.
3853 Grammar could be a bit simpler if we just require EOL at end of document.
3954- ` line_modeline ` (only at EOF)
40- - ` column_heading ` should not allow hotlinks. This is sometimes used in old help files to show results of a code example, e.g. in ` usr_41.txt ` :
41- ```
42- List concatenation is done with +: >
43- :echo alist + ['foo', 'bar']
44- < ['foo', 'bar', 'foo', 'bar'] ~
45- ```
0 commit comments