[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8482fb62bf5c4c9972259d0e848de8c2a65741b.1738020236.git.mchehab+huawei@kernel.org>
Date: Tue, 28 Jan 2025 01:06:09 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"Mauro Carvalho Chehab" <mchehab+huawei@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [RFC v2 20/38] docs: sphinx/kernel_abi: properly split lines
Sphinx doesn't like to have lines split with str.split("\n").
Instead, it uses its own splitter, with handles line breaks the way
Spinx expects. Not using it cause issues at the output files.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
Documentation/sphinx/kernel_abi.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kernel_abi.py
index 025a4f02e1a4..2408ba7a3981 100644
--- a/Documentation/sphinx/kernel_abi.py
+++ b/Documentation/sphinx/kernel_abi.py
@@ -36,7 +36,7 @@ import os
import re
import sys
-from docutils import nodes
+from docutils import nodes, statemachine
from docutils.statemachine import ViewList
from docutils.parsers.rst import directives, Directive
from sphinx.util.docutils import switch_source_input
@@ -105,7 +105,8 @@ class KernelCmd(Directive):
old_f = fname
n = 0
for msg, f, ln in self.parser.doc():
- msg_list = msg.split("\n")
+ msg_list = statemachine.string2lines(msg, tab_width,
+ convert_whitespace=True)
if "debug" in self.options:
lines = [
"", "", ".. code-block:: rst",
--
2.48.1
Powered by blists - more mailing lists