summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-06 16:54:32 +0800
committerGitHub <noreply@github.com>2020-12-06 09:54:32 +0100
commit1e320bc8c5112b152ebc3092331b8b1fe0ae5191 (patch)
tree9bc4b4d4732101cc03df813b96626718a5016cb4
parent48d7c40553f0769c22b4b47f8079dd96c3e23323 (diff)
downloadNim-1e320bc8c5112b152ebc3092331b8b1fe0ae5191.tar.gz
[docs minor]space for code-block (#16266)
* [docs minor]space for code-block

* correct more errors

* to runnableExamples

* add newline
-rw-r--r--compiler/astalgo.nim4
-rw-r--r--compiler/sigmatch.nim4
-rw-r--r--compiler/vmgen.nim2
-rw-r--r--lib/pure/unidecode/unidecode.nim12
4 files changed, 9 insertions, 13 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim
index 832f8819a..300089d81 100644
--- a/compiler/astalgo.nim
+++ b/compiler/astalgo.nim
@@ -222,9 +222,9 @@ proc getNamedParamFromList*(list: PNode, ident: PIdent): PSym =
   ## gensym'ed and then they have '\`<number>' suffix that we need to
   ## ignore, see compiler / evaltempl.nim, snippet:
   ##
-  ##..code-block:: nim
+  ## .. code-block:: nim
   ##
-  ##    result.add newIdentNode(getIdent(c.ic, x.name.s & "\`gensym" & $x.id),
+  ##   result.add newIdentNode(getIdent(c.ic, x.name.s & "\`gensym" & $x.id),
   ##            if c.instLines: actual.info else: templ.info)
   for i in 1..<list.len:
     let it = list[i].sym
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index b674c3d9e..94f290b99 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -568,9 +568,11 @@ proc inconsistentVarTypes(f, a: PType): bool {.inline.} =
 
 proc procParamTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
   ## For example we have:
-  ##..code-block:: nim
+  ## 
+  ## .. code-block:: nim
   ##   proc myMap[T,S](sIn: seq[T], f: proc(x: T): S): seq[S] = ...
   ##   proc innerProc[Q,W](q: Q): W = ...
+  ##
   ## And we want to match: myMap(@[1,2,3], innerProc)
   ## This proc (procParamTypeRel) will do the following steps in
   ## three different calls:
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index 29ab8739d..9086b17d9 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -16,7 +16,7 @@
 #   types that use the 'node' field; the reason is that slots are
 #   re-used in a register based VM. Example:
 #
-#..code-block:: nim
+#.. code-block:: nim
 #   let s = a & b  # no matter what, create fresh node
 #   s = a & b  # no matter what, keep the node
 #
diff --git a/lib/pure/unidecode/unidecode.nim b/lib/pure/unidecode/unidecode.nim
index 9a10ccc00..166608aeb 100644
--- a/lib/pure/unidecode/unidecode.nim
+++ b/lib/pure/unidecode/unidecode.nim
@@ -52,15 +52,9 @@ proc loadUnidecodeTable*(datafile = "unidecode.dat") =
 proc unidecode*(s: string): string =
   ## Finds the sequence of ASCII characters that is the closest approximation
   ## to the UTF-8 string `s`.
-  ##
-  ## Example:
-  ##
-  ## ..code-block:: nim
-  ##
-  ##   unidecode("北京")
-  ##
-  ## Results in: "Bei Jing"
-  ##
+  runnableExamples:
+    assert unidecode("北京") == "Bei Jing "
+
   result = ""
   for r in runes(s):
     var c = int(r)