This commit is contained in:
parent
c57e320c94
commit
baa77387d7
2 changed files with 6 additions and 25 deletions
|
|
@ -97,24 +97,9 @@ Partial Output::
|
||||||
proc helloWorld(times: int) {.raises: [], tags: [].}
|
proc helloWorld(times: int) {.raises: [], tags: [].}
|
||||||
...
|
...
|
||||||
|
|
||||||
The full output can be seen here: `docgen_sample2.html <docgen_sample2.html>`_.
|
The full output can be seen here: `docgen_sample.html <docgen_sample.html>`_.
|
||||||
|
It runs after semantic checking, and includes pragmas attached implicitly by the
|
||||||
The older version of the ``doc`` command, now renamed ``doc0`` runs before
|
compiler.
|
||||||
semantic checking which means it lacks some of the things ``doc`` will output.
|
|
||||||
|
|
||||||
The ``doc0`` command::
|
|
||||||
nim doc0 sample
|
|
||||||
|
|
||||||
Partial Output::
|
|
||||||
...
|
|
||||||
proc helloWorld*(times: int)
|
|
||||||
...
|
|
||||||
|
|
||||||
Output can be viewed in full here: `docgen_sample.html <docgen_sample.html>`_.
|
|
||||||
As you can see, the tool has extracted less information than what the ``doc``
|
|
||||||
command provides, such as pragmas attached implicitly by the compiler. This type
|
|
||||||
of information is not available from looking at the AST (Abstract Syntax Tree)
|
|
||||||
prior to semantic checking, which is why ``doc0`` doesn't show it.
|
|
||||||
|
|
||||||
|
|
||||||
JSON
|
JSON
|
||||||
|
|
|
||||||
|
|
@ -303,14 +303,10 @@ proc mexec(cmds: openarray[string], processors: int) =
|
||||||
proc buildDocSamples(c: var TConfigData, destPath: string) =
|
proc buildDocSamples(c: var TConfigData, destPath: string) =
|
||||||
## Special case documentation sample proc.
|
## Special case documentation sample proc.
|
||||||
##
|
##
|
||||||
## The docgen sample needs to be generated twice with different commands, so
|
## TODO: consider integrating into the existing generic documentation builders
|
||||||
## it didn't make much sense to integrate into the existing generic
|
## now that we have a single `doc` command.
|
||||||
## documentation builders.
|
|
||||||
const src = "doc"/"docgen_sample.nim"
|
|
||||||
exec(findNim(c) & " doc $# -o:$# $#" %
|
exec(findNim(c) & " doc $# -o:$# $#" %
|
||||||
[c.nimArgs, destPath / "docgen_sample.html", src])
|
[c.nimArgs, destPath / "docgen_sample.html", "doc" / "docgen_sample.nim"])
|
||||||
exec(findNim(c) & " doc2 $# -o:$# $#" %
|
|
||||||
[c.nimArgs, destPath / "docgen_sample2.html", src])
|
|
||||||
|
|
||||||
proc pathPart(d: string): string = splitFile(d).dir.replace('\\', '/')
|
proc pathPart(d: string): string = splitFile(d).dir.replace('\\', '/')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue