Skip to content

Conversation

@sneakers-the-rat
Copy link
Contributor

@sneakers-the-rat sneakers-the-rat commented Apr 5, 2024

Subject: Support use of :no-index-entry: at a project-level and within autodoc.

Feature or Bugfix

  • Feature

Purpose

I love the index directive, and I use it often when I am writing narrative docs. When I also have API docs, though, it quickly becomes very busy for the purpose of having an explicit, manual index: all the symbols from various objects end up there, and the manual index terms are very difficult to parse out.

no-index removes cross-references entirely, but no-index-entry does exactly what I need it to do! Unfortunately it is not supported by autodoc currently. It also is often not supported by downstream packages like sphinx-click, etc.

This PR

  • Adds a :no-index-entry: option to the autodoc directives
  • Adds a no_index_entry (default False) to global configuration options

Detail

In local testing, it seems to work as expected! Please let me know if additional documentation or testing is needed here, or if there is a better way of doing this.

@AA-Turner
Copy link
Member

AA-Turner commented Apr 9, 2024

Please could you remove the configuration variable for now? I'm not convinced of the use, and we have a dizzying array of options already.

A

@sneakers-the-rat
Copy link
Contributor Author

no problem. can it remain as part of autodoc_default_options ? that should be good enough for my purposes anyway, i'll take another test with a few external plugins to see if they're hooking into the index in any weirder ways too.

# Conflicts:
#	CHANGES.rst
#	doc/usage/extensions/autodoc.rst
#	sphinx/directives/__init__.py
#	sphinx/domains/c/__init__.py
#	sphinx/domains/cpp/__init__.py
#	sphinx/domains/python/__init__.py
#	sphinx/ext/autodoc/directive.py
@AA-Turner AA-Turner added this to the 8.2.0 milestone Jan 28, 2025
# Conflicts:
#	CHANGES.rst
#	sphinx/domains/python/__init__.py
#	tests/test_domains/test_domain_py.py
@AA-Turner AA-Turner changed the title Add no_index_entry config variable, and implement :no-index-entry: for autodoc :) Implement :no-index-entry: for autodoc Jan 28, 2025
@AA-Turner AA-Turner merged commit 18bb8bc into sphinx-doc:master Jan 28, 2025
22 checks passed
@sneakers-the-rat
Copy link
Contributor Author

Thanks for tidying this up for me!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2025
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.

2 participants