parent
e013ebc91a
commit
579456d520
5 changed files with 44 additions and 3 deletions
|
|
@ -66,10 +66,9 @@ proc renderNimCode*(result: var string, code: string, isLatex = false) =
|
||||||
buf.addEscaped(val)
|
buf.addEscaped(val)
|
||||||
let class = tokenClassToStr[kind]
|
let class = tokenClassToStr[kind]
|
||||||
if isLatex:
|
if isLatex:
|
||||||
result.addf "\\span$1{$2}" % [class, buf]
|
result.addf "\\span$1{$2}", [class, buf]
|
||||||
else:
|
else:
|
||||||
result.addf "<span class=\"$1\">$2</span>" % [class, buf]
|
result.addf "<span class=\"$1\">$2</span>", [class, buf]
|
||||||
|
|
||||||
while true:
|
while true:
|
||||||
getNextToken(toknizr, langNim)
|
getNextToken(toknizr, langNim)
|
||||||
case toknizr.kind
|
case toknizr.kind
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,8 @@ function main() {
|
||||||
title="z17()"><wbr />z17<span class="attachedType"></span></a></li>
|
title="z17()"><wbr />z17<span class="attachedType"></span></a></li>
|
||||||
<li><a class="reference" href="#p1"
|
<li><a class="reference" href="#p1"
|
||||||
title="p1()"><wbr />p1<span class="attachedType"></span></a></li>
|
title="p1()"><wbr />p1<span class="attachedType"></span></a></li>
|
||||||
|
<li><a class="reference" href="#addfBug14485"
|
||||||
|
title="addfBug14485()"><wbr />addf<wbr />Bug14485<span class="attachedType"></span></a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -525,6 +527,25 @@ this is a nested doc comment
|
||||||
</span><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">"c9"</span><span class="Whitespace">
|
</span><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">"c9"</span><span class="Whitespace">
|
||||||
</span><span class="Comment"># also work after</span></pre>
|
</span><span class="Comment"># also work after</span></pre>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<a id="addfBug14485"></a>
|
||||||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addfBug14485"><span class="Identifier">addfBug14485</span></a><span class="Other">(</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><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><span class="Other">.}</span></span></pre></dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
Some proc
|
||||||
|
<p><strong class="examples_text">Example:</strong></p>
|
||||||
|
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">"foo() = "</span><span class="Whitespace"> </span><span class="Operator">&</span><span class="Whitespace"> </span><span class="Operator">$</span><span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">]</span><span class="Whitespace">
|
||||||
|
</span><span class="LongComment">#[
|
||||||
|
0: let's also add some broken html to make sure this won't break in future
|
||||||
|
1: </span>
|
||||||
|
2: </span>
|
||||||
|
3: </span
|
||||||
|
4: </script>
|
||||||
|
5: </script
|
||||||
|
6: </script
|
||||||
|
7: end of broken html
|
||||||
|
]#</span></pre>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl></div>
|
</dl></div>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ z13 testproject.html#z13 testproject: z13()
|
||||||
baz testproject.html#baz testproject: baz()
|
baz testproject.html#baz testproject: baz()
|
||||||
z17 testproject.html#z17 testproject: z17()
|
z17 testproject.html#z17 testproject: z17()
|
||||||
p1 testproject.html#p1 testproject: p1()
|
p1 testproject.html#p1 testproject: p1()
|
||||||
|
addfBug14485 testproject.html#addfBug14485 testproject: addfBug14485()
|
||||||
bar testproject.html#bar.m testproject: bar(): untyped
|
bar testproject.html#bar.m testproject: bar(): untyped
|
||||||
z16 testproject.html#z16.m testproject: z16()
|
z16 testproject.html#z16.m testproject: z16()
|
||||||
z18 testproject.html#z18.m testproject: z18(): int
|
z18 testproject.html#z18.m testproject: z18(): int
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@ function main() {
|
||||||
<li><a class="reference external"
|
<li><a class="reference external"
|
||||||
data-doc-search-tag="testproject: A" href="testproject.html#A">testproject: A</a></li>
|
data-doc-search-tag="testproject: A" href="testproject.html#A">testproject: A</a></li>
|
||||||
</ul></dd>
|
</ul></dd>
|
||||||
|
<dt><a name="addfBug14485" href="#addfBug14485"><span>addfBug14485:</span></a></dt><dd><ul class="simple">
|
||||||
|
<li><a class="reference external"
|
||||||
|
data-doc-search-tag="testproject: addfBug14485()" href="testproject.html#addfBug14485">testproject: addfBug14485()</a></li>
|
||||||
|
</ul></dd>
|
||||||
<dt><a name="aEnum" href="#aEnum"><span>aEnum:</span></a></dt><dd><ul class="simple">
|
<dt><a name="aEnum" href="#aEnum"><span>aEnum:</span></a></dt><dd><ul class="simple">
|
||||||
<li><a class="reference external"
|
<li><a class="reference external"
|
||||||
data-doc-search-tag="utils: aEnum(): untyped" href="subdir/subdir_b/utils.html#aEnum.t">utils: aEnum(): untyped</a></li>
|
data-doc-search-tag="utils: aEnum(): untyped" href="subdir/subdir_b/utils.html#aEnum.t">utils: aEnum(): untyped</a></li>
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,22 @@ when true: # capture non-doc comments correctly even before 1st token
|
||||||
# also work after
|
# also work after
|
||||||
# this should be out
|
# this should be out
|
||||||
|
|
||||||
|
when true: # issue #14485
|
||||||
|
proc addfBug14485*() =
|
||||||
|
## Some proc
|
||||||
|
runnableExamples:
|
||||||
|
discard "foo() = " & $[1]
|
||||||
|
#[
|
||||||
|
0: let's also add some broken html to make sure this won't break in future
|
||||||
|
1: </span>
|
||||||
|
2: </span>
|
||||||
|
3: </span
|
||||||
|
4: </script>
|
||||||
|
5: </script
|
||||||
|
6: </script
|
||||||
|
7: end of broken html
|
||||||
|
]#
|
||||||
|
|
||||||
when true: # (most) macros
|
when true: # (most) macros
|
||||||
macro bar*(): untyped =
|
macro bar*(): untyped =
|
||||||
result = newStmtList()
|
result = newStmtList()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue