rst.html 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  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/rst</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/rst</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="#EParseError" title="EParseError = object of ValueError">EParseError</a></li>
  57. <li><a class="reference" href="#FindFileHandler" title="FindFileHandler = proc (filename: string): string {.closure, gcsafe.}">FindFileHandler</a></li>
  58. <li><a class="reference" href="#FindRefFileHandler" title="FindRefFileHandler = proc (targetRelPath: string): tuple[targetPath: string,
  59. linkRelPath: string] {.closure, gcsafe.}">FindRefFileHandler</a></li>
  60. <li><a class="reference" href="#MsgClass" title="MsgClass = enum
  61. mcHint = &quot;Hint&quot;, mcWarning = &quot;Warning&quot;, mcError = &quot;Error&quot;">MsgClass</a></li>
  62. <li><a class="reference" href="#MsgHandler" title="MsgHandler = proc (filename: string; line, col: int; msgKind: MsgKind;
  63. arg: string) {.closure, gcsafe.}">MsgHandler</a></li>
  64. <li><a class="reference" href="#MsgKind" title="MsgKind = enum
  65. meCannotOpenFile = &quot;cannot open \'$1\'&quot;, meExpected = &quot;\'$1\' expected&quot;,
  66. meMissingClosing = &quot;$1&quot;,
  67. meGridTableNotImplemented = &quot;grid table is not implemented&quot;,
  68. meMarkdownIllformedTable = &quot;illformed delimiter row of a Markdown table&quot;,
  69. meIllformedTable = &quot;Illformed table: $1&quot;,
  70. meNewSectionExpected = &quot;new section expected $1&quot;,
  71. meGeneralParseError = &quot;general parse error&quot;,
  72. meInvalidDirective = &quot;invalid directive: \'$1\'&quot;,
  73. meInvalidField = &quot;invalid field: $1&quot;,
  74. meFootnoteMismatch = &quot;mismatch in number of footnotes and their refs: $1&quot;,
  75. mwRedefinitionOfLabel = &quot;redefinition of label \'$1\'&quot;,
  76. mwUnknownSubstitution = &quot;unknown substitution \'$1\'&quot;,
  77. mwAmbiguousLink = &quot;ambiguous doc link $1&quot;,
  78. mwBrokenLink = &quot;broken link \'$1\'&quot;,
  79. mwUnsupportedLanguage = &quot;language \'$1\' not supported&quot;,
  80. mwUnsupportedField = &quot;field \'$1\' not supported&quot;,
  81. mwRstStyle = &quot;RST style: $1&quot;,
  82. mwUnusedImportdoc = &quot;importdoc for \'$1\' is not used&quot;,
  83. meSandboxedDirective = &quot;disabled directive: \'$1\'&quot;">MsgKind</a></li>
  84. <li><a class="reference" href="#PRstSharedState" title="PRstSharedState = ref RstSharedState">PRstSharedState</a></li>
  85. <li><a class="reference" href="#RstFileTable" title="RstFileTable = object
  86. filenameToIdx*: Table[string, FileIndex]
  87. idxToFilename*: seq[string]">RstFileTable</a></li>
  88. <li><a class="reference" href="#RstParseOption" title="RstParseOption = enum
  89. roSupportSmilies, ## make the RST parser support smilies like ``:)``
  90. roSupportRawDirective, ## support the ``raw`` directive (don't support
  91. ## it for sandboxing)
  92. roSupportMarkdown, ## support additional features of Markdown
  93. roPreferMarkdown, ## parse as Markdown (keeping RST as &quot;extension&quot;
  94. ## to Markdown) -- implies `roSupportMarkdown`
  95. roNimFile, ## set for Nim files where default interpreted
  96. ## text role should be :nim:
  97. roSandboxDisabled ## this option enables certain options
  98. ## (e.g. raw, include, importdoc)
  99. ## which are disabled by default as they can
  100. ## enable users to read arbitrary data and
  101. ## perform XSS if the parser is used in a web
  102. ## app.">RstParseOption</a></li>
  103. <li><a class="reference" href="#RstParseOptions" title="RstParseOptions = set[RstParseOption]">RstParseOptions</a></li>
  104. </ul>
  105. </details>
  106. </li>
  107. <li>
  108. <details open>
  109. <summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
  110. <ul class="simple simple-toc-section">
  111. <li><a class="reference" href="#ColRstInit" title="ColRstInit = 0">ColRstInit</a></li>
  112. <li><a class="reference" href="#ColRstOffset" title="ColRstOffset = 1">ColRstOffset</a></li>
  113. <li><a class="reference" href="#LineRstInit" title="LineRstInit = 1">LineRstInit</a></li>
  114. </ul>
  115. </details>
  116. </li>
  117. <li>
  118. <details open>
  119. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  120. <ul class="simple simple-toc-section">
  121. <ul class="simple nested-toc-section">addAnchorNim
  122. <li><a class="reference" href="#addAnchorNim%2CPRstSharedState%2Cbool%2Cstring%2Cstring%2CLangSymbol%2Cint%2CTLineInfo%2CFileIndex" title="addAnchorNim(s: var PRstSharedState; external: bool; refn: string;
  123. tooltip: string; langSym: LangSymbol; priority: int;
  124. info: TLineInfo; module: FileIndex)">addAnchorNim(s: var PRstSharedState; external: bool; refn: string;
  125. tooltip: string; langSym: LangSymbol; priority: int;
  126. info: TLineInfo; module: FileIndex)</a></li>
  127. </ul>
  128. <ul class="simple nested-toc-section">addFilename
  129. <li><a class="reference" href="#addFilename%2CPRstSharedState%2Cstring" title="addFilename(s: PRstSharedState; file1: string): FileIndex">addFilename(s: PRstSharedState; file1: string): FileIndex</a></li>
  130. </ul>
  131. <ul class="simple nested-toc-section">addNodes
  132. <li><a class="reference" href="#addNodes%2CPRstNode" title="addNodes(n: PRstNode): string">addNodes(n: PRstNode): string</a></li>
  133. </ul>
  134. <ul class="simple nested-toc-section">completePass2
  135. <li><a class="reference" href="#completePass2%2CPRstSharedState" title="completePass2(s: PRstSharedState)">completePass2(s: PRstSharedState)</a></li>
  136. </ul>
  137. <ul class="simple nested-toc-section">defaultFindFile
  138. <li><a class="reference" href="#defaultFindFile%2Cstring" title="defaultFindFile(filename: string): string">defaultFindFile(filename: string): string</a></li>
  139. </ul>
  140. <ul class="simple nested-toc-section">defaultFindRefFile
  141. <li><a class="reference" href="#defaultFindRefFile%2Cstring" title="defaultFindRefFile(filename: string): (string, string)">defaultFindRefFile(filename: string): (string, string)</a></li>
  142. </ul>
  143. <ul class="simple nested-toc-section">defaultMsgHandler
  144. <li><a class="reference" href="#defaultMsgHandler%2Cstring%2Cint%2Cint%2CMsgKind%2Cstring" title="defaultMsgHandler(filename: string; line, col: int; msgkind: MsgKind;
  145. arg: string)">defaultMsgHandler(filename: string; line, col: int; msgkind: MsgKind;
  146. arg: string)</a></li>
  147. </ul>
  148. <ul class="simple nested-toc-section">getArgument
  149. <li><a class="reference" href="#getArgument%2CPRstNode" title="getArgument(n: PRstNode): string">getArgument(n: PRstNode): string</a></li>
  150. </ul>
  151. <ul class="simple nested-toc-section">getFieldValue
  152. <li><a class="reference" href="#getFieldValue%2CPRstNode" title="getFieldValue(n: PRstNode): string">getFieldValue(n: PRstNode): string</a></li>
  153. <li><a class="reference" href="#getFieldValue%2CPRstNode%2Cstring" title="getFieldValue(n: PRstNode; fieldname: string): string">getFieldValue(n: PRstNode; fieldname: string): string</a></li>
  154. </ul>
  155. <ul class="simple nested-toc-section">newRstSharedState
  156. <li><a class="reference" href="#newRstSharedState%2CRstParseOptions%2Cstring%2CFindFileHandler%2CFindRefFileHandler%2CMsgHandler%2Cbool" title="newRstSharedState(options: RstParseOptions; filename: string;
  157. findFile: FindFileHandler; findRefFile: FindRefFileHandler;
  158. msgHandler: MsgHandler; hasToc: bool): PRstSharedState">newRstSharedState(options: RstParseOptions; filename: string;
  159. findFile: FindFileHandler; findRefFile: FindRefFileHandler;
  160. msgHandler: MsgHandler; hasToc: bool): PRstSharedState</a></li>
  161. </ul>
  162. <ul class="simple nested-toc-section">preparePass2
  163. <li><a class="reference" href="#preparePass2%2CPRstSharedState%2CPRstNode" title="preparePass2(s: var PRstSharedState; mainNode: PRstNode; importdoc = true)">preparePass2(s: var PRstSharedState; mainNode: PRstNode; importdoc = true)</a></li>
  164. </ul>
  165. <ul class="simple nested-toc-section">resolveSubs
  166. <li><a class="reference" href="#resolveSubs%2CPRstSharedState%2CPRstNode" title="resolveSubs(s: PRstSharedState; n: PRstNode): PRstNode">resolveSubs(s: PRstSharedState; n: PRstNode): PRstNode</a></li>
  167. </ul>
  168. <ul class="simple nested-toc-section">rstMessage
  169. <li><a class="reference" href="#rstMessage%2CRstFileTable%2CMsgHandler%2CTLineInfo%2CMsgKind%2Cstring" title="rstMessage(filenames: RstFileTable; f: MsgHandler; info: TLineInfo;
  170. msgKind: MsgKind; arg: string)">rstMessage(filenames: RstFileTable; f: MsgHandler; info: TLineInfo;
  171. msgKind: MsgKind; arg: string)</a></li>
  172. </ul>
  173. <ul class="simple nested-toc-section">rstnodeToRefname
  174. <li><a class="reference" href="#rstnodeToRefname%2CPRstNode" title="rstnodeToRefname(n: PRstNode): string">rstnodeToRefname(n: PRstNode): string</a></li>
  175. </ul>
  176. <ul class="simple nested-toc-section">rstParse
  177. <li><a class="reference" href="#rstParse%2Cstring%2Cstring%2Cint%2Cint%2CRstParseOptions%2CFindFileHandler%2CFindRefFileHandler%2CMsgHandler" title="rstParse(text, filename: string; line, column: int; options: RstParseOptions;
  178. findFile: FindFileHandler = nil; findRefFile: FindRefFileHandler = nil;
  179. msgHandler: MsgHandler = nil): tuple[node: PRstNode,
  180. filenames: RstFileTable, hasToc: bool]">rstParse(text, filename: string; line, column: int; options: RstParseOptions;
  181. findFile: FindFileHandler = nil; findRefFile: FindRefFileHandler = nil;
  182. msgHandler: MsgHandler = nil): tuple[node: PRstNode,
  183. filenames: RstFileTable, hasToc: bool]</a></li>
  184. </ul>
  185. <ul class="simple nested-toc-section">rstParsePass1
  186. <li><a class="reference" href="#rstParsePass1%2Cstring%2Cint%2Cint%2CPRstSharedState" title="rstParsePass1(fragment: string; line, column: int; sharedState: PRstSharedState): PRstNode">rstParsePass1(fragment: string; line, column: int; sharedState: PRstSharedState): PRstNode</a></li>
  187. </ul>
  188. <ul class="simple nested-toc-section">safeProtocol
  189. <li><a class="reference" href="#safeProtocol%2Cstring" title="safeProtocol(linkStr: var string): string">safeProtocol(linkStr: var string): string</a></li>
  190. </ul>
  191. <ul class="simple nested-toc-section">setCurrFilename
  192. <li><a class="reference" href="#setCurrFilename%2CPRstSharedState%2Cstring" title="setCurrFilename(s: PRstSharedState; file1: string)">setCurrFilename(s: PRstSharedState; file1: string)</a></li>
  193. </ul>
  194. <ul class="simple nested-toc-section">whichMsgClass
  195. <li><a class="reference" href="#whichMsgClass%2CMsgKind" title="whichMsgClass(k: MsgKind): MsgClass">whichMsgClass(k: MsgKind): MsgClass</a></li>
  196. </ul>
  197. </ul>
  198. </details>
  199. </li>
  200. </ul>
  201. </div>
  202. <div class="nine columns" id="content">
  203. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  204. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  205. <div id="tocRoot"></div>
  206. <p class="module-desc">This module implements a <span id="restructuredtext_1">reStructuredText</span> (RST) and <span id="markdown_1">Markdown</span> parser. User's manual on supported markup syntax and command line usage can be found in <a class="reference external" href="markdown_rst.html">Nim-flavored Markdown and reStructuredText</a>.<ul class="simple"><li>See also <a class="reference external" href="docgen.html">Nim DocGen Tools Guide</a> for handling of <tt class="docutils literal"><span class="pre">.nim</span></tt> files.</li>
  207. <li>See also <a class="reference external" href="rstgen.html">packages/docutils/rstgen module</a> to know how to generate HTML or Latex strings (for embedding them into custom documents).</li>
  208. </ul>
  209. <p>Choice between Markdown and RST as well as optional additional features are turned on by passing <tt class="docutils literal"><span class="pre">options:</span></tt> <a class="reference internal nimdoc" title="type RstParseOptions" href="#RstParseOptions">RstParseOptions</a> to <a class="reference internal nimdoc" title="proc rstParse(text, filename: string; line, column: int; options: RstParseOptions;
  210. findFile: FindFileHandler = nil; findRefFile: FindRefFileHandler = nil;
  211. msgHandler: MsgHandler = nil): tuple[node: PRstNode,
  212. filenames: RstFileTable, hasToc: bool]" href="#rstParse,string,string,int,int,RstParseOptions,FindFileHandler,FindRefFileHandler,MsgHandler">proc rstParse</a>.</p>
  213. </p>
  214. <div class="section" id="6">
  215. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  216. <dl class="item">
  217. <a class="reference external" href="os.html">os</a>, <a class="reference external" href="strutils.html">strutils</a>, <a class="reference external" href="enumutils.html">enumutils</a>, <a class="reference external" href="algorithm.html">algorithm</a>, <a class="reference external" href="lists.html">lists</a>, <a class="reference external" href="sequtils.html">sequtils</a>, <a class="reference external" href="tables.html">tables</a>, <a class="reference external" href="strscans.html">strscans</a>, <a class="reference external" href="dochelpers.html">dochelpers</a>, <a class="reference external" href="rstidx.html">rstidx</a>, <a class="reference external" href="rstast.html">rstast</a>, <a class="reference external" href="miscdollars.html">miscdollars</a>, <a class="reference external" href="highlite.html">highlite</a>, <a class="reference external" href="assertions.html">assertions</a>, <a class="reference external" href="syncio.html">syncio</a>
  218. </dl>
  219. </div>
  220. <div class="section" id="7">
  221. <h1><a class="toc-backref" href="#7">Types</a></h1>
  222. <dl class="item">
  223. <div id="EParseError">
  224. <dt><pre><a href="rst.html#EParseError"><span class="Identifier">EParseError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#ValueError"><span class="Identifier">ValueError</span></a></pre></dt>
  225. <dd>
  226. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L446" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  227. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L446" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  228. </dd>
  229. </div>
  230. <div id="FindFileHandler">
  231. <dt><pre><a href="rst.html#FindFileHandler"><span class="Identifier">FindFileHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">filename</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="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">closure</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span></span>.}</pre></dt>
  232. <dd>
  233. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L83" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  234. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L83" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  235. </dd>
  236. </div>
  237. <div id="FindRefFileHandler">
  238. <dt><pre><a href="rst.html#FindRefFileHandler"><span class="Identifier">FindRefFileHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">targetRelPath</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">targetPath</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">,</span>
  239. <span class="Identifier">linkRelPath</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> {.<span class="Identifier">closure</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span></span>.}</pre></dt>
  240. <dd>
  241. returns where .html or .idx file should be found by its relative path; <tt class="docutils literal"><span class="pre"><span class="Identifier">linkRelPath</span></span></tt> is a prefix to be added before a link anchor from such file
  242. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L84" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  243. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L84" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  244. </dd>
  245. </div>
  246. <div id="MsgClass">
  247. <dt><pre><a href="rst.html#MsgClass"><span class="Identifier">MsgClass</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  248. <span class="Identifier">mcHint</span> <span class="Other">=</span> <span class="StringLit">&quot;Hint&quot;</span><span class="Other">,</span> <span class="Identifier">mcWarning</span> <span class="Other">=</span> <span class="StringLit">&quot;Warning&quot;</span><span class="Other">,</span> <span class="Identifier">mcError</span> <span class="Other">=</span> <span class="StringLit">&quot;Error&quot;</span></pre></dt>
  249. <dd>
  250. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L53" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  251. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L53" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  252. </dd>
  253. </div>
  254. <div id="MsgHandler">
  255. <dt><pre><a href="rst.html#MsgHandler"><span class="Identifier">MsgHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">line</span><span class="Other">,</span> <span class="Identifier">col</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">;</span> <span class="Identifier">msgKind</span><span class="Other">:</span> <a href="rst.html#MsgKind"><span class="Identifier">MsgKind</span></a><span class="Other">;</span>
  256. <span class="Identifier">arg</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span class="Identifier">closure</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span></span>.}</pre></dt>
  257. <dd>
  258. what to do in case of an error
  259. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L81" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  260. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L81" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  261. </dd>
  262. </div>
  263. <div id="MsgKind">
  264. <dt><pre><a href="rst.html#MsgKind"><span class="Identifier">MsgKind</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  265. <span class="Identifier">meCannotOpenFile</span> <span class="Other">=</span> <span class="StringLit">&quot;cannot open \'$1\'&quot;</span><span class="Other">,</span> <span class="Identifier">meExpected</span> <span class="Other">=</span> <span class="StringLit">&quot;\'$1\' expected&quot;</span><span class="Other">,</span>
  266. <span class="Identifier">meMissingClosing</span> <span class="Other">=</span> <span class="StringLit">&quot;$1&quot;</span><span class="Other">,</span>
  267. <span class="Identifier">meGridTableNotImplemented</span> <span class="Other">=</span> <span class="StringLit">&quot;grid table is not implemented&quot;</span><span class="Other">,</span>
  268. <span class="Identifier">meMarkdownIllformedTable</span> <span class="Other">=</span> <span class="StringLit">&quot;illformed delimiter row of a Markdown table&quot;</span><span class="Other">,</span>
  269. <span class="Identifier">meIllformedTable</span> <span class="Other">=</span> <span class="StringLit">&quot;Illformed table: $1&quot;</span><span class="Other">,</span>
  270. <span class="Identifier">meNewSectionExpected</span> <span class="Other">=</span> <span class="StringLit">&quot;new section expected $1&quot;</span><span class="Other">,</span>
  271. <span class="Identifier">meGeneralParseError</span> <span class="Other">=</span> <span class="StringLit">&quot;general parse error&quot;</span><span class="Other">,</span>
  272. <span class="Identifier">meInvalidDirective</span> <span class="Other">=</span> <span class="StringLit">&quot;invalid directive: \'$1\'&quot;</span><span class="Other">,</span>
  273. <span class="Identifier">meInvalidField</span> <span class="Other">=</span> <span class="StringLit">&quot;invalid field: $1&quot;</span><span class="Other">,</span>
  274. <span class="Identifier">meFootnoteMismatch</span> <span class="Other">=</span> <span class="StringLit">&quot;mismatch in number of footnotes and their refs: $1&quot;</span><span class="Other">,</span>
  275. <span class="Identifier">mwRedefinitionOfLabel</span> <span class="Other">=</span> <span class="StringLit">&quot;redefinition of label \'$1\'&quot;</span><span class="Other">,</span>
  276. <span class="Identifier">mwUnknownSubstitution</span> <span class="Other">=</span> <span class="StringLit">&quot;unknown substitution \'$1\'&quot;</span><span class="Other">,</span>
  277. <span class="Identifier">mwAmbiguousLink</span> <span class="Other">=</span> <span class="StringLit">&quot;ambiguous doc link $1&quot;</span><span class="Other">,</span>
  278. <span class="Identifier">mwBrokenLink</span> <span class="Other">=</span> <span class="StringLit">&quot;broken link \'$1\'&quot;</span><span class="Other">,</span>
  279. <span class="Identifier">mwUnsupportedLanguage</span> <span class="Other">=</span> <span class="StringLit">&quot;language \'$1\' not supported&quot;</span><span class="Other">,</span>
  280. <span class="Identifier">mwUnsupportedField</span> <span class="Other">=</span> <span class="StringLit">&quot;field \'$1\' not supported&quot;</span><span class="Other">,</span>
  281. <span class="Identifier">mwRstStyle</span> <span class="Other">=</span> <span class="StringLit">&quot;RST style: $1&quot;</span><span class="Other">,</span>
  282. <span class="Identifier">mwUnusedImportdoc</span> <span class="Other">=</span> <span class="StringLit">&quot;importdoc for \'$1\' is not used&quot;</span><span class="Other">,</span>
  283. <span class="Identifier">meSandboxedDirective</span> <span class="Other">=</span> <span class="StringLit">&quot;disabled directive: \'$1\'&quot;</span></pre></dt>
  284. <dd>
  285. the possible messages
  286. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L59" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  287. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L59" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  288. </dd>
  289. </div>
  290. <div id="PRstSharedState">
  291. <dt><pre><a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Identifier">RstSharedState</span></pre></dt>
  292. <dd>
  293. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L428" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  294. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L428" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  295. </dd>
  296. </div>
  297. <div id="RstFileTable">
  298. <dt><pre><a href="rst.html#RstFileTable"><span class="Identifier">RstFileTable</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
  299. <span class="Identifier">filenameToIdx</span><span class="Operator">*</span><span class="Other">:</span> <a href="tables.html#Table"><span class="Identifier">Table</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">,</span> <a href="rstast.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">]</span>
  300. <span class="Identifier">idxToFilename</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span></pre></dt>
  301. <dd>
  302. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L386" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  303. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L386" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  304. </dd>
  305. </div>
  306. <div id="RstParseOption">
  307. <dt><pre><a href="rst.html#RstParseOption"><span class="Identifier">RstParseOption</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  308. <span class="Identifier">roSupportSmilies</span><span class="Other">,</span> <span class="Comment">## make the RST parser support smilies like ``:)``</span>
  309. <span class="Identifier">roSupportRawDirective</span><span class="Other">,</span> <span class="Comment">## support the ``raw`` directive (don't support</span>
  310. <span class="Comment">## it for sandboxing)</span>
  311. <span class="Identifier">roSupportMarkdown</span><span class="Other">,</span> <span class="Comment">## support additional features of Markdown</span>
  312. <span class="Identifier">roPreferMarkdown</span><span class="Other">,</span> <span class="Comment">## parse as Markdown (keeping RST as &quot;extension&quot;</span>
  313. <span class="Comment">## to Markdown) -- implies `roSupportMarkdown`</span>
  314. <span class="Identifier">roNimFile</span><span class="Other">,</span> <span class="Comment">## set for Nim files where default interpreted</span>
  315. <span class="Comment">## text role should be :nim:</span>
  316. <span class="Identifier">roSandboxDisabled</span> <span class="Comment">## this option enables certain options</span>
  317. <span class="Comment">## (e.g. raw, include, importdoc)</span>
  318. <span class="Comment">## which are disabled by default as they can</span>
  319. <span class="Comment">## enable users to read arbitrary data and</span>
  320. <span class="Comment">## perform XSS if the parser is used in a web</span>
  321. <span class="Comment">## app.</span></pre></dt>
  322. <dd>
  323. options for the RST parser
  324. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L35" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  325. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L35" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  326. </dd>
  327. </div>
  328. <div id="RstParseOptions">
  329. <dt><pre><a href="rst.html#RstParseOptions"><span class="Identifier">RstParseOptions</span></a> <span class="Other">=</span> <a href="system.html#set"><span class="Identifier">set</span></a><span class="Other">[</span><a href="rst.html#RstParseOption"><span class="Identifier">RstParseOption</span></a><span class="Other">]</span></pre></dt>
  330. <dd>
  331. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L51" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  332. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L51" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  333. </dd>
  334. </div>
  335. </dl>
  336. </div>
  337. <div class="section" id="10">
  338. <h1><a class="toc-backref" href="#10">Consts</a></h1>
  339. <dl class="item">
  340. <div id="ColRstInit">
  341. <dt><pre><a href="rst.html#ColRstInit"><span class="Identifier">ColRstInit</span></a> <span class="Other">=</span> <span class="DecNumber">0</span></pre></dt>
  342. <dd>
  343. Initial column number for standalone RST text (Nim global reporting adds ColOffset=1)
  344. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L451" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  345. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L451" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  346. </dd>
  347. </div>
  348. <div id="ColRstOffset">
  349. <dt><pre><a href="rst.html#ColRstOffset"><span class="Identifier">ColRstOffset</span></a> <span class="Other">=</span> <span class="DecNumber">1</span></pre></dt>
  350. <dd>
  351. 1: a replica of ColOffset for internal use
  352. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L453" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  353. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L453" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  354. </dd>
  355. </div>
  356. <div id="LineRstInit">
  357. <dt><pre><a href="rst.html#LineRstInit"><span class="Identifier">LineRstInit</span></a> <span class="Other">=</span> <span class="DecNumber">1</span></pre></dt>
  358. <dd>
  359. Initial line number for standalone RST text
  360. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L450" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  361. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L450" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  362. </dd>
  363. </div>
  364. </dl>
  365. </div>
  366. <div class="section" id="12">
  367. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  368. <dl class="item">
  369. <div id="addAnchorNim-procs-all">
  370. <div id="addAnchorNim,PRstSharedState,bool,string,string,LangSymbol,int,TLineInfo,FileIndex">
  371. <dt><pre><span class="Keyword">proc</span> <a href="#addAnchorNim%2CPRstSharedState%2Cbool%2Cstring%2Cstring%2CLangSymbol%2Cint%2CTLineInfo%2CFileIndex"><span class="Identifier">addAnchorNim</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a><span class="Other">;</span> <span class="Identifier">external</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a><span class="Other">;</span> <span class="Identifier">refn</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span>
  372. <span class="Identifier">tooltip</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">langSym</span><span class="Other">:</span> <a href="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</span></a><span class="Other">;</span> <span class="Identifier">priority</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">;</span>
  373. <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">module</span><span class="Other">:</span> <a href="rstast.html#FileIndex"><span class="Identifier">FileIndex</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>
  374. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  375. <dd>
  376. Adds an anchor <tt class="docutils literal"><span class="pre"><span class="Identifier">refn</span></span></tt>, which follows the rule <tt class="docutils literal"><span class="pre"><span class="Identifier">arNim</span></span></tt> (i.e. a symbol in <tt class="docutils literal"><span class="pre">*.nim</span></tt> file)
  377. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L863" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  378. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L863" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  379. </dd>
  380. </div>
  381. </div>
  382. <div id="addFilename-procs-all">
  383. <div id="addFilename,PRstSharedState,string">
  384. <dt><pre><span class="Keyword">proc</span> <a href="#addFilename%2CPRstSharedState%2Cstring"><span class="Identifier">addFilename</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a><span class="Other">;</span> <span class="Identifier">file1</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#FileIndex"><span class="Identifier">FileIndex</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>
  385. <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>
  386. <dd>
  387. Returns index of filename, adding it if it has not been used before
  388. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L507" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  389. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L507" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  390. </dd>
  391. </div>
  392. </div>
  393. <div id="addNodes-procs-all">
  394. <div id="addNodes,PRstNode">
  395. <dt><pre><span class="Keyword">proc</span> <a href="#addNodes%2CPRstNode"><span class="Identifier">addNodes</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#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>
  396. <dd>
  397. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L91" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  398. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L91" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  399. </dd>
  400. </div>
  401. </div>
  402. <div id="completePass2-procs-all">
  403. <div id="completePass2,PRstSharedState">
  404. <dt><pre><span class="Keyword">proc</span> <a href="#completePass2%2CPRstSharedState"><span class="Identifier">completePass2</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</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">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
  405. <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>
  406. <dd>
  407. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L3862" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  408. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L3862" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  409. </dd>
  410. </div>
  411. </div>
  412. <div id="defaultFindFile-procs-all">
  413. <div id="defaultFindFile,string">
  414. <dt><pre><span class="Keyword">proc</span> <a href="#defaultFindFile%2Cstring"><span class="Identifier">defaultFindFile</span></a><span class="Other">(</span><span class="Identifier">filename</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="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>
  415. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadDirEffect</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>
  416. <dd>
  417. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L477" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  418. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L477" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  419. </dd>
  420. </div>
  421. </div>
  422. <div id="defaultFindRefFile-procs-all">
  423. <div id="defaultFindRefFile,string">
  424. <dt><pre><span class="Keyword">proc</span> <a href="#defaultFindRefFile%2Cstring"><span class="Identifier">defaultFindRefFile</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Other">(</span><a href="system.html#string"><span class="Identifier">string</span></a><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>
  425. <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>
  426. <dd>
  427. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L481" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  428. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L481" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  429. </dd>
  430. </div>
  431. </div>
  432. <div id="defaultMsgHandler-procs-all">
  433. <div id="defaultMsgHandler,string,int,int,MsgKind,string">
  434. <dt><pre><span class="Keyword">proc</span> <a href="#defaultMsgHandler%2Cstring%2Cint%2Cint%2CMsgKind%2Cstring"><span class="Identifier">defaultMsgHandler</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">line</span><span class="Other">,</span> <span class="Identifier">col</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">;</span> <span class="Identifier">msgkind</span><span class="Other">:</span> <a href="rst.html#MsgKind"><span class="Identifier">MsgKind</span></a><span class="Other">;</span>
  435. <span class="Identifier">arg</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="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">EParseError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
  436. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</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>
  437. <dd>
  438. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L467" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  439. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L467" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  440. </dd>
  441. </div>
  442. </div>
  443. <div id="getArgument-procs-all">
  444. <div id="getArgument,PRstNode">
  445. <dt><pre><span class="Keyword">proc</span> <a href="#getArgument%2CPRstNode"><span class="Identifier">getArgument</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#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>
  446. <dd>
  447. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L93" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  448. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L93" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  449. </dd>
  450. </div>
  451. </div>
  452. <div id="getFieldValue-procs-all">
  453. <div id="getFieldValue,PRstNode">
  454. <dt><pre><span class="Keyword">proc</span> <a href="#getFieldValue%2CPRstNode"><span class="Identifier">getFieldValue</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#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>
  455. <dd>
  456. <p>Returns the value of a specific <tt class="docutils literal"><span class="pre">rnField</span></tt> node.</p>
  457. <p>This proc will assert if the node is not of the expected type. The empty string will be returned as a minimum. Any value in the rst will be stripped form leading/trailing whitespace.</p>
  458. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L2076" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  459. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L2076" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  460. </dd>
  461. </div>
  462. <div id="getFieldValue,PRstNode,string">
  463. <dt><pre><span class="Keyword">proc</span> <a href="#getFieldValue%2CPRstNode%2Cstring"><span class="Identifier">getFieldValue</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">fieldname</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="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  464. <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>
  465. <dd>
  466. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L92" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  467. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L92" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  468. </dd>
  469. </div>
  470. </div>
  471. <div id="newRstSharedState-procs-all">
  472. <div id="newRstSharedState,RstParseOptions,string,FindFileHandler,FindRefFileHandler,MsgHandler,bool">
  473. <dt><pre><span class="Keyword">proc</span> <a href="#newRstSharedState%2CRstParseOptions%2Cstring%2CFindFileHandler%2CFindRefFileHandler%2CMsgHandler%2Cbool"><span class="Identifier">newRstSharedState</span></a><span class="Other">(</span><span class="Identifier">options</span><span class="Other">:</span> <a href="rst.html#RstParseOptions"><span class="Identifier">RstParseOptions</span></a><span class="Other">;</span> <span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span>
  474. <span class="Identifier">findFile</span><span class="Other">:</span> <a href="rst.html#FindFileHandler"><span class="Identifier">FindFileHandler</span></a><span class="Other">;</span>
  475. <span class="Identifier">findRefFile</span><span class="Other">:</span> <a href="rst.html#FindRefFileHandler"><span class="Identifier">FindRefFileHandler</span></a><span class="Other">;</span> <span class="Identifier">msgHandler</span><span class="Other">:</span> <a href="rst.html#MsgHandler"><span class="Identifier">MsgHandler</span></a><span class="Other">;</span>
  476. <span class="Identifier">hasToc</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</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>
  477. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  478. <dd>
  479. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L533" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  480. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L533" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  481. </dd>
  482. </div>
  483. </div>
  484. <div id="preparePass2-procs-all">
  485. <div id="preparePass2,PRstSharedState,PRstNode">
  486. <dt><pre><span class="Keyword">proc</span> <a href="#preparePass2%2CPRstSharedState%2CPRstNode"><span class="Identifier">preparePass2</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a><span class="Other">;</span> <span class="Identifier">mainNode</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a><span class="Other">;</span> <span class="Identifier">importdoc</span> <span class="Other">=</span> <span class="Identifier">true</span><span class="Other">)</span> {.
  487. <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="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
  488. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  489. <dd>
  490. Records titles in node <tt class="docutils literal"><span class="pre"><span class="Identifier">mainNode</span></span></tt> and orders footnotes.
  491. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L3648" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  492. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L3648" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  493. </dd>
  494. </div>
  495. </div>
  496. <div id="resolveSubs-procs-all">
  497. <div id="resolveSubs,PRstSharedState,PRstNode">
  498. <dt><pre><span class="Keyword">proc</span> <a href="#resolveSubs%2CPRstSharedState%2CPRstNode"><span class="Identifier">resolveSubs</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</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> {.
  499. <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">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span>
  500. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</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>
  501. <dd>
  502. Makes pass 2 of RST parsing. Resolves substitutions and anchor aliases, groups footnotes. Takes input node <tt class="docutils literal"><span class="pre"><span class="Identifier">n</span></span></tt> and returns the same node with recursive substitutions in <tt class="docutils literal"><span class="pre"><span class="Identifier">n</span><span class="Operator">.</span><span class="Identifier">sons</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">result</span></span></tt>.
  503. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L3767" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  504. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L3767" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  505. </dd>
  506. </div>
  507. </div>
  508. <div id="rstMessage-procs-all">
  509. <div id="rstMessage,RstFileTable,MsgHandler,TLineInfo,MsgKind,string">
  510. <dt><pre><span class="Keyword">proc</span> <a href="#rstMessage%2CRstFileTable%2CMsgHandler%2CTLineInfo%2CMsgKind%2Cstring"><span class="Identifier">rstMessage</span></a><span class="Other">(</span><span class="Identifier">filenames</span><span class="Other">:</span> <a href="rst.html#RstFileTable"><span class="Identifier">RstFileTable</span></a><span class="Other">;</span> <span class="Identifier">f</span><span class="Other">:</span> <a href="rst.html#MsgHandler"><span class="Identifier">MsgHandler</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>
  511. <span class="Identifier">msgKind</span><span class="Other">:</span> <a href="rst.html#MsgKind"><span class="Identifier">MsgKind</span></a><span class="Other">;</span> <span class="Identifier">arg</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.
  512. <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">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <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>
  513. <dd>
  514. Print warnings using <tt class="docutils literal"><span class="pre"><span class="Identifier">info</span></span></tt>, i.e. in 2nd-pass warnings for footnotes/substitutions/references or from <tt class="docutils literal"><span class="pre">rstgen.nim</span></tt>.
  515. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L575" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  516. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L575" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  517. </dd>
  518. </div>
  519. </div>
  520. <div id="rstnodeToRefname-procs-all">
  521. <div id="rstnodeToRefname,PRstNode">
  522. <dt><pre><span class="Keyword">proc</span> <a href="#rstnodeToRefname%2CPRstNode"><span class="Identifier">rstnodeToRefname</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#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>
  523. <dd>
  524. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L90" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  525. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L90" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  526. </dd>
  527. </div>
  528. </div>
  529. <div id="rstParse-procs-all">
  530. <div id="rstParse,string,string,int,int,RstParseOptions,FindFileHandler,FindRefFileHandler,MsgHandler">
  531. <dt><pre><span class="Keyword">proc</span> <a href="#rstParse%2Cstring%2Cstring%2Cint%2Cint%2CRstParseOptions%2CFindFileHandler%2CFindRefFileHandler%2CMsgHandler"><span class="Identifier">rstParse</span></a><span class="Other">(</span><span class="Identifier">text</span><span class="Other">,</span> <span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">line</span><span class="Other">,</span> <span class="Identifier">column</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">;</span>
  532. <span class="Identifier">options</span><span class="Other">:</span> <a href="rst.html#RstParseOptions"><span class="Identifier">RstParseOptions</span></a><span class="Other">;</span> <span class="Identifier">findFile</span><span class="Other">:</span> <a href="rst.html#FindFileHandler"><span class="Identifier">FindFileHandler</span></a> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">;</span>
  533. <span class="Identifier">findRefFile</span><span class="Other">:</span> <a href="rst.html#FindRefFileHandler"><span class="Identifier">FindRefFileHandler</span></a> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">;</span>
  534. <span class="Identifier">msgHandler</span><span class="Other">:</span> <a href="rst.html#MsgHandler"><span class="Identifier">MsgHandler</span></a> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">tuple</span><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>
  535. <span class="Identifier">filenames</span><span class="Other">:</span> <a href="rst.html#RstFileTable"><span class="Identifier">RstFileTable</span></a><span class="Other">,</span> <span class="Identifier">hasToc</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a><span class="Other">]</span> {.
  536. <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="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span>
  537. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</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>
  538. <dd>
  539. Parses the whole <tt class="docutils literal"><span class="pre"><span class="Identifier">text</span></span></tt>. The result is ready for <tt class="docutils literal"><span class="pre"><span class="Identifier">rstgen</span><span class="Operator">.</span><span class="Identifier">renderRstToOut</span></span></tt>, note that 2nd tuple element should be fed to <tt class="docutils literal"><span class="pre"><span class="Identifier">initRstGenerator</span></span></tt> argument <tt class="docutils literal"><span class="pre"><span class="Identifier">filenames</span></span></tt> (it is being filled here at least with <tt class="docutils literal"><span class="pre"><span class="Identifier">filename</span></span></tt> and possibly with other files from RST <tt class="docutils literal"><span class="pre">.. include::</span></tt> statement).
  540. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L3868" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  541. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L3868" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  542. </dd>
  543. </div>
  544. </div>
  545. <div id="rstParsePass1-procs-all">
  546. <div id="rstParsePass1,string,int,int,PRstSharedState">
  547. <dt><pre><span class="Keyword">proc</span> <a href="#rstParsePass1%2Cstring%2Cint%2Cint%2CPRstSharedState"><span class="Identifier">rstParsePass1</span></a><span class="Other">(</span><span class="Identifier">fragment</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">line</span><span class="Other">,</span> <span class="Identifier">column</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">;</span>
  548. <span class="Identifier">sharedState</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rstast.html#PRstNode"><span class="Identifier">PRstNode</span></a> {.
  549. <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="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span> <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>
  550. <dd>
  551. Parses an RST <tt class="docutils literal"><span class="pre"><span class="Identifier">fragment</span></span></tt>. The result should be further processed by <a class="reference internal nimdoc" title="proc preparePass2(s: var PRstSharedState; mainNode: PRstNode; importdoc = true)" href="#preparePass2,PRstSharedState,PRstNode">preparePass2</a> and <a class="reference internal nimdoc" title="proc resolveSubs(s: PRstSharedState; n: PRstNode): PRstNode" href="#resolveSubs,PRstSharedState,PRstNode">resolveSubs</a> (which is pass 2).
  552. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L3559" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  553. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L3559" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  554. </dd>
  555. </div>
  556. </div>
  557. <div id="safeProtocol-procs-all">
  558. <div id="safeProtocol,string">
  559. <dt><pre><span class="Keyword">proc</span> <a href="#safeProtocol%2Cstring"><span class="Identifier">safeProtocol</span></a><span class="Other">(</span><span class="Identifier">linkStr</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 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>
  560. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  561. <dd>
  562. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L1254" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  563. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L1254" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  564. </dd>
  565. </div>
  566. </div>
  567. <div id="setCurrFilename-procs-all">
  568. <div id="setCurrFilename,PRstSharedState,string">
  569. <dt><pre><span class="Keyword">proc</span> <a href="#setCurrFilename%2CPRstSharedState%2Cstring"><span class="Identifier">setCurrFilename</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="rst.html#PRstSharedState"><span class="Identifier">PRstSharedState</span></a><span class="Other">;</span> <span class="Identifier">file1</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>
  570. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  571. <dd>
  572. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L515" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  573. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L515" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  574. </dd>
  575. </div>
  576. </div>
  577. <div id="whichMsgClass-procs-all">
  578. <div id="whichMsgClass,MsgKind">
  579. <dt><pre><span class="Keyword">proc</span> <a href="#whichMsgClass%2CMsgKind"><span class="Identifier">whichMsgClass</span></a><span class="Other">(</span><span class="Identifier">k</span><span class="Other">:</span> <a href="rst.html#MsgKind"><span class="Identifier">MsgKind</span></a><span class="Other">)</span><span class="Other">:</span> <a href="rst.html#MsgClass"><span class="Identifier">MsgClass</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>
  580. <dd>
  581. returns which message class <tt class="docutils literal"><span class="pre"><span class="Identifier">k</span></span></tt> belongs to.
  582. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/rst.nim#L459" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  583. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L459" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  584. </dd>
  585. </div>
  586. </div>
  587. </dl>
  588. </div>
  589. </div>
  590. </div>
  591. <div class="twelve-columns footer">
  592. <span class="nim-sprite"></span>
  593. <br>
  594. <small style="color: var(--hint);">Made with Nim. Generated: 2024-12-25 13:27:41 UTC</small>
  595. </div>
  596. </div>
  597. </div>
  598. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  599. </body>
  600. </html>