From: Donald Hunter <donald.hunter@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Breno Leitao <leitao@debian.org>,
linux-doc@vger.kernel.org, netdev@vger.kernel.org,
kuba@kernel.org, pabeni@redhat.com, edumazet@google.com
Subject: Re: [PATCH] Documentation: Document the Netlink spec
Date: Thu, 09 Nov 2023 11:22:05 +0000 [thread overview]
Message-ID: <m2h6lvmasi.fsf@gmail.com> (raw)
In-Reply-To: <875y2cxa6n.fsf@meer.lwn.net> (Jonathan Corbet's message of "Wed, 08 Nov 2023 13:27:28 -0700")
Jonathan Corbet <corbet@lwn.net> writes:
> Breno Leitao <leitao@debian.org> writes:
>
>> This is a Sphinx extension that parses the Netlink YAML spec files
>> (Documentation/netlink/specs/), and generates a rst file to be
>> displayed into Documentation pages.
>>
>> Create a new Documentation/networking/netlink_spec page, and a sub-page
>> for each Netlink spec that needs to be documented, such as ethtool,
>> devlink, netdev, etc.
>>
>> Create a Sphinx directive extension that reads the YAML spec
>> (located under Documentation/netlink/specs), parses it and returns a RST
>> string that is inserted where the Sphinx directive was called.
>
> So I finally had a chance to look a bit at this; I have a few
> impressions.
>
> First of all, if you put something silly into one of the YAML files, it
> kills the whole docs build, which is ... not desirable:
>
>> Exception occurred:
>> File "/usr/lib64/python3.11/site-packages/yaml/scanner.py", line 577, in fetch_value
>> raise ScannerError(None, None,
>> yaml.scanner.ScannerError: mapping values are not allowed here
>> in "/stuff/k/git/kernel/Documentation/netlink/specs/ovs_datapath.yaml", line 14, column 9
>>
>
> That error needs to be caught and handled in some more graceful way.
>
> I do have to wonder, though, whether a sphinx extension is the right way
> to solve this problem. You're essentially implementing a filter that
> turns one YAML file into one RST file; might it be better to keep that
> outside of sphinx as a standalone script, invoked by the Makefile?
>
> Note that I'm asking because I wonder, I'm not saying I would block an
> extension-based implementation.
+1 to this. The .rst generation can then be easily tested independently
of the doc build and the stub files could be avoided.
Just a note that last year you offered the opposite guidance:
https://lore.kernel.org/linux-doc/87tu4zsfse.fsf@meer.lwn.net/
If the preference now is for standalone scripts invoked by the Makefile
then this previous patch might be useful:
https://lore.kernel.org/linux-doc/20220922115257.99815-2-donald.hunter@gmail.com/
It would be good to document the preferred approach to this kind of doc
extension and I'd be happy to contribute an 'Extensions' section for
contributing.rst in the doc-guide.
> Thanks,
>
> jon
next prev parent reply other threads:[~2023-11-09 11:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 13:56 [PATCH] Documentation: Document the Netlink spec Breno Leitao
2023-11-06 22:51 ` Jakub Kicinski
2023-11-08 14:03 ` Donald Hunter
2023-11-08 14:08 ` Donald Hunter
2023-11-09 18:28 ` Breno Leitao
2023-11-08 20:27 ` Jonathan Corbet
2023-11-09 1:43 ` Jakub Kicinski
2023-11-10 9:23 ` Donald Hunter
2023-11-09 11:22 ` Donald Hunter [this message]
2023-11-09 14:12 ` Jonathan Corbet
2023-11-09 15:16 ` Jakub Kicinski
2023-11-09 15:20 ` Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2h6lvmasi.fsf@gmail.com \
--to=donald.hunter@gmail.com \
--cc=corbet@lwn.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-doc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).