Skip to content

Commit

Permalink
[backport] Docs: Fix broken code-block (nim-lang#14749)
Browse files Browse the repository at this point in the history
This commit indents the contents of a `code-block` in `httpclient.nim`
so that it displays correctly. The bug was introduced by 42a6424.

I did a quick search for other `code-block`s that are broken in the same
way, but the only other one I found (in `pegs.nim`) is not included in
the generated documentation.
  • Loading branch information
ee7 authored Jun 22, 2020
1 parent 1ffe113 commit 1e484ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions lib/pure/httpclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
## ``AsyncHttpClient``:
##
## .. code-block:: Nim
## import asyncdispatch, httpclient
## import asyncdispatch, httpclient
##
## proc asyncProc(): Future[string] {.async.} =
## var client = newAsyncHttpClient()
## return await client.getContent("http://example.com")
## proc asyncProc(): Future[string] {.async.} =
## var client = newAsyncHttpClient()
## return await client.getContent("http://example.com")
##
## echo waitFor asyncProc()
## echo waitFor asyncProc()
##
## The functionality implemented by ``HttpClient`` and ``AsyncHttpClient``
## is the same, so you can use whichever one suits you best in the examples
Expand Down
40 changes: 20 additions & 20 deletions lib/pure/pegs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -870,26 +870,26 @@ macro mkHandlerTplts(handlers: untyped): untyped =
# The AST structure of *handlers[0]*:
#
# .. code-block::
# StmtList
# Call
# Ident "pkNonTerminal"
# StmtList
# Call
# Ident "enter"
# StmtList
# <handler code block>
# Call
# Ident "leave"
# StmtList
# <handler code block>
# Call
# Ident "pkChar"
# StmtList
# Call
# Ident "leave"
# StmtList
# <handler code block>
# ...
# StmtList
# Call
# Ident "pkNonTerminal"
# StmtList
# Call
# Ident "enter"
# StmtList
# <handler code block>
# Call
# Ident "leave"
# StmtList
# <handler code block>
# Call
# Ident "pkChar"
# StmtList
# Call
# Ident "leave"
# StmtList
# <handler code block>
# ...
proc mkEnter(hdName, body: NimNode): NimNode =
template helper(hdName, body) {.dirty.} =
template hdName(s, p, start) =
Expand Down

0 comments on commit 1e484ed

Please sign in to comment.