Thread (42 messages) 42 messages, 5 authors, 2025-06-18

Re: [PATCH v5 10/15] docs: sphinx: add a parser for yaml files for Netlink specs

From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Date: 2025-06-18 08:21:12
Also in: linux-doc, linux-kernel-mentees, lkml

Em Tue, 17 Jun 2025 18:23:22 +0100
Donald Hunter [off-list ref] escreveu:
On Tue, 17 Jun 2025 at 17:00, Mauro Carvalho Chehab
[off-list ref] wrote:
quoted
quoted
(2) is cleaner and faster, but (1) is easier to implement on an
already-existing code.  
The logic below implements (1). This seems to be the easiest way for
pyyaml. I will submit as 2 separate patches at the end of the next
version.

Please notice that I didn't check yet for the "quality" of the
line numbers. Some tweaks could be needed later on.  
Thanks for working on this. I suppose we might be able to work on an
evolution from (1) to (2) in a followup piece of work?
Yes, it shouldn't be hard for you to migrate to (2) in the future. 

Currently, the parser is stateless, but, as there's now a class,
IMO the best would be to store the lines as an array of tuples
inside the YnlDocGenerator class, like this:

	self.lines = [
		(line_number1, message_string1),
		(line_number2, message_string2),
		(line_number3, message_string3),
		(line_number4, message_string4),
		...
	]

This way, the parse_yaml_file() method would just return self.lines.

Thanks,
Mauro
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help