documentation style tweaks (#10790)
* exports are the least important field in the docs: they are put in the last place (at the bottom) * indent text after proc/type declaration for an easier navigation (noticeable difference between declarations and examples) * quickfix invalid style in `asynchttpserver`
This commit is contained in:
parent
3294ce3831
commit
bba3a20e7c
6 changed files with 20 additions and 20 deletions
|
|
@ -20,7 +20,7 @@ import
|
||||||
pathutils
|
pathutils
|
||||||
|
|
||||||
const
|
const
|
||||||
exportSection = skTemp
|
exportSection = skField
|
||||||
|
|
||||||
type
|
type
|
||||||
TSections = array[TSymKind, Rope]
|
TSections = array[TSymKind, Rope]
|
||||||
|
|
@ -893,9 +893,9 @@ proc generateTags*(d: PDoc, n: PNode, r: var Rope) =
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
proc genSection(d: PDoc, kind: TSymKind) =
|
proc genSection(d: PDoc, kind: TSymKind) =
|
||||||
const sectionNames: array[skTemp..skTemplate, string] = [
|
const sectionNames: array[skModule..skField, string] = [
|
||||||
"Exports", "Imports", "Types", "Vars", "Lets", "Consts", "Vars", "Procs", "Funcs",
|
"Imports", "Types", "Vars", "Lets", "Consts", "Vars", "Procs", "Funcs",
|
||||||
"Methods", "Iterators", "Converters", "Macros", "Templates"
|
"Methods", "Iterators", "Converters", "Macros", "Templates", "Exports"
|
||||||
]
|
]
|
||||||
if d.section[kind] == nil: return
|
if d.section[kind] == nil: return
|
||||||
var title = sectionNames[kind].rope
|
var title = sectionNames[kind].rope
|
||||||
|
|
|
||||||
|
|
@ -533,11 +533,11 @@ dl {
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
margin-bottom: -0.5em;
|
margin-bottom: -0.5em;
|
||||||
margin-left: 0.5em; }
|
margin-left: 0.0em; }
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 2.0em;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 3.0em;
|
||||||
margin-top: 0.5em; }
|
margin-top: 0.5em; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
## allowing users to connect directly to this server.
|
## allowing users to connect directly to this server.
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## Examples
|
## Basic usage
|
||||||
## --------
|
## -----------
|
||||||
##
|
##
|
||||||
## This example will create an HTTP server on port 8080. The server will
|
## This example will create an HTTP server on port 8080. The server will
|
||||||
## respond to all requests with a ``200 OK`` response code and "Hello World"
|
## respond to all requests with a ``200 OK`` response code and "Hello World"
|
||||||
|
|
@ -85,8 +85,8 @@ proc respond*(req: Request, code: HttpCode, content: string,
|
||||||
##
|
##
|
||||||
## This procedure will **not** close the client socket.
|
## This procedure will **not** close the client socket.
|
||||||
##
|
##
|
||||||
## Examples
|
## Example:
|
||||||
## --------
|
##
|
||||||
## .. code-block::nim
|
## .. code-block::nim
|
||||||
## import json
|
## import json
|
||||||
## proc handler(req: Request) {.async.} =
|
## proc handler(req: Request) {.async.} =
|
||||||
|
|
|
||||||
|
|
@ -345,11 +345,11 @@ dl {
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
margin-bottom: -0.5em;
|
margin-bottom: -0.5em;
|
||||||
margin-left: 0.5em; }
|
margin-left: 0.0em; }
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 2.0em;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 3.0em;
|
||||||
margin-top: 0.5em; }
|
margin-top: 0.5em; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -345,11 +345,11 @@ dl {
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
margin-bottom: -0.5em;
|
margin-bottom: -0.5em;
|
||||||
margin-left: 0.5em; }
|
margin-left: 0.0em; }
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 2.0em;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 3.0em;
|
||||||
margin-top: 0.5em; }
|
margin-top: 0.5em; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -345,11 +345,11 @@ dl {
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
margin-bottom: -0.5em;
|
margin-bottom: -0.5em;
|
||||||
margin-left: 0.5em; }
|
margin-left: 0.0em; }
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
margin-left: 0.5em;
|
margin-left: 2.0em;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 3.0em;
|
||||||
margin-top: 0.5em; }
|
margin-top: 0.5em; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue