docs: automarkup: Mark up undocumented entities too
authorJonathan Corbet <corbet@lwn.net>
Wed, 4 Jun 2025 14:18:04 +0000 (08:18 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Jun 2025 20:43:09 +0000 (14:43 -0600)
The automarkup code generates markup and a cross-reference link for
functions, structs, etc. for which it finds kerneldoc documentation.
Undocumented entities are left untouched; that creates an inconsistent
reading experience and has caused some writers to go to extra measures to
cause the markup to happen.

Mark up detected C entities regardless of whether they are documented.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx/automarkup.py

index 7828aeac92e7a4ed50113cb819e2e2ad12c7576d..e67eb8e19c22d2c5fa09449a58865e4bcfb798a6 100644 (file)
@@ -235,8 +235,13 @@ def add_and_resolve_xref(app, docname, domain, reftype, target, contnode=None):
 
     if xref:
         return xref
-
-    return None
+    #
+    # We didn't find the xref; if a container node was supplied,
+    # mark it as a broken xref
+    #
+    if contnode:
+        contnode.set_class("broken_xref")
+    return contnode
 
 #
 # Variant of markup_abi_ref() that warns whan a reference is not found