Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rst: invalid use of admonition silently removes line #17646

Closed
timotheecour opened this issue Apr 5, 2021 · 1 comment · Fixed by #17659
Closed

rst: invalid use of admonition silently removes line #17646

timotheecour opened this issue Apr 5, 2021 · 1 comment · Fixed by #17659
Labels
Documentation Generation Related to documentation generation (but not content).

Comments

@timotheecour
Copy link
Member

timotheecour commented Apr 5, 2021

/cc @a-mr
just found this in docs https://nim-lang.github.io/Nim/iterators.html for fieldPairs, which were missing a line This really transforms the 'for' and unrolls the loop. The because docs used .. warning::: instead of .. warning::

Example

iterator fieldPairs2*[T: tuple|object](x: T): tuple[key: string, val: RootObj] =
  ## Iterates over every field of `x` returning their name and value.
  ##
  ## .. warning::: This really transforms the 'for' and unrolls the loop. The
  ##   current implementation also has a bug that affects symbol binding in the
  ##   loop body.

Current Output

please check whether the problem still exists in git head before posting,
see rebuilding the compiler.

Hola mundo!

image

Expected Output

if it's illegal in RST, give a CT error (simplest) or warning when running nim doc
if it's legal in RST, give a warning and probably render the skipped line as text

Additional Information

1.5.1 70a3031

@timotheecour timotheecour added the Documentation Generation Related to documentation generation (but not content). label Apr 5, 2021
@a-mr
Copy link
Contributor

a-mr commented Apr 6, 2021

Unfortunately .. syntax is reused for comments in rst, so it's legal.

But I agree that a warning should be given. Especially easy is to input single : after a directive name instead of ::.

a-mr added a commit to a-mr/Nim that referenced this issue Apr 6, 2021
Araq pushed a commit that referenced this issue Apr 8, 2021
* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
PMunch pushed a commit to PMunch/Nim that referenced this issue Mar 28, 2022
…lang#17659)

* further progress on rst roles & dir-s (fix nim-lang#17646)

* fix documents according to the messages

* fix bug 17 from nim-lang#17340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants