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

[Feature] Removal of Sphinx context injection at build time #1860

Open
laurensvalk opened this issue Oct 1, 2024 · 0 comments
Open

[Feature] Removal of Sphinx context injection at build time #1860

laurensvalk opened this issue Oct 1, 2024 · 0 comments
Labels
devops Issues related to continuous integration and distribution of software. documentation Improvements or additions to documentation enhancement New feature or request

Comments

@laurensvalk
Copy link
Member

Is your feature request related to a problem? Please describe.

Hello, We are announcing the deprecation of Sphinx context injection at build time for all the projects. The deprecation date is set on Monday, October 7th, 2024. After this date, Read the Docs won't install the readthedocs-sphinx-ext extension and won't manipulate the project's conf.py file.

Originally posted by ReadTheDocs

Describe the solution you'd like

You have at least one project with a canonical custom domain defined. After the deprecation date, Read the Docs will stop defining html_baseurl Sphinx configuration, which means that you will need to define it by yourself to keep the canonical custom domain properly configured.

You can use the following Python snippet as a guide to update your conf.py file. The snippet uses the READTHEDOCS_CANONICAL_URL environment variable to define html_baseurl and injects READTHEDOCS variable into the html_context to keep the previous behavior:

import os

# Set canonical URL from the Read the Docs Domain
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
    html_context["READTHEDOCS"] = True
@laurensvalk laurensvalk added documentation Improvements or additions to documentation enhancement New feature or request devops Issues related to continuous integration and distribution of software. labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Issues related to continuous integration and distribution of software. documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant