-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Doc] Fix some minor markup errors in manual #20112
[Doc] Fix some minor markup errors in manual #20112
Conversation
* Fix header level for noalias pragma section. * Fix code snippet outside of code block that raised an error with `rst2html`. * Fix broken 'Convertible relation' links that were raising warnings.
It's worth noting that all automatic links to subsections (like We shall to convert them to Markdown style links anyway. Markdown spec allows only links with the explicit target, but fortunately there is the implicit_header_references extension from Pandoc Markdown. To summarize: Type relations
==============
Convertible relation
--------------------
Old RST ways of referencing:
- manual `Convertible relation <#type-relations-convertible-relation>`_
- automatic, buggy in devel `Convertible relation`_
New Markdown ways:
- manual [Convertible relation](#type-relations-convertible-relation)
- automatic, not yet supported: [Convertible relation]() |
@a-mr I thought there was some automatic mechanism and I tried removing the explicit anchor in the first link, but it wasn't working. Good to know about the changes. Thank you |
Actually I re-checked links to sub-headers in 1.6 and 1.0 and it did not work. |
It was observed (in nim-lang#20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in nim-lang#2332 in 2015, that is it is present in Nim 1.0.
Fix links to subheader when TOC is present It was observed (in #20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in #2332 in 2015, that is it is present in Nim 1.0.
* Fix header level for noalias pragma section. * Fix code snippet outside of code block that raised an error with `rst2html`. * Fix broken 'Convertible relation' links that were raising warnings. Co-authored-by: quantimnot <[email protected]>
Fix links to subheader when TOC is present It was observed (in nim-lang#20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in nim-lang#2332 in 2015, that is it is present in Nim 1.0.
rst2html
.