further progress on rst roles & directives (fix #17646) (#17659)

* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
This commit is contained in:
Andrey Makarov 2021-04-08 20:00:14 +03:00 • committed by GitHub
commit 42687457b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 129 additions and 51 deletions

View file

@ -42,7 +42,7 @@
##
## Code to read some data from a socket may look something like this:
##
## .. code-block::nim
## .. code-block:: Nim
## var future = socket.recv(100)
## future.addCallback(
## proc () =

View file

@ -21,7 +21,7 @@
## In order to begin any sort of transfer of files you must first
## connect to an FTP server. You can do so with the `connect` procedure.
##
## .. code-block::nim
## .. code-block:: Nim
## import std/[asyncdispatch, asyncftpclient]
## proc main() {.async.} =
## var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test")
@ -41,7 +41,7 @@
## working directory before you do so with the `pwd` procedure, you can also
## instead specify an absolute path.
##
## .. code-block::nim
## .. code-block:: Nim
## import std/[asyncdispatch, asyncftpclient]
## proc main() {.async.} =
## var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test")
@ -62,7 +62,7 @@
## Procs that take an `onProgressChanged` callback will call this every
## `progressInterval` milliseconds.
##
## .. code-block::nim
## .. code-block:: Nim
## import std/[asyncdispatch, asyncftpclient]
##
## proc onProgressChanged(total, progress: BiggestInt,

View file

@ -108,7 +108,7 @@ proc respond*(req: Request, code: HttpCode, content: string,
##
## Example:
##
## .. code-block::nim
## .. code-block:: Nim
## import std/json
## proc handler(req: Request) {.async.} =
## if req.url.path == "/hello-world":

View file

@ -65,7 +65,7 @@
##
## The following example demonstrates a simple chat server.
##
## .. code-block::nim
## .. code-block:: Nim
##
## import std/[asyncnet, asyncdispatch]
##

View file

@ -23,14 +23,14 @@
## Encoding data
## -------------
##
## .. code-block::nim
## .. code-block:: Nim
## import std/base64
## let encoded = encode("Hello World")
## assert encoded == "SGVsbG8gV29ybGQ="
##
## Apart from strings you can also encode lists of integers or characters:
##
## .. code-block::nim
## .. code-block:: Nim
## import std/base64
## let encodedInts = encode([1,2,3])
## assert encodedInts == "AQID"
@ -41,7 +41,7 @@
## Decoding data
## -------------
##
## .. code-block::nim
## .. code-block:: Nim
## import std/base64
## let decoded = decode("SGVsbG8gV29ybGQ=")
## assert decoded == "Hello World"
@ -49,7 +49,7 @@
## URL Safe Base64
## ---------------
##
## .. code-block::nim
## .. code-block:: Nim
## import std/base64
## doAssert encode("c\xf7>", safe = true) == "Y_c-"
## doAssert encode("c\xf7>", safe = false) == "Y/c+"

View file

@ -22,7 +22,7 @@
## If the library fails to load or the function 'greet' is not found,
## it quits with a failure error code.
##
## .. code-block::nim
## .. code-block:: Nim
##
## import std/dynlib
##