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

Add :noindexentry: option #7906

Merged
merged 2 commits into from Jul 5, 2020
Merged

Conversation

jakobandersen
Copy link
Contributor

Add the :noindexentry: option to the built-in domains and update+refactor the documentation to better describe what :noindex: and :noindexentry: does.

Feature or Bugfix

  • Feature
  • Refactoring

Purpose

See the discussion in #7052

Detail

Fixes #7052

The following rst shows the effect:

.. cpp:function:: void f()
.. cpp:function:: void g()
	:noindexentry:

.. c:function:: void f()
.. c:function:: void g()
	:noindexentry:

.. py:function:: f()
.. py:function:: g()
	:noindexentry:

.. py:class:: F
.. py:class:: G
	:noindexentry:

.. js:function:: f()
.. js:function:: g()
	:noindexentry:

@jakobandersen
Copy link
Contributor Author

(Is there a good way to make the example into a test?)

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be very nice if "versionadded" definition in docs!

@tk0miya tk0miya added this to the 3.2.0 milestone Jul 3, 2020
@tk0miya
Copy link
Member

tk0miya commented Jul 3, 2020

(Is there a good way to make the example into a test?)

For example, tests/test_domain_py.py contains some examples for checking index entries.

assert_node(doctree[0], addnodes.index,
entries=[('pair', 'built-in function; func1()', 'func1', '', None)])
assert_node(doctree[3], addnodes.index,
entries=[('pair', 'module; example', 'module-example', '', None)])
assert_node(doctree[4], addnodes.index,
entries=[('single', 'func2() (in module example)', 'example.func2', '', None)])

@jakobandersen
Copy link
Contributor Author

LGTM. It would be very nice if "versionadded" definition in docs!

Ups, indeed, should be there now.

For example, tests/test_domain_py.py contains some examples for checking index entries.

Thanks! The affected domains should have tests along this line now.

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits. There are some TAB chars. Could you expand them all?

tests/test_domain_c.py Outdated Show resolved Hide resolved
@jakobandersen jakobandersen merged commit 09e057e into sphinx-doc:3.x Jul 5, 2020
@jakobandersen jakobandersen deleted the noindexentry branch July 5, 2020 07:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
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.

:noindex: prevents cross-referencing
2 participants