Files
Nim/dochelpers.html
github-actions[bot] de413ab6bb Deploy to GitHub pages
2025-12-25 20:14:24 +00:00

253 lines
23 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>packages/docutils/dochelpers</title>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- Favicon -->
<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=="/>
<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=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
<!-- JS -->
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">packages/docutils/dochelpers</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme:&nbsp;</label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple-boot">
<li><a href="manual.html">Manual</a></li>
<li><a href="lib.html">Standard library</a></li>
<li> <a id="indexLink" href="theindex.html">Index</a></li>
<li><a href="compiler/theindex.html">Compiler docs</a></li>
<li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
<li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput"
oninput="search()" />
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#LangSymbol" title="LangSymbol = object
symKind*: string ## &quot;proc&quot;, &quot;const&quot;, &quot;type&quot;, etc
symTypeKind*: string ## &quot;&quot;|enum|object|tuple -
## valid only when `symKind == &quot;type&quot;`
name*: string ## plain symbol name without any parameters
generics*: string ## generic parameters (without brackets)
isGroup*: bool ## is LangSymbol a group with overloads?
parametersProvided*: bool ## to disambiguate `proc f`_ and `proc f()`_
parameters*: seq[tuple[name: string, `type`: string]] ## name-type seq, e.g. for proc
outType*: string ## result type, e.g. for proc">LangSymbol</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">$
<li><a class="reference" href="#%24%2CLangSymbol" title="`$`(s: LangSymbol): string">`$`(s: LangSymbol): string</a></li>
</ul>
<ul class="simple nested-toc-section">langSymbolGroup
<li><a class="reference" href="#langSymbolGroup%2Cstring%2Cstring" title="langSymbolGroup(kind: string; name: string): LangSymbol">langSymbolGroup(kind: string; name: string): LangSymbol</a></li>
</ul>
<ul class="simple nested-toc-section">match
<li><a class="reference" href="#match%2CLangSymbol%2CLangSymbol" title="match(generated: LangSymbol; docLink: LangSymbol): bool">match(generated: LangSymbol; docLink: LangSymbol): bool</a></li>
</ul>
<ul class="simple nested-toc-section">nimIdentBackticksNormalize
<li><a class="reference" href="#nimIdentBackticksNormalize%2Cstring" title="nimIdentBackticksNormalize(s: string): string">nimIdentBackticksNormalize(s: string): string</a></li>
</ul>
<ul class="simple nested-toc-section">toLangSymbol
<li><a class="reference" href="#toLangSymbol%2CPRstNode" title="toLangSymbol(linkText: PRstNode): LangSymbol">toLangSymbol(linkText: PRstNode): LangSymbol</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
<div id="tocRoot"></div>
<p class="module-desc"><p>Integration helpers between <tt class="docutils literal"><span class="pre">docgen.nim</span></tt> and <tt class="docutils literal"><span class="pre">rst.nim</span></tt>.</p>
<p>Function <a class="reference internal nimdoc" title="proc toLangSymbol(linkText: PRstNode): LangSymbol" href="#toLangSymbol,PRstNode">toLangSymbol(linkText)</a> produces a signature <tt class="docutils literal"><span class="pre"><span class="Identifier">docLink</span></span></tt> of <a class="reference internal nimdoc" title="object LangSymbol" href="#LangSymbol">type LangSymbol</a> in <tt class="docutils literal"><span class="pre">rst.nim</span></tt>, while <a class="reference internal nimdoc" title="proc match(generated: LangSymbol; docLink: LangSymbol): bool" href="#match,LangSymbol,LangSymbol">match(generated, docLink)</a> matches it with <tt class="docutils literal"><span class="pre"><span class="Identifier">generated</span></span></tt>, produced from <tt class="docutils literal"><span class="pre"><span class="Identifier">PNode</span></span></tt> by <tt class="docutils literal"><span class="pre">docgen.rst</span></tt>.</p>
</p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="rstast.html">rstast</a>, <a class="reference external" href="strutils.html">strutils</a>, <a class="reference external" href="assertions.html">assertions</a>, <a class="reference external" href="syncio.html">syncio</a>
</dl>
</div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="LangSymbol">
<dt><pre><a href="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">symKind</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## &quot;proc&quot;, &quot;const&quot;, &quot;type&quot;, etc</span>
<span class="Identifier">symTypeKind</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## &quot;&quot;|enum|object|tuple -</span>
<span class="Comment">## valid only when `symKind == &quot;type&quot;`</span>
<span class="Identifier">name</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## plain symbol name without any parameters</span>
<span class="Identifier">generics</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## generic parameters (without brackets)</span>
<span class="Identifier">isGroup</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> <span class="Comment">## is LangSymbol a group with overloads?</span>
<span class="Identifier">parametersProvided</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> <span class="Comment">## to disambiguate `proc f`_ and `proc f()`_</span>
<span class="Identifier">parameters</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">name</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">type</span><span class="Other">`</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="Comment">## name-type seq, e.g. for proc</span>
<span class="Identifier">outType</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Comment">## result type, e.g. for proc</span></pre></dt>
<dd>
symbol signature in Nim
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L24" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L24" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="$-procs-all">
<div id="$,LangSymbol">
<dt><pre><span class="Keyword">proc</span> <a href="#%24%2CLangSymbol"><span class="Identifier">`$`</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</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="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="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>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L39" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L39" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="langSymbolGroup-procs-all">
<div id="langSymbolGroup,string,string">
<dt><pre><span class="Keyword">proc</span> <a href="#langSymbolGroup%2Cstring%2Cstring"><span class="Identifier">langSymbolGroup</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">name</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="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</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="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="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>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L81" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L81" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="match-procs-all">
<div id="match,LangSymbol,LangSymbol">
<dt><pre><span class="Keyword">proc</span> <a href="#match%2CLangSymbol%2CLangSymbol"><span class="Identifier">match</span></a><span class="Other">(</span><span class="Identifier">generated</span><span class="Other">:</span> <a href="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</span></a><span class="Other">;</span> <span class="Identifier">docLink</span><span class="Other">:</span> <a href="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</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>
<dd>
Returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">generated</span></span></tt> can be a target for <tt class="docutils literal"><span class="pre"><span class="Identifier">docLink</span></span></tt>. If <tt class="docutils literal"><span class="pre"><span class="Identifier">generated</span></span></tt> is an overload group then only <tt class="docutils literal"><span class="pre"><span class="Identifier">symKind</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">name</span></span></tt> are compared for success.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L257" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L257" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="nimIdentBackticksNormalize-procs-all">
<div id="nimIdentBackticksNormalize,string">
<dt><pre><span class="Keyword">func</span> <a href="#nimIdentBackticksNormalize%2Cstring"><span class="Identifier">nimIdentBackticksNormalize</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="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>
<dd>
<p>Normalizes the string <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> as a Nim identifier.</p>
<p>Unlike <tt class="docutils literal"><span class="pre"><span class="Identifier">nimIdentNormalize</span></span></tt> removes spaces and backticks.</p>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
No checking (e.g. that identifiers cannot start from digits or '_', or that number of backticks is even) is performed.</div>
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Identifier">doAssert</span> <span class="Identifier">nimIdentBackticksNormalize</span><span class="Punctuation">(</span><span class="StringLit">&quot;Foo_bar&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Foobar&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">nimIdentBackticksNormalize</span><span class="Punctuation">(</span><span class="StringLit">&quot;FoO BAr&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Foobar&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">nimIdentBackticksNormalize</span><span class="Punctuation">(</span><span class="StringLit">&quot;`Foo BAR`&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Foobar&quot;</span>
<span class="Identifier">doAssert</span> <span class="Identifier">nimIdentBackticksNormalize</span><span class="Punctuation">(</span><span class="StringLit">&quot;` Foo BAR `&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Foobar&quot;</span>
<span class="Comment"># not a valid identifier:</span>
<span class="Identifier">doAssert</span> <span class="Identifier">nimIdentBackticksNormalize</span><span class="Punctuation">(</span><span class="StringLit">&quot;`_x_y`&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;_xy&quot;</span></pre>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L45" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L45" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toLangSymbol-procs-all">
<div id="toLangSymbol,PRstNode">
<dt><pre><span class="Keyword">proc</span> <a href="#toLangSymbol%2CPRstNode"><span class="Identifier">toLangSymbol</span></a><span class="Other">(</span><span class="Identifier">linkText</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="dochelpers.html#LangSymbol"><span class="Identifier">LangSymbol</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="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="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>
<dd>
<p>Parses <tt class="docutils literal"><span class="pre"><span class="Identifier">linkText</span></span></tt> into a more structured form using a state machine.</p>
<p>This proc is designed to allow link syntax with operators even without escaped backticks inside:</p>
<pre>`proc *`_
`proc []`_</pre>
<p>This proc should be kept in sync with the <tt class="docutils literal"><span class="pre"><span class="Identifier">renderTypes</span></span></tt> proc from <tt class="docutils literal"><span class="pre">compiler/typesrenderer.nim</span></tt>.</p>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/packages/docutils/dochelpers.nim#L87" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/dochelpers.nim#L87" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2025-12-25 20:14:06 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>