]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
docs: kdoc_output: better handle lists
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 6 Mar 2026 15:45:51 +0000 (16:45 +0100)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Mar 2026 16:34:39 +0000 (10:34 -0600)
On several functions, the return values are inside a bullet
list. Also, on some places, there are numbered lists as well.

Use a troff markup to format them, to avoid placing everything
on a single line.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <edea87623550a51086c23c9af0edc5e9fcce0ed6.1772810752.git.mchehab+huawei@kernel.org>

tools/lib/python/kdoc/kdoc_output.py

index df9af444da579fe17e8ec15f8a593c6f430bd22d..08539dd92cbb442dfe6fb24cdefac1f0bf0cce08 100644 (file)
@@ -963,6 +963,14 @@ class ManFormat(OutputFormat):
                     i += 1
                     continue
 
+                #
+                # Handle lists
+                #
+                line = KernRe(r'^[-*]\s+').sub(r'.IP \[bu]\n', line)
+                line = KernRe(r'^(\d+|a-z)[\.\)]\s+').sub(r'.IP \1\n', line)
+            else:
+                line = ".PP\n"
+
             i += 1
 
             self.data += line + "\n"