From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Federico Vaga <federico.vaga@vaga.pv.it>
Cc: Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH] doc: fix reference to core-api/namespaces.rst
Date: Fri, 20 Mar 2020 11:21:22 +0100 [thread overview]
Message-ID: <20200320112122.48244ec4@coco.lan> (raw)
In-Reply-To: <2008227.4siv4ILC15@harkonnen>
Em Sun, 24 Nov 2019 18:02:02 +0100
Federico Vaga <federico.vaga@vaga.pv.it> escreveu:
> > diff --git a/Documentation/conf.py b/Documentation/conf.py
> > index 3c7bdf4cd31f..fa2bfcd6df1d 100644
> > --- a/Documentation/conf.py
> > +++ b/Documentation/conf.py
> > @@ -38,7 +38,7 @@ needs_sphinx = '1.3'
> > # ones.
> > extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain',
> > 'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
> > - 'maintainers_include']
> > + 'maintainers_include', 'sphinx.ext.autosectionlabel' ]
> >
Testing today's linux-next branch. This extension caused *lots* of
warnings like this:
Documentation/driver-api/uio-howto.rst:12: WARNING: duplicate label translations, other instance in Documentation/index.rst
The thing is that, by default, autosectionlabel uses a global namespace,
with cause lots of troubles with sections like "introduction". So, it
needs to be ensured that no duplication will happen.
Btw, I tried to setup this:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index fa2bfcd6df1d..7eaadde98a86 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -40,6 +40,9 @@ extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain',
'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
'maintainers_include', 'sphinx.ext.autosectionlabel' ]
+# Avoid lots of warnings with autosectionlabel extension
+autosectionlabel_prefix_document = True
+
# The name of the math extension changed on Sphinx 1.4
if (major == 1 and minor > 3) or (major > 1):
extensions.append("sphinx.ext.imgmath")
But I still get lots of duplicated section labels inside the same file,
like this one (757 warnings):
docs/Documentation/driver-api/parport-lowlevel.rst:815: WARNING: duplicate label driver-api/parport-lowlevel:description, other instance in Documentation/driver-api/parport-lowlevel.rst
There we have things that are similar to man pages, like this:
parport_register_driver - register a device driver with parport
---------------------------------------------------------------
SYNOPSIS
^^^^^^^^
...
parport_unregister_driver - tell parport to forget about this driver
--------------------------------------------------------------------
SYNOPSIS
^^^^^^^^
A solution would be to split all the files that are hitting this, but
I suspect that this is too much effort for too less benefit.
I would instead just revert this patch and fix it by adding a normal
explicit reference.
Another alternative would be to patch the Sphinx extension to make it
handle references on an hierarchical way, e. g. the above references
should be, instead of just "synopsis":
parport-lowlevel / parport_register_driver - register a device driver with parport / synopsis
parport-lowlevel / parport_unregister_driver - tell parport to forget about this driver / synopsis
Thanks,
Mauro
next prev parent reply other threads:[~2020-03-20 10:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 11:53 [PATCH] doc: fix reference to core-api/namespaces.rst Federico Vaga
2019-11-22 17:34 ` Jonathan Corbet
2019-11-24 17:02 ` Federico Vaga
2020-03-20 10:21 ` Mauro Carvalho Chehab [this message]
2020-03-20 11:12 ` [PATCH] docs: conf.py: avoid thousands of duplicate label warning on Sphinx Mauro Carvalho Chehab
2020-03-20 11:24 ` Federico Vaga
2020-03-20 11:59 ` Mauro Carvalho Chehab
2020-03-20 13:22 ` 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=20200320112122.48244ec4@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=federico.vaga@vaga.pv.it \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.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).