rstast.html 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>packages/docutils/rstast</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">packages/docutils/rstast</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  51. </li>
  52. <li>
  53. <details open>
  54. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  55. <ul class="simple simple-toc-section">
  56. <li><a class="reference" href="#FileIndex" title="FileIndex = distinct int32">FileIndex</a></li>
  57. <li><a class="reference" href="#PRstNode" title="PRstNode = ref RstNode">PRstNode</a></li>
  58. <li><a class="reference" href="#RstNode" title="RstNode {.acyclic, final.} = object
  59. case kind*: RstNodeKind ## the node's kind
  60. of rnLeaf, rnSmiley:
  61. text*: string ## string that is expected to be displayed
  62. of rnEnumList:
  63. labelFmt*: string ## label format like &quot;(1)&quot;
  64. of rnLineBlockItem:
  65. lineIndent*: string ## a few spaces or newline at the line beginning
  66. of rnAdmonition:
  67. adType*: string ## admonition type: &quot;note&quot;, &quot;caution&quot;, etc. This
  68. ## text will set the style and also be displayed
  69. of rnOverline, rnHeadline, rnMarkdownHeadline:
  70. level*: int ## level of headings starting from 1 (main
  71. ## chapter) to larger ones (minor sub-sections)
  72. ## level=0 means it's document title or subtitle
  73. of rnFootnote, rnCitation, rnOptionListItem:
  74. order*: int ## footnote order (for auto-symbol footnotes and
  75. ## auto-numbered ones without a label)
  76. of rnMarkdownBlockQuoteItem:
  77. quotationDepth*: int ## number of characters in line prefix
  78. of rnRstRef, rnPandocRef, rnSubstitutionReferences, rnInterpretedText,
  79. rnField, rnInlineCode, rnCodeBlock, rnFootnoteRef:
  80. info*: TLineInfo ## To have line/column info for warnings at
  81. ## nodes that are post-processed after parsing
  82. of rnNimdocRef:
  83. tooltip*: string
  84. of rnTable, rnGridTable, rnMarkdownTable:
  85. colCount*: int ## Number of (not-united) cells in the table
  86. of rnTableRow:
  87. endsHeader*: bool ## Is last row in the header of table?
  88. of rnTableHeaderCell, rnTableDataCell:
  89. span*: int ## Number of table columns that the cell occupies
  90. else:
  91. nil
  92. anchor*: string ## anchor, internal link target
  93. ## (aka HTML id tag, aka Latex label/hypertarget)
  94. sons*: RstNodeSeq ## the node's sons">RstNode</a></li>
  95. <li><a class="reference" href="#RstNodeKind" title="RstNodeKind = enum
  96. rnInner, rnHeadline, rnOverline, rnMarkdownHeadline, rnTransition,
  97. rnParagraph, rnBulletList, rnBulletItem, rnEnumList, rnEnumItem, rnDefList,
  98. rnMdDefList, rnDefItem, rnDefName, rnDefBody, rnFieldList, rnField,
  99. rnFieldName, rnFieldBody, rnOptionList, rnOptionListItem, rnOptionGroup,
  100. rnOption, rnOptionString, rnOptionArgument, rnDescription, rnLiteralBlock,
  101. rnMarkdownBlockQuote, rnMarkdownBlockQuoteItem, rnLineBlock, rnLineBlockItem,
  102. rnBlockQuote, rnTable, rnGridTable, rnMarkdownTable, rnTableRow,
  103. rnTableHeaderCell, rnTableDataCell, rnFootnote, rnCitation, rnFootnoteGroup,
  104. rnStandaloneHyperlink, rnHyperlink, rnRstRef, rnPandocRef, rnInternalRef,
  105. rnFootnoteRef, rnNimdocRef, rnDirective, rnDirArg, rnRaw, rnTitle, rnContents,
  106. rnImage, rnFigure, rnCodeBlock, rnAdmonition, rnRawHtml, rnRawLatex,
  107. rnContainer, rnIndex, rnSubstitutionDef, rnInlineCode, rnCodeFragment,
  108. rnUnknownRole, rnSub, rnSup, rnIdx, rnEmphasis, rnStrongEmphasis,
  109. rnTripleEmphasis, rnInterpretedText, rnInlineLiteral, rnInlineTarget,
  110. rnSubstitutionReferences, rnSmiley, rnDefaultRole, rnLeaf">RstNodeKind</a></li>
  111. <li><a class="reference" href="#RstNodeSeq" title="RstNodeSeq = seq[PRstNode]">RstNodeSeq</a></li>
  112. <li><a class="reference" href="#TLineInfo" title="TLineInfo = object
  113. line*: uint16
  114. col*: int16
  115. fileIndex*: FileIndex">TLineInfo</a></li>
  116. </ul>
  117. </details>
  118. </li>
  119. <li>
  120. <details open>
  121. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  122. <ul class="simple simple-toc-section">
  123. <ul class="simple nested-toc-section">==
  124. <li><a class="reference" href="#%3D%3D%2CFileIndex%2CFileIndex" title="`==`(a, b: FileIndex): bool">`==`(a, b: FileIndex): bool</a></li>
  125. </ul>
  126. <ul class="simple nested-toc-section">add
  127. <li><a class="reference" href="#add%2CPRstNode%2CPRstNode" title="add(father, son: PRstNode)">add(father, son: PRstNode)</a></li>
  128. <li><a class="reference" href="#add%2CPRstNode%2Cstring" title="add(father: PRstNode; s: string)">add(father: PRstNode; s: string)</a></li>
  129. </ul>
  130. <ul class="simple nested-toc-section">addIfNotNil
  131. <li><a class="reference" href="#addIfNotNil%2CPRstNode%2CPRstNode" title="addIfNotNil(father, son: PRstNode)">addIfNotNil(father, son: PRstNode)</a></li>
  132. </ul>
  133. <ul class="simple nested-toc-section">lastSon
  134. <li><a class="reference" href="#lastSon%2CPRstNode" title="lastSon(n: PRstNode): PRstNode">lastSon(n: PRstNode): PRstNode</a></li>
  135. </ul>
  136. <ul class="simple nested-toc-section">len
  137. <li><a class="reference" href="#len%2CPRstNode" title="len(n: PRstNode): int">len(n: PRstNode): int</a></li>
  138. </ul>
  139. <ul class="simple nested-toc-section">newRstLeaf
  140. <li><a class="reference" href="#newRstLeaf%2Cstring" title="newRstLeaf(s: string): PRstNode">newRstLeaf(s: string): PRstNode</a></li>
  141. </ul>
  142. <ul class="simple nested-toc-section">newRstNode
  143. <li><a class="reference" href="#newRstNode%2CRstNodeKind%2CTLineInfo%2Cseq%5BPRstNode%5D" title="newRstNode(kind: RstNodeKind; info: TLineInfo; sons: seq[PRstNode] = @[]): PRstNode">newRstNode(kind: RstNodeKind; info: TLineInfo; sons: seq[PRstNode] = @[]): PRstNode</a></li>
  144. <li><a class="reference" href="#newRstNode%2CRstNodeKind%2Cstring" title="newRstNode(kind: RstNodeKind; s: string): PRstNode">newRstNode(kind: RstNodeKind; s: string): PRstNode</a></li>
  145. <li><a class="reference" href="#newRstNode%2CRstNodeKind%2Cseq%5BPRstNode%5D%2Cstring" title="newRstNode(kind: RstNodeKind; sons: seq[PRstNode] = @[]; anchor = &quot;&quot;): PRstNode">newRstNode(kind: RstNodeKind; sons: seq[PRstNode] = @[]; anchor = &quot;&quot;): PRstNode</a></li>
  146. </ul>
  147. <ul class="simple nested-toc-section">renderRstToJson
  148. <li><a class="reference" href="#renderRstToJson%2CPRstNode" title="renderRstToJson(node: PRstNode): string">renderRstToJson(node: PRstNode): string</a></li>
  149. </ul>
  150. <ul class="simple nested-toc-section">renderRstToRst
  151. <li><a class="reference" href="#renderRstToRst%2CPRstNode%2Cstring" title="renderRstToRst(n: PRstNode; result: var string)">renderRstToRst(n: PRstNode; result: var string)</a></li>
  152. </ul>
  153. <ul class="simple nested-toc-section">renderRstToText
  154. <li><a class="reference" href="#renderRstToText%2CPRstNode" title="renderRstToText(node: PRstNode): string">renderRstToText(node: PRstNode): string</a></li>
  155. </ul>
  156. <ul class="simple nested-toc-section">treeRepr
  157. <li><a class="reference" href="#treeRepr%2CPRstNode%2Cint" title="treeRepr(node: PRstNode; indent = 0): string">treeRepr(node: PRstNode; indent = 0): string</a></li>
  158. </ul>
  159. </ul>
  160. </details>
  161. </li>
  162. </ul>
  163. </div>
  164. <div class="nine columns" id="content">
  165. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  166. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  167. <div id="tocRoot"></div>
  168. <p class="module-desc">This module implements an AST for the <span id="restructuredtext_1">reStructuredText</span> parser.</p>
  169. <div class="section" id="6">
  170. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  171. <dl class="item">
  172. <a class="reference external" href="strutils.html">strutils</a>, <a class="reference external" href="json.html">json</a>, <a class="reference external" href="assertions.html">assertions</a>
  173. </dl>
  174. </div>
  175. <div class="section" id="7">
  176. <h1><a class="toc-backref" href="#7">Types</a></h1>
  177. <dl class="item">
  178. <div id="FileIndex">
  179. <dt><pre><a href="rstast.html#FileIndex"><span class="Identifier">FileIndex</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <a href="system.html#int32"><span class="Identifier">int32</span></a></pre></dt>
  180. <dd>
  181. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L88" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  182. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L88" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  183. </dd>
  184. </div>
  185. <div id="PRstNode">
  186. <dt><pre><a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <a href="rstast.html#RstNode"><span class="Identifier">RstNode</span></a></pre></dt>
  187. <dd>
  188. an RST node
  189. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L94" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  190. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L94" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  191. </dd>
  192. </div>
  193. <div id="RstNode">
  194. <dt><pre><a href="rstast.html#RstNode"><span class="Identifier">RstNode</span></a> {.<span class="Identifier">acyclic</span><span class="Other">,</span> <span class="Identifier">final</span>.} <span class="Other">=</span> <span class="Keyword">object</span>
  195. <span class="Keyword">case</span> <span class="Identifier">kind</span><span class="Operator">*</span><span class="Other">:</span> <a href="rstast.html#RstNodeKind"><span class="Identifier">RstNodeKind</span></a> <span class="Comment">## the node's kind</span>
  196. <span class="Keyword">of</span> <span class="Identifier">rnLeaf</span><span class="Other">,</span> <span class="Identifier">rnSmiley</span><span class="Other">:</span>
  197. <span class="Identifier">text</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## string that is expected to be displayed</span>
  198. <span class="Keyword">of</span> <span class="Identifier">rnEnumList</span><span class="Other">:</span>
  199. <span class="Identifier">labelFmt</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## label format like &quot;(1)&quot;</span>
  200. <span class="Keyword">of</span> <span class="Identifier">rnLineBlockItem</span><span class="Other">:</span>
  201. <span class="Identifier">lineIndent</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## a few spaces or newline at the line beginning</span>
  202. <span class="Keyword">of</span> <span class="Identifier">rnAdmonition</span><span class="Other">:</span>
  203. <span class="Identifier">adType</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## admonition type: &quot;note&quot;, &quot;caution&quot;, etc. This</span>
  204. <span class="Comment">## text will set the style and also be displayed</span>
  205. <span class="Keyword">of</span> <span class="Identifier">rnOverline</span><span class="Other">,</span> <span class="Identifier">rnHeadline</span><span class="Other">,</span> <span class="Identifier">rnMarkdownHeadline</span><span class="Other">:</span>
  206. <span class="Identifier">level</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> <span class="Comment">## level of headings starting from 1 (main</span>
  207. <span class="Comment">## chapter) to larger ones (minor sub-sections)</span>
  208. <span class="Comment">## level=0 means it's document title or subtitle</span>
  209. <span class="Keyword">of</span> <span class="Identifier">rnFootnote</span><span class="Other">,</span> <span class="Identifier">rnCitation</span><span class="Other">,</span> <span class="Identifier">rnOptionListItem</span><span class="Other">:</span>
  210. <span class="Identifier">order</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> <span class="Comment">## footnote order (for auto-symbol footnotes and</span>
  211. <span class="Comment">## auto-numbered ones without a label)</span>
  212. <span class="Keyword">of</span> <span class="Identifier">rnMarkdownBlockQuoteItem</span><span class="Other">:</span>
  213. <span class="Identifier">quotationDepth</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> <span class="Comment">## number of characters in line prefix</span>
  214. <span class="Keyword">of</span> <span class="Identifier">rnRstRef</span><span class="Other">,</span> <span class="Identifier">rnPandocRef</span><span class="Other">,</span> <span class="Identifier">rnSubstitutionReferences</span><span class="Other">,</span> <span class="Identifier">rnInterpretedText</span><span class="Other">,</span>
  215. <span class="Identifier">rnField</span><span class="Other">,</span> <span class="Identifier">rnInlineCode</span><span class="Other">,</span> <span class="Identifier">rnCodeBlock</span><span class="Other">,</span> <span class="Identifier">rnFootnoteRef</span><span class="Other">:</span>
  216. <span class="Identifier">info</span><span class="Operator">*</span><span class="Other">:</span> <a href="rstast.html#TLineInfo"><span class="Identifier">TLineInfo</span></a> <span class="Comment">## To have line/column info for warnings at</span>
  217. <span class="Comment">## nodes that are post-processed after parsing</span>
  218. <span class="Keyword">of</span> <span class="Identifier">rnNimdocRef</span><span class="Other">:</span>
  219. <span class="Identifier">tooltip</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a>
  220. <span class="Keyword">of</span> <span class="Identifier">rnTable</span><span class="Other">,</span> <span class="Identifier">rnGridTable</span><span class="Other">,</span> <span class="Identifier">rnMarkdownTable</span><span class="Other">:</span>
  221. <span class="Identifier">colCount</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> <span class="Comment">## Number of (not-united) cells in the table</span>
  222. <span class="Keyword">of</span> <span class="Identifier">rnTableRow</span><span class="Other">:</span>
  223. <span class="Identifier">endsHeader</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> <span class="Comment">## Is last row in the header of table?</span>
  224. <span class="Keyword">of</span> <span class="Identifier">rnTableHeaderCell</span><span class="Other">,</span> <span class="Identifier">rnTableDataCell</span><span class="Other">:</span>
  225. <span class="Identifier">span</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> <span class="Comment">## Number of table columns that the cell occupies</span>
  226. <span class="Keyword">else</span><span class="Other">:</span>
  227. <span class="Keyword">nil</span>
  228. <span class="Identifier">anchor</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## anchor, internal link target</span>
  229. <span class="Comment">## (aka HTML id tag, aka Latex label/hypertarget)</span>
  230. <span class="Identifier">sons</span><span class="Operator">*</span><span class="Other">:</span> <a href="rstast.html#RstNodeSeq"><span class="Identifier">RstNodeSeq</span></a> <span class="Comment">## the node's sons</span></pre></dt>
  231. <dd>
  232. AST node (result of RST parsing)
  233. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L96" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  234. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L96" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  235. </dd>
  236. </div>
  237. <div id="RstNodeKind">
  238. <dt><pre><a href="rstast.html#RstNodeKind"><span class="Identifier">RstNodeKind</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  239. <span class="Identifier">rnInner</span><span class="Other">,</span> <span class="Identifier">rnHeadline</span><span class="Other">,</span> <span class="Identifier">rnOverline</span><span class="Other">,</span> <span class="Identifier">rnMarkdownHeadline</span><span class="Other">,</span> <span class="Identifier">rnTransition</span><span class="Other">,</span>
  240. <span class="Identifier">rnParagraph</span><span class="Other">,</span> <span class="Identifier">rnBulletList</span><span class="Other">,</span> <span class="Identifier">rnBulletItem</span><span class="Other">,</span> <span class="Identifier">rnEnumList</span><span class="Other">,</span> <span class="Identifier">rnEnumItem</span><span class="Other">,</span> <span class="Identifier">rnDefList</span><span class="Other">,</span>
  241. <span class="Identifier">rnMdDefList</span><span class="Other">,</span> <span class="Identifier">rnDefItem</span><span class="Other">,</span> <span class="Identifier">rnDefName</span><span class="Other">,</span> <span class="Identifier">rnDefBody</span><span class="Other">,</span> <span class="Identifier">rnFieldList</span><span class="Other">,</span> <span class="Identifier">rnField</span><span class="Other">,</span>
  242. <span class="Identifier">rnFieldName</span><span class="Other">,</span> <span class="Identifier">rnFieldBody</span><span class="Other">,</span> <span class="Identifier">rnOptionList</span><span class="Other">,</span> <span class="Identifier">rnOptionListItem</span><span class="Other">,</span> <span class="Identifier">rnOptionGroup</span><span class="Other">,</span>
  243. <span class="Identifier">rnOption</span><span class="Other">,</span> <span class="Identifier">rnOptionString</span><span class="Other">,</span> <span class="Identifier">rnOptionArgument</span><span class="Other">,</span> <span class="Identifier">rnDescription</span><span class="Other">,</span> <span class="Identifier">rnLiteralBlock</span><span class="Other">,</span>
  244. <span class="Identifier">rnMarkdownBlockQuote</span><span class="Other">,</span> <span class="Identifier">rnMarkdownBlockQuoteItem</span><span class="Other">,</span> <span class="Identifier">rnLineBlock</span><span class="Other">,</span> <span class="Identifier">rnLineBlockItem</span><span class="Other">,</span>
  245. <span class="Identifier">rnBlockQuote</span><span class="Other">,</span> <span class="Identifier">rnTable</span><span class="Other">,</span> <span class="Identifier">rnGridTable</span><span class="Other">,</span> <span class="Identifier">rnMarkdownTable</span><span class="Other">,</span> <span class="Identifier">rnTableRow</span><span class="Other">,</span>
  246. <span class="Identifier">rnTableHeaderCell</span><span class="Other">,</span> <span class="Identifier">rnTableDataCell</span><span class="Other">,</span> <span class="Identifier">rnFootnote</span><span class="Other">,</span> <span class="Identifier">rnCitation</span><span class="Other">,</span> <span class="Identifier">rnFootnoteGroup</span><span class="Other">,</span>
  247. <span class="Identifier">rnStandaloneHyperlink</span><span class="Other">,</span> <span class="Identifier">rnHyperlink</span><span class="Other">,</span> <span class="Identifier">rnRstRef</span><span class="Other">,</span> <span class="Identifier">rnPandocRef</span><span class="Other">,</span> <span class="Identifier">rnInternalRef</span><span class="Other">,</span>
  248. <span class="Identifier">rnFootnoteRef</span><span class="Other">,</span> <span class="Identifier">rnNimdocRef</span><span class="Other">,</span> <span class="Identifier">rnDirective</span><span class="Other">,</span> <span class="Identifier">rnDirArg</span><span class="Other">,</span> <span class="Identifier">rnRaw</span><span class="Other">,</span> <span class="Identifier">rnTitle</span><span class="Other">,</span> <span class="Identifier">rnContents</span><span class="Other">,</span>
  249. <span class="Identifier">rnImage</span><span class="Other">,</span> <span class="Identifier">rnFigure</span><span class="Other">,</span> <span class="Identifier">rnCodeBlock</span><span class="Other">,</span> <span class="Identifier">rnAdmonition</span><span class="Other">,</span> <span class="Identifier">rnRawHtml</span><span class="Other">,</span> <span class="Identifier">rnRawLatex</span><span class="Other">,</span>
  250. <span class="Identifier">rnContainer</span><span class="Other">,</span> <span class="Identifier">rnIndex</span><span class="Other">,</span> <span class="Identifier">rnSubstitutionDef</span><span class="Other">,</span> <span class="Identifier">rnInlineCode</span><span class="Other">,</span> <span class="Identifier">rnCodeFragment</span><span class="Other">,</span>
  251. <span class="Identifier">rnUnknownRole</span><span class="Other">,</span> <span class="Identifier">rnSub</span><span class="Other">,</span> <span class="Identifier">rnSup</span><span class="Other">,</span> <span class="Identifier">rnIdx</span><span class="Other">,</span> <span class="Identifier">rnEmphasis</span><span class="Other">,</span> <span class="Identifier">rnStrongEmphasis</span><span class="Other">,</span>
  252. <span class="Identifier">rnTripleEmphasis</span><span class="Other">,</span> <span class="Identifier">rnInterpretedText</span><span class="Other">,</span> <span class="Identifier">rnInlineLiteral</span><span class="Other">,</span> <span class="Identifier">rnInlineTarget</span><span class="Other">,</span>
  253. <span class="Identifier">rnSubstitutionReferences</span><span class="Other">,</span> <span class="Identifier">rnSmiley</span><span class="Other">,</span> <span class="Identifier">rnDefaultRole</span><span class="Other">,</span> <span class="Identifier">rnLeaf</span></pre></dt>
  254. <dd>
  255. the possible node kinds of an PRstNode
  256. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L19" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  257. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L19" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  258. </dd>
  259. </div>
  260. <div id="RstNodeSeq">
  261. <dt><pre><a href="rstast.html#RstNodeSeq"><span class="Identifier">RstNodeSeq</span></a> <span class="Other">=</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">]</span></pre></dt>
  262. <dd>
  263. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L95" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  264. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L95" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  265. </dd>
  266. </div>
  267. <div id="TLineInfo">
  268. <dt><pre><a href="rstast.html#TLineInfo"><span class="Identifier">TLineInfo</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
  269. <span class="Identifier">line</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#uint16"><span class="Identifier">uint16</span></a>
  270. <span class="Identifier">col</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int16"><span class="Identifier">int16</span></a>
  271. <span class="Identifier">fileIndex</span><span class="Operator">*</span><span class="Other">:</span> <a href="rstast.html#FileIndex"><span class="Identifier">FileIndex</span></a></pre></dt>
  272. <dd>
  273. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L89" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  274. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L89" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  275. </dd>
  276. </div>
  277. </dl>
  278. </div>
  279. <div class="section" id="12">
  280. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  281. <dl class="item">
  282. <div id="==-procs-all">
  283. <div id="==,FileIndex,FileIndex">
  284. <dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2CFileIndex%2CFileIndex"><span class="Identifier">`==`</span></a><span class="Other">(</span><span class="Identifier">a</span><span class="Other">,</span> <span class="Identifier">b</span><span class="Other">:</span> <a href="rstast.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span class="Identifier">borrow</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  285. <dd>
  286. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L134" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  287. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L134" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  288. </dd>
  289. </div>
  290. </div>
  291. <div id="add-procs-all">
  292. <div id="add,PRstNode,PRstNode">
  293. <dt><pre><span class="Keyword">proc</span> <a href="#add%2CPRstNode%2CPRstNode"><span class="Identifier">add</span></a><span class="Other">(</span><span class="Identifier">father</span><span class="Other">,</span> <span class="Identifier">son</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  294. <dd>
  295. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L160" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  296. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L160" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  297. </dd>
  298. </div>
  299. <div id="add,PRstNode,string">
  300. <dt><pre><span class="Keyword">proc</span> <a href="#add%2CPRstNode%2Cstring"><span class="Identifier">add</span></a><span class="Other">(</span><span class="Identifier">father</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  301. <dd>
  302. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L163" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  303. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L163" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  304. </dd>
  305. </div>
  306. </div>
  307. <div id="addIfNotNil-procs-all">
  308. <div id="addIfNotNil,PRstNode,PRstNode">
  309. <dt><pre><span class="Keyword">proc</span> <a href="#addIfNotNil%2CPRstNode%2CPRstNode"><span class="Identifier">addIfNotNil</span></a><span class="Other">(</span><span class="Identifier">father</span><span class="Other">,</span> <span class="Identifier">son</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  310. <dd>
  311. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L166" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  312. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L166" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  313. </dd>
  314. </div>
  315. </div>
  316. <div id="lastSon-procs-all">
  317. <div id="lastSon,PRstNode">
  318. <dt><pre><span class="Keyword">proc</span> <a href="#lastSon%2CPRstNode"><span class="Identifier">lastSon</span></a><span class="Other">(</span><span class="Identifier">n</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  319. <dd>
  320. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L157" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  321. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L157" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  322. </dd>
  323. </div>
  324. </div>
  325. <div id="len-procs-all">
  326. <div id="len,PRstNode">
  327. <dt><pre><span class="Keyword">proc</span> <a href="#len%2CPRstNode"><span class="Identifier">len</span></a><span class="Other">(</span><span class="Identifier">n</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  328. <dd>
  329. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L136" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  330. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L136" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  331. </dd>
  332. </div>
  333. </div>
  334. <div id="newRstLeaf-procs-all">
  335. <div id="newRstLeaf,string">
  336. <dt><pre><span class="Keyword">proc</span> <a href="#newRstLeaf%2Cstring"><span class="Identifier">newRstLeaf</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  337. <dd>
  338. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L153" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  339. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L153" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  340. </dd>
  341. </div>
  342. </div>
  343. <div id="newRstNode-procs-all">
  344. <div id="newRstNode,RstNodeKind,TLineInfo,seq[PRstNode]">
  345. <dt><pre><span class="Keyword">proc</span> <a href="#newRstNode%2CRstNodeKind%2CTLineInfo%2Cseq%5BPRstNode%5D"><span class="Identifier">newRstNode</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="rstast.html#RstNodeKind"><span class="Identifier">RstNodeKind</span></a><span class="Other">;</span> <span class="Identifier">info</span><span class="Other">:</span> <a href="rstast.html#TLineInfo"><span class="Identifier">TLineInfo</span></a><span class="Other">;</span> <span class="Identifier">sons</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.
  346. <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  347. <dd>
  348. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L143" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  349. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L143" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  350. </dd>
  351. </div>
  352. <div id="newRstNode,RstNodeKind,string">
  353. <dt><pre><span class="Keyword">proc</span> <a href="#newRstNode%2CRstNodeKind%2Cstring"><span class="Identifier">newRstNode</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="rstast.html#RstNodeKind"><span class="Identifier">RstNodeKind</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">,</span>
  354. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  355. <dd>
  356. <div class="deprecation-message">
  357. <b>Deprecated</b>
  358. </div>
  359. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L148" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  360. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L148" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  361. </dd>
  362. </div>
  363. <div id="newRstNode,RstNodeKind,seq[PRstNode],string">
  364. <dt><pre><span class="Keyword">proc</span> <a href="#newRstNode%2CRstNodeKind%2Cseq%5BPRstNode%5D%2Cstring"><span class="Identifier">newRstNode</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="rstast.html#RstNodeKind"><span class="Identifier">RstNodeKind</span></a><span class="Other">;</span> <span class="Identifier">sons</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">anchor</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.
  365. <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  366. <dd>
  367. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L139" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  368. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L139" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  369. </dd>
  370. </div>
  371. </div>
  372. <div id="renderRstToJson-procs-all">
  373. <div id="renderRstToJson,PRstNode">
  374. <dt><pre><span class="Keyword">proc</span> <a href="#renderRstToJson%2CPRstNode"><span class="Identifier">renderRstToJson</span></a><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  375. <dd>
  376. Writes the given RST node as JSON that is in the form<pre>{
  377. &quot;kind&quot;:string node.kind,
  378. &quot;text&quot;:optional string node.text,
  379. &quot;level&quot;:optional int node.level,
  380. &quot;sons&quot;:optional node array
  381. }</pre>
  382. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L378" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  383. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L378" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  384. </dd>
  385. </div>
  386. </div>
  387. <div id="renderRstToRst-procs-all">
  388. <div id="renderRstToRst,PRstNode,string">
  389. <dt><pre><span class="Keyword">proc</span> <a href="#renderRstToRst%2CPRstNode%2Cstring"><span class="Identifier">renderRstToRst</span></a><span class="Other">(</span><span class="Identifier">n</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">;</span> <span class="Identifier">result</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
  390. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  391. <dd>
  392. renders <tt class="docutils literal"><span class="pre"><span class="Identifier">n</span></span></tt> into its string representation and appends to <tt class="docutils literal"><span class="pre"><span class="Identifier">result</span></span></tt>.
  393. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L359" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  394. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L359" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  395. </dd>
  396. </div>
  397. </div>
  398. <div id="renderRstToText-procs-all">
  399. <div id="renderRstToText,PRstNode">
  400. <dt><pre><span class="Keyword">proc</span> <a href="#renderRstToText%2CPRstNode"><span class="Identifier">renderRstToText</span></a><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  401. <dd>
  402. minimal text representation of markup node
  403. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L389" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  404. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L389" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  405. </dd>
  406. </div>
  407. </div>
  408. <div id="treeRepr-procs-all">
  409. <div id="treeRepr,PRstNode,int">
  410. <dt><pre><span class="Keyword">proc</span> <a href="#treeRepr%2CPRstNode%2Cint"><span class="Identifier">treeRepr</span></a><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">;</span> <span class="Identifier">indent</span> <span class="Other">=</span> <span class="DecNumber">0</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  411. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  412. <dd>
  413. Writes the parsed RST <tt class="docutils literal"><span class="pre"><span class="Identifier">node</span></span></tt> into an AST tree with compact string representation in the format (one line per every sub-node): <tt class="docutils literal"><span class="pre">indent - kind - [text|level|order|adType] - anchor (if non-zero)</span></tt> (suitable for debugging of RST parsing).
  414. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rstast.nim#L405" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  415. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L405" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  416. </dd>
  417. </div>
  418. </div>
  419. </dl>
  420. </div>
  421. </div>
  422. </div>
  423. <div class="twelve-columns footer">
  424. <span class="nim-sprite"></span>
  425. <br>
  426. <small style="color: var(--hint);">Made with Nim. Generated: 2025-03-15 14:13:38 UTC</small>
  427. </div>
  428. </div>
  429. </div>
  430. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  431. </body>
  432. </html>