[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250618102105.66ce01f0@foz.lan>
Date: Wed, 18 Jun 2025 10:21:05 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>, Jonathan Corbet
<corbet@....net>, Akira Yokosawa <akiyks@...il.com>, Breno Leitao
<leitao@...ian.org>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Ignacio Encinas Rubio <ignacio@...cinas.com>, Jan
Stancek <jstancek@...hat.com>, Marco Elver <elver@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Ruben Wauters <rubenru09@....com>, Shuah Khan
<skhan@...uxfoundation.org>, joel@...lfernandes.org,
linux-kernel-mentees@...ts.linux.dev, linux-kernel@...r.kernel.org,
lkmm@...ts.linux.dev, netdev@...r.kernel.org, peterz@...radead.org,
stern@...land.harvard.edu
Subject: Re: [PATCH v5 10/15] docs: sphinx: add a parser for yaml files for
Netlink specs
Em Tue, 17 Jun 2025 18:23:22 +0100
Donald Hunter <donald.hunter@...il.com> escreveu:
> On Tue, 17 Jun 2025 at 17:00, Mauro Carvalho Chehab
> <mchehab+huawei@...nel.org> wrote:
> > >
> > > (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
Powered by blists - more mailing lists