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

Use unique variable names in documentation and configuration #139

Open
agjohnson opened this issue Jun 22, 2023 · 0 comments
Open

Use unique variable names in documentation and configuration #139

agjohnson opened this issue Jun 22, 2023 · 0 comments
Labels
Improvement Minor improvement to code

Comments

@agjohnson
Copy link

agjohnson commented Jun 22, 2023

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

@agjohnson agjohnson added the Improvement Minor improvement to code label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

1 participant