Fix docgen snippet numbering (#13507)
This commit is contained in:
parent
e8c057fb27
commit
f8175688a3
2 changed files with 2 additions and 2 deletions
|
|
@ -191,10 +191,10 @@ proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef,
|
||||||
initStrTable result.types
|
initStrTable result.types
|
||||||
result.onTestSnippet =
|
result.onTestSnippet =
|
||||||
proc (gen: var RstGenerator; filename, cmd: string; status: int; content: string) =
|
proc (gen: var RstGenerator; filename, cmd: string; status: int; content: string) =
|
||||||
|
inc(gen.id)
|
||||||
var d = TDocumentor(gen)
|
var d = TDocumentor(gen)
|
||||||
var outp: AbsoluteFile
|
var outp: AbsoluteFile
|
||||||
if filename.len == 0:
|
if filename.len == 0:
|
||||||
inc(d.id)
|
|
||||||
let nameOnly = splitFile(d.filename).name
|
let nameOnly = splitFile(d.filename).name
|
||||||
outp = getNimcacheDir(conf) / RelativeDir(nameOnly) /
|
outp = getNimcacheDir(conf) / RelativeDir(nameOnly) /
|
||||||
RelativeFile(nameOnly & "_snippet_" & $d.id & ".nim")
|
RelativeFile(nameOnly & "_snippet_" & $d.id & ".nim")
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ when defined(nimlocks):
|
||||||
else:
|
else:
|
||||||
{.pragma: benign, gcsafe.}
|
{.pragma: benign, gcsafe.}
|
||||||
|
|
||||||
template since(version, body: untyped) {.dirty.} =
|
template since(version, body: untyped) {.dirty, used.} =
|
||||||
## limitation: can't be used to annotate a template (eg typetraits.get), would
|
## limitation: can't be used to annotate a template (eg typetraits.get), would
|
||||||
## error: cannot attach a custom pragma.
|
## error: cannot attach a custom pragma.
|
||||||
when (NimMajor, NimMinor) >= version:
|
when (NimMajor, NimMinor) >= version:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue