netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Donald Hunter <donald.hunter@gmail.com>,
	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, 9 Nov 2023 07:20:10 -0800	[thread overview]
Message-ID: <ZUz4qkeMkazCUFKx@gmail.com> (raw)
In-Reply-To: <87r0kzuiax.fsf@meer.lwn.net>

On Thu, Nov 09, 2023 at 07:12:38AM -0700, Jonathan Corbet wrote:
> Donald Hunter <donald.hunter@gmail.com> writes:
> 
> > Jonathan Corbet <corbet@lwn.net> writes:
> >> 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/
> 
> Heh ... I totally forgot about that whole discussion ...
> 
> > 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.
> 
> I think it will vary depending on what we're trying to do, and I think
> we're still working it out - part of why I expressed some uncertainty
> this time around.
> 
> For something like the kernel-doc or automarkup, where we are modifying
> existing documents, an extension is the only way to go.  In this case,
> where we are creating new RST files from whole cloth, it's not so clear
> to me.  My feeling (this week at least ;) is that doing it as an
> extension makes things more complicated without a lot of benefit.

One way or another works for me. Given my experience with both ways, let
me share the advantages of boths so we can understand the trade-offs
better:

Sphinx extension advantages:
===========================

 1) Keep "extensions" uniform and organized, written in the same
 framework/language (python), using the same enry point, output, etc.

 2) Easy to cross reference objects in the whole documentation (not done
 in this patchset)

 3) Same dependencies for all "documentation". I.e, you don't need a
 dependency (as in python pip requirements.txt) for every "parser"
 script.

 4) Already being used in our infrastructure.


One-off parser advantages:
=========================

 1) Total flexibility. You can write the parser in any language.

 2) Easier and faster to interate and debug.

 3) No need to have a rst stub for every file (as in this patchset).
 This is a sphinx limitation right now, and *might* go away in the
 future.

 4) Less dependent of sphinx project.

> FWIW, if something like this is done as a makefile change, I'd do it a
> bit differently than your linked patch above.  Rather than replicate the
> command through the file, I'd just add a new target:
> 
>   netlink_specs:
>   	.../scripts/gen-netlink-rst
> 
>   htmldocs: netlink_specs
>   	existing stuff here
> 
> But that's a detail.

For that, we can't use a sphinx extension, since there is no way (as I
understood) from one rst to generate multiple rst.

      parent reply	other threads:[~2023-11-09 15:20 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
2023-11-09 14:12     ` Jonathan Corbet
2023-11-09 15:16       ` Jakub Kicinski
2023-11-09 15:20       ` Breno Leitao [this message]

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=ZUz4qkeMkazCUFKx@gmail.com \
    --to=leitao@debian.org \
    --cc=corbet@lwn.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.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).