diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst index fff6604631ea..4fd86c21397b 100644 --- a/Documentation/doc-guide/kernel-doc.rst +++ b/Documentation/doc-guide/kernel-doc.rst @@ -387,22 +387,23 @@ Domain`_ references. Cross-referencing from reStructuredText ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To cross-reference the functions and types defined in the kernel-doc comments -from reStructuredText documents, please use the `Sphinx C Domain`_ -references. For example:: +No additional syntax is needed to cross-reference the functions and types +defined in the kernel-doc comments from reStructuredText documents. +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 -struct/union/enum/typedef part in front, you may want to use:: +However, if you want custom text in the cross-reference link, that can be done +through the following syntax:: - See :c:type:`struct foo `. - See :c:type:`union bar `. - See :c:type:`enum baz `. - See :c:type:`typedef meh `. - -This will produce prettier links, and is in line with how kernel-doc does the -cross-references. + See :c:func:`my custom link text for function foo `. + See :c:type:`my custom link text for struct bar `. For further details, please refer to the `Sphinx C Domain`_ documentation.