Skip to content
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

Allow :ref: role to be used with definitions and fields #10781

Merged
merged 1 commit into from Sep 6, 2022

Conversation

jbms
Copy link
Contributor

@jbms jbms commented Aug 19, 2022

Feature or Bugfix

  • Feature

Purpose

Since these nodes have a natural title, there is no reason not to
support the :ref: role.

@jbms jbms force-pushed the field-and-term-ref-title branch 3 times, most recently from 431f682 to 9aa6f43 Compare August 22, 2022 21:18
@jbms jbms changed the title Add :ref: role to be used with definitions and fields Allow :ref: role to be used with definitions and fields Sep 1, 2022
@jbms
Copy link
Contributor Author

jbms commented Sep 1, 2022

@AA-Turner Do you think you might have chance to review this?

@AA-Turner
Copy link
Member

Please add a CHANGES entry, I will review shortly.

A

@AA-Turner AA-Turner self-requested a review September 1, 2022 20:22
@AA-Turner AA-Turner added this to the 5.2.0 milestone Sep 1, 2022
Since these nodes have a natural title, there is no reason not to
support the :ref: role.
@jbms
Copy link
Contributor Author

jbms commented Sep 1, 2022

Please add a CHANGES entry, I will review shortly.

A

Done.

@AA-Turner AA-Turner changed the title Allow :ref: role to be used with definitions and fields Allow :ref: role to be used with definitions and fields Sep 6, 2022
@AA-Turner AA-Turner merged commit 4cd950e into sphinx-doc:5.x Sep 6, 2022
@AA-Turner
Copy link
Member

Thanks!

A

@vincentkfu
Copy link

I believe this patch triggers duplicate label warnings that were not present before this patch was merged.

With 5.1.1 our docs built with no warnings: https://github.com/axboe/fio/actions/runs/3106980788/jobs/5034529793
But with 5.2.1 we now see warnings: https://github.com/axboe/fio/actions/runs/3129974184/jobs/5079696775

/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

We have fio_doc.rst and fio_man.rst both include ../HOWTO.rst which defines the labels int, bool, and irange.

Is there a work-around to eliminate the warnings?

@AA-Turner
Copy link
Member

@vincentkfu please open a new issue with a minimal reproducer (ideally a single .rst source file if possible) and tag me and Jeremy.

A

@jbms jbms deleted the field-and-term-ref-title branch September 26, 2022 20:48
@jbms
Copy link
Contributor Author

jbms commented Sep 26, 2022

I think the best solution would be to restructure your documentation to avoid defining duplicate labels. Even before this patch, you still had duplicate labels, there was just no warning.

Potentially you could just suppress the warning, e.g. using the suppress_warnings config option.

I don't know if it was intentional that Sphinx does not warn on duplicate labels without titles, or if that was just accidental.

vincentkfu added a commit to vincentkfu/fio that referenced this pull request Sep 27, 2022
Sphinx prints warnings when it encounters duplicate labels. In HOWTO.rst
are labels for int, irange, and bool. We include HOWTO.rst in both
fio_doc.rst and fio_man.rst. Since labels must be unique across all
files, Sphinx prints warnings for these labels.

For an unknown reason, Sphinx previously did not issue warnings for the
duplicate labels mentioned above until 5.2.0. But Sphinx 5.2.1 is now
installed for the macOS 11 image in GitHub Actions. So now we see Sphinx
warnings when building documentation in GitHub Actions.

Our CI treats Sphinx warnings as test failures. So our macOS builds are
marked as failures.

Resolve this problem by eliminating the separate fio_man.rst file and
just building the manpage from the largely equivalent fio_doc.rst.

Successful build with 5.1.1: https://github.com/axboe/fio/actions/runs/3106980788/jobs/5034529793
Failed build with 5.2.1: https://github.com/axboe/fio/actions/runs/3129974184/jobs/5079696775

Link: sphinx-doc/sphinx#10781
Link: sphinx-doc/sphinx#10870
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
axboe pushed a commit to axboe/fio that referenced this pull request Sep 27, 2022
Sphinx prints warnings when it encounters duplicate labels. In HOWTO.rst
are labels for int, irange, and bool. We include HOWTO.rst in both
fio_doc.rst and fio_man.rst. Since labels must be unique across all
files, Sphinx prints warnings for these labels.

For an unknown reason, Sphinx previously did not issue warnings for the
duplicate labels mentioned above until 5.2.0. But Sphinx 5.2.1 is now
installed for the macOS 11 image in GitHub Actions. So now we see Sphinx
warnings when building documentation in GitHub Actions.

Our CI treats Sphinx warnings as test failures. So our macOS builds are
marked as failures.

Resolve this problem by eliminating the separate fio_man.rst file and
just building the manpage from the largely equivalent fio_doc.rst.

Successful build with 5.1.1: https://github.com/axboe/fio/actions/runs/3106980788/jobs/5034529793
Failed build with 5.2.1: https://github.com/axboe/fio/actions/runs/3129974184/jobs/5079696775

Link: sphinx-doc/sphinx#10781
Link: sphinx-doc/sphinx#10870
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants