Skip to content

Documentation Search Index: use no-index to avoid duplication issue #145

@mariajgrimaldi

Description

@mariajgrimaldi

Description

API classes from openedx_authz.api modules are not included in the Sphinx search index, making them undiscoverable via the documentation search functionality. This to avoid warnings breaking the docs build.

The openedx_authz.api package re-exports all members from its submodules via from openedx_authz.api.data import * (and similar for other submodules). This causes Sphinx to find the same classes in multiple locations, generating duplicate object description warnings:

/home/mgmdy/Work/Envs/Local/nightly/openedx-authz/openedx_authz/api/data.py:docstring of openedx_authz.api.data.ActionData.NAMESPACE:1: WARNING: duplicate object description of openedx_authz.api.data.ActionData.NAMESPACE, other instance in openedx_authz.api, use :no-index: for one of them

The current workaround uses :no-index: on all automodule directives (via SPHINX_APIDOC_OPTIONS in docs/conf.py). While this eliminates the warnings, it also prevents classes from being added to the search index.

Impact

  • ✓ Documentation builds without warnings
  • ✓ Classes are documented and visible in HTML pages
  • ✗ Classes cannot be found using documentation search

Recommended Solution

Selectively apply :no-index: only to submodule sections, not to the main openedx_authz.api module, to allow classes to be indexed while avoiding duplicate warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions