History

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.

Mauro Carvalho Chehab committed 1 year ago

Commit cc93e481 parent aea5e521 file · +3 −2Browse files

Unified · Split

Documentation/sphinx/kernel_abi.py+3−2
@@ -36,7 +36,7 @@ import os · 35 unmodified lines
36import re36import re
37import sys37import sys
38 38
39from docutils import nodes39from docutils import nodes, statemachine
40from docutils.statemachine import ViewList40from docutils.statemachine import ViewList
41from docutils.parsers.rst import directives, Directive41from docutils.parsers.rst import directives, Directive
42from sphinx.util.docutils import switch_source_input42from sphinx.util.docutils import switch_source_input
@@ -105,7 +105,8 @@ class KernelCmd(Directive): · 62 unmodified lines
105 old_f = fname105 old_f = fname
106 n = 0106 n = 0
107 for msg, f, ln in self.parser.doc():107 for msg, f, ln in self.parser.doc():
108 msg_list = msg.split("\n")108 msg_list = statemachine.string2lines(msg, tab_width,
109 convert_whitespace=True)
109 if "debug" in self.options:110 if "debug" in self.options:
110 lines = [111 lines = [
111 "", "", ".. code-block:: rst",112 "", "", ".. code-block:: rst",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t