Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Use unique variable names in documentation and configuration #139

Open
@agjohnson

Description

@agjohnson

We are currently suggesting the following configuration:

# https://docs.readthedocs.io/page/reference/environment-variables.html
project = os.environ["READTHEDOCS_PROJECT"]
version = os.environ["READTHEDOCS_VERSION"]

# Include results from subprojects by default.
rtd_sphinx_search_default_filter = f"subprojects:{project}/{version}"

But these variables collide with the Sphinx configuration variables project and version, which aren't always the project/version slug -- they can be a verbose name established by the documentation author.

We should prefix our variables in documentation to make them unique, but it also looks like the default configuration uses project directly, which will have side effects if the project name is not the RTD slug.

https://github.com/readthedocs/readthedocs-sphinx-search/blob/main/docs/configuration.rst?plain=1#L25

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImprovementMinor improvement to code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions