Skip to content

Commit 1e320bc

Browse files
authored
[docs minor]space for code-block (#16266)
* [docs minor]space for code-block * correct more errors * to runnableExamples * add newline
1 parent 48d7c40 commit 1e320bc

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

compiler/astalgo.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ proc getNamedParamFromList*(list: PNode, ident: PIdent): PSym =
222222
## gensym'ed and then they have '\`<number>' suffix that we need to
223223
## ignore, see compiler / evaltempl.nim, snippet:
224224
##
225-
##..code-block:: nim
225+
## .. code-block:: nim
226226
##
227-
## result.add newIdentNode(getIdent(c.ic, x.name.s & "\`gensym" & $x.id),
227+
## result.add newIdentNode(getIdent(c.ic, x.name.s & "\`gensym" & $x.id),
228228
## if c.instLines: actual.info else: templ.info)
229229
for i in 1..<list.len:
230230
let it = list[i].sym

compiler/sigmatch.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,11 @@ proc inconsistentVarTypes(f, a: PType): bool {.inline.} =
568568

569569
proc procParamTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
570570
## For example we have:
571-
##..code-block:: nim
571+
##
572+
## .. code-block:: nim
572573
## proc myMap[T,S](sIn: seq[T], f: proc(x: T): S): seq[S] = ...
573574
## proc innerProc[Q,W](q: Q): W = ...
575+
##
574576
## And we want to match: myMap(@[1,2,3], innerProc)
575577
## This proc (procParamTypeRel) will do the following steps in
576578
## three different calls:

compiler/vmgen.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# types that use the 'node' field; the reason is that slots are
1717
# re-used in a register based VM. Example:
1818
#
19-
#..code-block:: nim
19+
#.. code-block:: nim
2020
# let s = a & b # no matter what, create fresh node
2121
# s = a & b # no matter what, keep the node
2222
#

lib/pure/unidecode/unidecode.nim

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,9 @@ proc loadUnidecodeTable*(datafile = "unidecode.dat") =
5252
proc unidecode*(s: string): string =
5353
## Finds the sequence of ASCII characters that is the closest approximation
5454
## to the UTF-8 string `s`.
55-
##
56-
## Example:
57-
##
58-
## ..code-block:: nim
59-
##
60-
## unidecode("北京")
61-
##
62-
## Results in: "Bei Jing"
63-
##
55+
runnableExamples:
56+
assert unidecode("北京") == "Bei Jing "
57+
6458
result = ""
6559
for r in runes(s):
6660
var c = int(r)

0 commit comments

Comments
 (0)