]> git.baikalelectronics.ru Git - kernel.git/commit
docs: Fix reST markup when linking to sections
authorNícolas F. R. A. Prado <nfraprado@protonmail.com>
Mon, 28 Dec 2020 14:46:07 +0000 (14:46 +0000)
committerJonathan Corbet <corbet@lwn.net>
Thu, 31 Dec 2020 22:44:47 +0000 (15:44 -0700)
commitb5225c007aa95a36ba953c57313118b61380af2e
treea29d2ee06b509478bd6d41ef48ad6f24e8b8f011
parent2af7ba1dc0ac24f9c1b6fbed627077d8df258132
docs: Fix reST markup when linking to sections

During the process of converting the documentation to reST, some links
were converted using the following wrong syntax (and sometimes using %20
instead of spaces):

   `Display text <#section-name-in-html>`__

This syntax isn't valid according to the docutils' spec [1], but more
importantly, it is specific to HTML, since it uses '#' to link to an
HTML anchor.

The right syntax would instead use a docutils hyperlink reference as the
embedded URI to point to the section [2], that is:

   `Display text <Section Name_>`__

This syntax works in both HTML and PDF.

The LaTeX toolchain doesn't mind the HTML anchor syntax when generating
the pdf documentation (make pdfdocs), that is, the build succeeds but
the links don't work, but that syntax causes errors when trying to build
using the not-yet-merged rst2pdf:

   ValueError: format not resolved, probably missing URL scheme or undefined destination target for 'Forcing%20Quiescent%20States'

So, use the correct syntax in order to have it work in all different
output formats.

[1]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#reference-names
[2]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases

Fixes: 7c135c37b09c ("docs: rcu: convert some articles from html to ReST")
Fixes: fe470f1b6928 ("docs: Fix the reference labels in Locking.rst")
Fixes: 889e7dc0474d ("docs-rst: convert kernel-locking to ReST")
Fixes: 6379b4187c2c ("ALSA: doc: ReSTize writing-an-alsa-driver document")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20201228144537.135353-1-nfraprado@protonmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst
Documentation/RCU/Design/Requirements/Requirements.rst
Documentation/kernel-hacking/locking.rst
Documentation/sound/kernel-api/writing-an-alsa-driver.rst