-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sphinx-build reports duplicated label #9707
Comments
The label |
hmm, but |
Sphinx scans source files from the source directory. So |
I don't think it is good solution because:
it may work but it will be a bit annoing to add a new path each time i'm adding a new chapter/topic I cannot even understand why it isn't a bug. |
This is the current design of Sphinx. Indeed, it would be nice if improved. We'll welcome your contribution :-) |
The GitHub actions macOS 11 image changed its sphinx version from 5.1.1[1] to 5.2.1[2]. This new version now issues warnings about duplicate identifiers: /Users/runner/work/fio/fio/HOWTO.rst:: WARNING: duplicate label int, other instance in /Users/runner/work/fio/fio/doc/fio_doc.rst looking for now-outdated files... none found /Users/runner/work/fio/fio/HOWTO.rst:: WARNING: duplicate label bool, other instance in /Users/runner/work/fio/fio/doc/fio_doc.rst /Users/runner/work/fio/fio/HOWTO.rst:: WARNING: duplicate label irange, other instance in /Users/runner/work/fio/fio/doc/fio_doc.rst Try to work around this issue by excluding HOWTO.rst. Related issue: sphinx-doc/sphinx#9707 [1] https://github.com/axboe/fio/actions/runs/3106980788/jobs/5034529793 [2] https://github.com/axboe/fio/actions/runs/3129974184/jobs/5079696775 Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level rST files, because Sphinx sees the labels as duplicate: sphinx-doc/sphinx#9707 So add an optional argument to the SRST directive which causes a label of the form '.. _DOCNAME-HXFILE-LABEL:' to be emitted, where 'DOCNAME' is the name of the top level rST file, 'HXFILE' is the filename of the .hx file, and 'LABEL' is the text provided within the 'SRST()' directive. Using the DOCNAME of the top-level rST document means that it is unique even when the .hx file is included from two different documents, as is the case for qemu-options.hx Now where the Xen PV documentation refers to the documentation for the -initrd command line option, it can emit a link directly to it as '<system/invocation-qemu-options-initrd>'. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20240130190348.682912-1-dwmw2@infradead.org>
We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level rST files, because Sphinx sees the labels as duplicate: sphinx-doc/sphinx#9707 So add an optional argument to the SRST directive which causes a label of the form '.. _DOCNAME-HXFILE-LABEL:' to be emitted, where 'DOCNAME' is the name of the top level rST file, 'HXFILE' is the filename of the .hx file, and 'LABEL' is the text provided within the 'SRST()' directive. Using the DOCNAME of the top-level rST document means that it is unique even when the .hx file is included from two different documents, as is the case for qemu-options.hx Now where the Xen PV documentation refers to the documentation for the -initrd command line option, it can emit a link directly to it as '<system/invocation-qemu-options-initrd>'. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240130190348.682912-1-dwmw2@infradead.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20240202153637.3710444-13-peter.maydell@linaro.org>
We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level rST files, because Sphinx sees the labels as duplicate: sphinx-doc/sphinx#9707 So add an optional argument to the SRST directive which causes a label of the form '.. _DOCNAME-HXFILE-LABEL:' to be emitted, where 'DOCNAME' is the name of the top level rST file, 'HXFILE' is the filename of the .hx file, and 'LABEL' is the text provided within the 'SRST()' directive. Using the DOCNAME of the top-level rST document means that it is unique even when the .hx file is included from two different documents, as is the case for qemu-options.hx Now where the Xen PV documentation refers to the documentation for the -initrd command line option, it can emit a link directly to it as '<system/invocation-qemu-options-initrd>'. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240130190348.682912-1-dwmw2@infradead.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Describe the bug
I'm getting the following warnings in my project :
/home/user/git/fizyka/assets/dzial_1/temat_3/intro.rst:34: WARNING: duplicate label of equation V, other instance in assets/dzial_1/index
How to Reproduce
you'll see warnings
Expected behavior
warning about duplicated label shouldn't appear because the label isn't duplicated
Your project
https://github.com/gucio321/fizyka
Screenshots
No response
OS
linux - fedora 34
Python version
Python 3.9.7
Sphinx version
4.2.0
Sphinx extensions
extensions = [ "sphinx.ext.githubpages", "sphinxcontrib.images", "myst_parser", "cloud_sptheme.ext.issue_tracker" ]
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: