You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can have multiple runnableExamples blocks per proc (and they both get run and shown in html) however the doc comments after the 1st runnableExamples block aren't exported in generated html docs; this makes it currently impossible to replace documentation using multiple .. code-block:: nim sections (or a single one but with doc comments after it) with runnableExamples while maintaining the same docs. The proposal is simple: make subsequent doc comments blocks part of proc documentation, until the 1st empty line or start of code implementation to separate proc doc comment from proc implementation.
whendefined(case1):
procfoo*()=## proc doc comment part 1
runnableExamples: echo"ok1"## proc doc comment part 2 BUG: not in generated html
runnableExamples: echo"ok2"## proc doc comment part 3 BUG: not in generated html## not part of proc doc commentecho"ok3"whendefined(case2):
procfoo*()=## proc doc comment part 1#### .. code-block:: nim## echo "ok1"#### proc doc comment part 2#### .. code-block:: nim## echo "ok2"#### proc doc comment part 3## not part of proc doc commentecho"ok3"
timotheecour
changed the title
[docgen] proc doc comments not exported after 1st runnableExamples block even though multiple runnableExamples blocks are allowed
[docgen] proc doc comments silently omitted after 1st runnableExamples
Jan 22, 2020
…s + runnableExamples and be docgen'd correctly (nim-lang#14441)
* fixnim-lang#9227 proc doc comments after 1st runnableExamples are not ignored anymore
We can have multiple runnableExamples blocks per proc (and they both get run and shown in html) however the doc comments after the 1st runnableExamples block aren't exported in generated html docs; this makes it currently impossible to replace documentation using multiple
.. code-block:: nim
sections (or a single one but with doc comments after it) withrunnableExamples
while maintaining the same docs. The proposal is simple: make subsequent doc comments blocks part of proc documentation, until the 1st empty line or start of code implementation to separate proc doc comment from proc implementation.case1:
case2:
Note: see [1] for rationale as to why
runnableExamples
are preferred over.. code-block
[1] runnableExamples should generally be preferred to
.. code-block:: nim
- Nim forumThe text was updated successfully, but these errors were encountered: