summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNĂ­colas F. R. A. Prado <nfraprado@protonmail.com>2020-09-11 13:34:46 +0000
committerJonathan Corbet <corbet@lwn.net>2020-09-16 11:09:51 -0600
commitc170f2eb9648bbc1cd46eac99bbcda7ce1b5a98f (patch)
treeaef06f09e70779800d3b758542da4a14af8d8071
parentd18b01789ae5abba2ce8dd23c984926eca3925a9 (diff)
docs: Document cross-referencing between documentation pages
The syntax to cross-reference between documentation pages wasn't documented anywhere. Document the cross-referencing using the new automarkup for Documentation/... and also Sphinx's doc directive for using relative paths. Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@protonmail.com> Link: https://lore.kernel.org/r/20200911133339.327721-4-nfraprado@protonmail.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/doc-guide/sphinx.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst
index f71ddd592aaa..896478baf570 100644
--- a/Documentation/doc-guide/sphinx.rst
+++ b/Documentation/doc-guide/sphinx.rst
@@ -337,6 +337,23 @@ Rendered as:
- column 3
+Cross-referencing
+-----------------
+
+Cross-referencing from one documentation page to another can be done by passing
+the path to the file starting from the Documentation folder.
+For example, to cross-reference to this page (the .rst extension is optional)::
+
+ See Documentation/doc-guide/sphinx.rst.
+
+If you want to use a relative path, you need to use Sphinx's ``doc`` directive.
+For example, referencing this page from the same directory would be done as::
+
+ See :doc:`sphinx`.
+
+For information on cross-referencing to kernel-doc functions or types, see
+Documentation/doc-guide/kernel-doc.rst.
+
.. _sphinx_kfigure:
Figures & Images