diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2022-10-05 21:03:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 14:03:10 -0400 |
commit | 6505bd347df557713061d4e84cf9548d104622d9 (patch) | |
tree | 8f48f1d066b9e807b2c5550edb5f743e7cc7fa01 /lib/pure | |
parent | 594e93a66bd19297d23d3328a3f35aa6ac3789af (diff) | |
download | Nim-6505bd347df557713061d4e84cf9548d104622d9.tar.gz |
Markdown indented code blocks (#20473)
* Implement Markdown indented code blocks Additional indentation of 4 spaces makes a block an "indented code block" (monospaced text without syntax highlighting). Also `::` RST syntax for code blocks is disabled. So instead of ```rst see:: Some code ``` the code block should be written as ```markdown see: Some code ``` * Migrate RST literal blocks :: to Markdown's ones
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/distros.nim | 8 | ||||
-rw-r--r-- | lib/pure/htmlgen.nim | 4 | ||||
-rw-r--r-- | lib/pure/os.nim | 11 | ||||
-rw-r--r-- | lib/pure/pegs.nim | 4 | ||||
-rw-r--r-- | lib/pure/strformat.nim | 8 | ||||
-rw-r--r-- | lib/pure/xmltree.nim | 4 |
6 files changed, 20 insertions, 19 deletions
diff --git a/lib/pure/distros.nim b/lib/pure/distros.nim index 797698d61..052b58b07 100644 --- a/lib/pure/distros.nim +++ b/lib/pure/distros.nim @@ -9,12 +9,12 @@ ## This module implements the basics for Linux distribution ("distro") ## detection and the OS's native package manager. Its primary purpose is to -## produce output for Nimble packages, like:: +## produce output for Nimble packages, like: ## -## To complete the installation, run: +## To complete the installation, run: ## -## sudo apt-get install libblas-dev -## sudo apt-get install libvoodoo +## sudo apt-get install libblas-dev +## sudo apt-get install libvoodoo ## ## The above output could be the result of a code snippet like: ## diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim index 89eb24bb9..bf31c0239 100644 --- a/lib/pure/htmlgen.nim +++ b/lib/pure/htmlgen.nim @@ -34,9 +34,9 @@ ## var nim = "Nim" ## echo h1(a(href="https://nim-lang.org", nim)) ## -## Writes the string:: +## Writes the string: ## -## <h1><a href="https://nim-lang.org">Nim</a></h1> +## <h1><a href="https://nim-lang.org">Nim</a></h1> ## import diff --git a/lib/pure/os.nim b/lib/pure/os.nim index b1292a648..a635c62ef 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -2294,11 +2294,12 @@ iterator walkDir*(dir: string; relative = false, checkDir = false): ## ## **Example:** ## - ## This directory structure:: - ## dirA / dirB / fileB1.txt - ## / dirC - ## / fileA1.txt - ## / fileA2.txt + ## This directory structure: + ## + ## dirA / dirB / fileB1.txt + ## / dirC + ## / fileA1.txt + ## / fileA2.txt ## ## and this code: runnableExamples("-r:off"): diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index a95700825..1cf4e2724 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -2058,9 +2058,9 @@ func parsePeg*(pattern: string, filename = "pattern", line = 1, col = 0): Peg = func peg*(pattern: string): Peg = ## constructs a Peg object from the `pattern`. The short name has been - ## chosen to encourage its use as a raw string modifier:: + ## chosen to encourage its use as a raw string modifier: ## - ## peg"{\ident} \s* '=' \s* {.*}" + ## peg"{\ident} \s* '=' \s* {.*}" result = parsePeg(pattern, "pattern") func escapePeg*(s: string): string = diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim index fe3cfdab0..216c1ff11 100644 --- a/lib/pure/strformat.nim +++ b/lib/pure/strformat.nim @@ -171,9 +171,9 @@ For strings and numeric types the optional argument is a so-called # Standard format specifiers for strings, integers and floats -The general form of a standard format specifier is:: +The general form of a standard format specifier is: - [[fill]align][sign][#][0][minimumwidth][.precision][type] + [[fill]align][sign][#][0][minimumwidth][.precision][type] The square brackets `[]` indicate an optional element. @@ -423,9 +423,9 @@ proc formatInt(n: SomeNumber; radix: int; spec: StandardFormatSpecifier): string proc parseStandardFormatSpecifier*(s: string; start = 0; ignoreUnknownSuffix = false): StandardFormatSpecifier = ## An exported helper proc that parses the "standard format specifiers", - ## as specified by the grammar:: + ## as specified by the grammar: ## - ## [[fill]align][sign][#][0][minimumwidth][.precision][type] + ## [[fill]align][sign][#][0][minimumwidth][.precision][type] ## ## This is only of interest if you want to write a custom `format` proc that ## should support the standard format specifiers. If `ignoreUnknownSuffix` is true, diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim index 72645ef96..6228bd10f 100644 --- a/lib/pure/xmltree.nim +++ b/lib/pure/xmltree.nim @@ -778,8 +778,8 @@ macro `<>`*(x: untyped): untyped = ## .. code-block:: nim ## <>a(href="http://nim-lang.org", newText("Nim rules.")) ## - ## Produces an XML tree for:: + ## Produces an XML tree for: ## - ## <a href="http://nim-lang.org">Nim rules.</a> + ## <a href="http://nim-lang.org">Nim rules.</a> ## result = xmlConstructor(x) |