mirror-linux/Documentation/sphinx
Mauro Carvalho Chehab 47459937be sphinx: parser_yaml.py: fix line numbers information
As reported by Donald, this code:

	rst_parser = RSTParser()
	rst_parser.parse('\n'.join(result), document)

breaks line parsing. As an alternative, I tested a variant of it:

	rst_parser.parse(result, document)

but still line number was not preserved. As Donald noted,
standard Parser classes don't have a direct mechanism to preserve
line numbers from ViewList().

So, instead, let's use a mechanism similar to what we do already at
kerneldoc.py: call the statemachine mechanism directly there.

I double-checked when states and statemachine were introduced:
both were back in 2002. I also tested doc build with docutils 0.16
and 0.21.2. It worked with both, so it seems to be stable enough
for our needs.

Reported-by: Donald Hunter <donald.hunter@gmail.com>
Closes: https://lore.kernel.org/linux-doc/m24ivk78ng.fsf@gmail.com/T/#u
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2025-08-12 07:47:31 +02:00
..
templates docs/sphinx: Fix TOC scroll hack for the home page 2024-01-23 14:33:13 -07:00
automarkup.py docs: sphinx: avoid using the deprecated node.set_class() 2025-06-21 13:18:03 -06:00
cdomain.py docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
kernel_abi.py sphinx: kernel_abi: fix performance regression with O=<dir> 2025-07-24 08:36:17 -06:00
kernel_feat.py docs: extensions: don't use utf-8 syntax for descriptions 2025-02-13 11:33:32 -07:00
kernel_include.py docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
kerneldoc-preamble.sty docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks 2024-09-05 14:16:41 -06:00
kerneldoc.py docs: kdoc: Remove a Python 2 comment 2025-07-08 08:06:25 -06:00
kfigure.py docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
load_config.py docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
maintainers_include.py docs: extensions: don't use utf-8 syntax for descriptions 2025-02-13 11:33:32 -07:00
min_requirements.txt docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
parallel-wrapper.sh
parse-headers.pl docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
parser_yaml.py sphinx: parser_yaml.py: fix line numbers information 2025-08-12 07:47:31 +02:00
requirements.txt docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
rstFlatTable.py docs: sphinx: add missing SPDX tags 2025-06-25 12:39:17 -06:00
translations.py docs: translations: use attribute to store current language 2024-02-21 13:41:37 -07:00