restyle RST option lists (#17637)

* WIP: restyle RST option lists

* apply similar style to Latex

* fix tests

* minor visual tweaks

* update tests

* remove leftover comments
This commit is contained in:
Andrey Makarov 2021-04-10 10:49:01 +03:00 • committed by GitHub
commit 2150cd1826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 103 additions and 21 deletions

View file

@ -90,7 +90,7 @@ type
level*: int ## level of headings starting from 1 (main
## chapter) to larger ones (minor sub-sections)
## level=0 means it's document title or subtitle
of rnFootnote, rnCitation, rnFootnoteRef:
of rnFootnote, rnCitation, rnFootnoteRef, rnOptionListItem:
order*: int ## footnote order (for auto-symbol footnotes and
## auto-numbered ones without a label)
else:
@ -368,7 +368,7 @@ proc renderRstToStr*(node: PRstNode, indent=0): string =
result.add txt
of rnHeadline, rnOverline, rnMarkdownHeadline:
result.add "\tlevel=" & $node.level
of rnFootnote, rnCitation, rnFootnoteRef:
of rnFootnote, rnCitation, rnFootnoteRef, rnOptionListItem:
result.add (if node.order == 0: "" else: "\torder=" & $node.order)
else:
discard