summaryrefslogtreecommitdiff
path: root/Documentation/sphinx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-02-11 09:22:55 +0300
committerJonathan Corbet <corbet@lwn.net>2025-02-18 23:42:46 +0300
commitff7ff6eb4f809a5c161ec524e6a23347b07e3f04 (patch)
tree9053ea53ed74fd8abb9e555c32b5a2c93e9e9333 /Documentation/sphinx
parent83b029482d97676233c57582c347b516e96b6786 (diff)
downloadlinux-ff7ff6eb4f809a5c161ec524e6a23347b07e3f04.tar.xz
docs: media: Allow creating cross-references for RC ABI
Now that Documentation/ABI is processed by automarkup, let it generate cross-references for RC sysfs devnodes. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/7c2f9a9970a15df8b5e3a6ecd21bcedcc8881ce1.1739254867.git.mchehab+huawei@kernel.org
Diffstat (limited to 'Documentation/sphinx')
-rw-r--r--Documentation/sphinx/automarkup.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index 22defc18d6d2..03bb7020f5cb 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -88,13 +88,13 @@ def markup_refs(docname, app, node):
# Associate each regex with the function that will markup its matches
#
markup_func_sphinx2 = {RE_doc: markup_doc_ref,
- RE_abi_file: markup_abi_ref,
+ RE_abi_file: markup_abi_file_ref,
RE_abi_symbol: markup_abi_ref,
RE_function: markup_c_ref,
RE_generic_type: markup_c_ref}
markup_func_sphinx3 = {RE_doc: markup_doc_ref,
- RE_abi_file: markup_abi_ref,
+ RE_abi_file: markup_abi_file_ref,
RE_abi_symbol: markup_abi_ref,
RE_function: markup_func_ref_sphinx3,
RE_struct: markup_c_ref,
@@ -279,10 +279,10 @@ def markup_doc_ref(docname, app, match):
return nodes.Text(match.group(0))
#
-# Try to replace a documentation reference of the form Documentation/ABI/...
+# Try to replace a documentation reference for ABI symbols and files
# with a cross reference to that page
#
-def markup_abi_ref(docname, app, match):
+def markup_abi_ref(docname, app, match, warning=False):
stddom = app.env.domains['std']
#
# Go through the dance of getting an xref out of the std domain
@@ -294,6 +294,8 @@ def markup_abi_ref(docname, app, match):
# Kernel ABI doesn't describe such file or symbol
if not target:
+ if warning:
+ kernel_abi.log.warning("%s not found", fname)
return nodes.Text(match.group(0))
pxref = addnodes.pending_xref('', refdomain = 'std', reftype = 'ref',
@@ -317,6 +319,13 @@ def markup_abi_ref(docname, app, match):
else:
return nodes.Text(match.group(0))
+#
+# Variant of markup_abi_ref() that warns whan a reference is not found
+#
+def markup_abi_file_ref(docname, app, match):
+ return markup_abi_ref(docname, app, match, warning=True)
+
+
def get_c_namespace(app, docname):
source = app.env.doc2path(docname)
with open(source) as f: