1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

kernel-doc: Update "cross-referencing from rST" section to use automarkup

Update text and examples in the "Cross-referencing from
reStructuredText" section to reflect that no additional syntax is needed
anymore.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com>
Link: https://lore.kernel.org/r/20200903005747.3900333-3-nfraprado@protonmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Nícolas F. R. A. Prado 2020-09-03 00:58:26 +00:00 committed by Jonathan Corbet
parent d82b1e833e
commit 7c8b9e3000

View file

@ -387,22 +387,23 @@ Domain`_ references.
Cross-referencing from reStructuredText Cross-referencing from reStructuredText
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To cross-reference the functions and types defined in the kernel-doc comments No additional syntax is needed to cross-reference the functions and types
from reStructuredText documents, please use the `Sphinx C Domain`_ defined in the kernel-doc comments from reStructuredText documents.
references. For example:: Just end function names with ``()`` and write ``struct``, ``union``, ``enum``
or ``typedef`` before types.
For example::
See function :c:func:`foo` and struct/union/enum/typedef :c:type:`bar`. See foo().
See struct foo.
See union bar.
See enum baz.
See typedef meh.
While the type reference works with just the type name, without the However, if you want custom text in the cross-reference link, that can be done
struct/union/enum/typedef part in front, you may want to use:: through the following syntax::
See :c:type:`struct foo <foo>`. See :c:func:`my custom link text for function foo <foo>`.
See :c:type:`union bar <bar>`. See :c:type:`my custom link text for struct bar <bar>`.
See :c:type:`enum baz <baz>`.
See :c:type:`typedef meh <meh>`.
This will produce prettier links, and is in line with how kernel-doc does the
cross-references.
For further details, please refer to the `Sphinx C Domain`_ documentation. For further details, please refer to the `Sphinx C Domain`_ documentation.