summaryrefslogtreecommitdiff
path: root/Documentation/sphinx/parse-headers.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-08-22 16:19:16 +0200
committerJonathan Corbet <corbet@lwn.net>2025-08-29 15:54:42 -0600
commit285b8d3db2bae79c01d604701c3faddb456aca93 (patch)
tree4f59a8190d5566b2a715a2059b9d2471fc991f04 /Documentation/sphinx/parse-headers.py
parenta2d58c917c3e0d0cd161e343261717dbe96ffe22 (diff)
docs: parse-headers.py: better handle @var arguments
The kernel-doc markups inside headers may contain @var markups. With the current rule, this would be converted into: \* @:c:type:`DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR <dmx_buffer_flags>`\: Fix it adding a non-printed space if needed. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/8d06bb713d6ec8de65179dd93defe479715409b6.1755872208.git.mchehab+huawei@kernel.org
Diffstat (limited to 'Documentation/sphinx/parse-headers.py')
-rwxr-xr-xDocumentation/sphinx/parse-headers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Documentation/sphinx/parse-headers.py b/Documentation/sphinx/parse-headers.py
index 650f9c9a68d1..f4ab9c49d2f5 100755
--- a/Documentation/sphinx/parse-headers.py
+++ b/Documentation/sphinx/parse-headers.py
@@ -120,12 +120,12 @@ class ParseHeader:
},
# This is the name of the enum itself
"enum": {
- "prefix": "",
+ "prefix": "\\ ",
"suffix": "\\ ",
"ref_type": ":c:type",
},
"struct": {
- "prefix": "",
+ "prefix": "\\ ",
"suffix": "\\ ",
"ref_type": ":c:type",
},
@@ -390,6 +390,8 @@ class ParseHeader:
# Remove "\ " where not needed: before spaces and at the end of lines
text = re.sub(r"\\ ([\n ])", r"\1", text)
+ text = re.sub(r" \\ ", " ", text)
+
title = os.path.basename(file_in)