[docs minor]space for code-block (#16266)

* [docs minor]space for code-block

* correct more errors

* to runnableExamples

* add newline
This commit is contained in:
flywind 2020-12-06 16:54:32 +08:00 • committed by GitHub
commit 1e320bc8c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 13 deletions

View file

@ -568,9 +568,11 @@ proc inconsistentVarTypes(f, a: PType): bool {.inline.} =
proc procParamTypeRel(c: var TCandidate, f, a: PType): TTypeRelation = proc procParamTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
## For example we have: ## 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 myMap[T,S](sIn: seq[T], f: proc(x: T): S): seq[S] = ...
## proc innerProc[Q,W](q: Q): W = ... ## proc innerProc[Q,W](q: Q): W = ...
##
## And we want to match: myMap(@[1,2,3], innerProc) ## And we want to match: myMap(@[1,2,3], innerProc)
## This proc (procParamTypeRel) will do the following steps in ## This proc (procParamTypeRel) will do the following steps in
## three different calls: ## three different calls:

View file

@ -52,15 +52,9 @@ proc loadUnidecodeTable*(datafile = "unidecode.dat") =
proc unidecode*(s: string): string = proc unidecode*(s: string): string =
## Finds the sequence of ASCII characters that is the closest approximation ## Finds the sequence of ASCII characters that is the closest approximation
## to the UTF-8 string `s`. ## to the UTF-8 string `s`.
## runnableExamples:
## Example: assert unidecode("北京") == "Bei Jing "
##
## ..code-block:: nim
##
## unidecode("北京")
##
## Results in: "Bei Jing"
##
result = "" result = ""
for r in runes(s): for r in runes(s):
var c = int(r) var c = int(r)