OSDN Git Service

docs: Add automatic cross-reference for C types
authorNícolas F. R. A. Prado <nfraprado@protonmail.com>
Thu, 3 Sep 2020 00:58:19 +0000 (00:58 +0000)
committerJonathan Corbet <corbet@lwn.net>
Thu, 3 Sep 2020 19:50:40 +0000 (13:50 -0600)
commitd82b1e833e7cf4265b88287f469454a66afe95d8
tree4ddcddd78090933be57ee5ed6636b6be70f68e8c
parentf67281a72b30024b376ec3c2780bdfb777395c09
docs: Add automatic cross-reference for C types

In order to cross-reference C types in the documentation, Sphinx
requires the syntax :c:type:`type_name`, or even :c:type:`struct
type_name <type_name>` in order to have the link text different from the
target text.

Extend automarkup to enable automatic cross-reference of C types by
matching any "struct|union|enum|typedef type_name" expression.
This makes the documentation's plain text cleaner and adds
cross-reference to types without any additional effort by the author.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com>
Link: https://lore.kernel.org/r/20200903005747.3900333-2-nfraprado@protonmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx/automarkup.py