From: Jonathan Corbet <corbet@lwn.net>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Changbin Du <changbin.du@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts: kernel-doc: allow passing desired Sphinx C domain dialect
Date: Mon, 5 Oct 2020 10:17:36 -0600 [thread overview]
Message-ID: <20201005101736.7adf4f46@lwn.net> (raw)
In-Reply-To: <ee1f16453ad40eae2603adfde5f6dda3ab1befc7.1601798520.git.mchehab+huawei@kernel.org>
On Sun, 4 Oct 2020 10:02:03 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
> When kernel-doc is called via kerneldoc.py, there's no need to
> auto-detect the Sphinx version, as the Sphinx module already
> knows it. So, add an optional parameter to allow changing the
> Sphinx dialect.
>
> As kernel-doc can also be manually called, keep the auto-detection
> logic if the parameter was not specified. On such case, emit
> a warning if sphinx-build can't be found at PATH.
>
> Suggested-by: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> Documentation/sphinx/kerneldoc.py | 5 ++++
> scripts/kernel-doc | 40 ++++++++++++++++++++++++-------
> 2 files changed, 37 insertions(+), 8 deletions(-)
So I'm glad to see this. Still not fully sold on the autodetection, but if
we don't actually use it, maybe I can live with it :)
One little nit:
> diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
> index 233f610539f0..e9857ab904f1 100644
> --- a/Documentation/sphinx/kerneldoc.py
> +++ b/Documentation/sphinx/kerneldoc.py
> + } elsif ($cmd eq "sphinx-version") {
> + my $ver_string = shift @ARGV;
> + if ($ver_string =~ m/^(\d+)\.(\d+)\.(\d+)/) {
> + $sphinx_major = $1;
> + $sphinx_minor = $2;
> + $sphinx_patch = $3;
> + } else {
> + die "Sphinx version should be at major.minor.patch format\n";
> + }
Can we allow just major.minor, with patch defaulting to zero? People
passing this by hand may not want to look up their patch version every
time, and I doubt it will ever matter...
Thanks,
jon
next prev parent reply other threads:[~2020-10-05 16:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-04 8:02 [PATCH] scripts: kernel-doc: allow passing desired Sphinx C domain dialect Mauro Carvalho Chehab
2020-10-05 16:17 ` Jonathan Corbet [this message]
2020-10-06 6:42 ` Mauro Carvalho Chehab
2020-10-06 7:34 ` Joe Perches
2020-10-06 14:01 ` Jonathan Corbet
2020-10-06 16:53 ` Joe Perches
2020-10-12 12:27 ` Mauro Carvalho Chehab
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=20201005101736.7adf4f46@lwn.net \
--to=corbet@lwn.net \
--cc=changbin.du@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
/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).