Skip to content

Sphinx: don't override html_context by default #10394

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

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/user/feature-flags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Available flags
Makes Read the Docs to install all the requirements at once on ``conda create`` step.
This helps users to pin dependencies on conda and to improve build time.

``DONT_OVERWRITE_SPHINX_CONTEXT``: Do not overwrite context vars in conf.py with Read the Docs context.

``DONT_CREATE_INDEX``: Do not create index.md or README.rst if the project does not have one.

When Read the Docs detects that your project doesn't have an ``index.md`` or ``README.rst``,
Expand Down
3 changes: 0 additions & 3 deletions readthedocs/doc_builder/backends/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ def get_config_params(self):
'display_gitlab': display_gitlab,

# Features
'dont_overwrite_sphinx_context': self.project.has_feature(
Feature.DONT_OVERWRITE_SPHINX_CONTEXT,
),
"docsearch_disabled": self.project.has_feature(
Feature.DISABLE_SERVER_SIDE_SEARCH
),
Expand Down
4 changes: 0 additions & 4 deletions readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,9 @@ if version_info >= (1, 8):
{% block extra_context %}{% endblock %}

if 'html_context' in globals():
{% if dont_overwrite_sphinx_context %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to write an explicit comment here noting that we are not overriding these on purpose

for key in context:
if key not in html_context:
html_context[key] = context[key]
{% else %}
html_context.update(context)
{% endif %}
else:
html_context = context

Expand Down
7 changes: 0 additions & 7 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,6 @@ def add_features(sender, **kwargs):
# Feature constants - this is not a exhaustive list of features, features
# may be added by other packages
ALLOW_DEPRECATED_WEBHOOKS = "allow_deprecated_webhooks"
DONT_OVERWRITE_SPHINX_CONTEXT = "dont_overwrite_sphinx_context"
SKIP_SPHINX_HTML_THEME_PATH = "skip_sphinx_html_theme_path"
MKDOCS_THEME_RTD = "mkdocs_theme_rtd"
API_LARGE_DATA = "api_large_data"
Expand Down Expand Up @@ -1915,12 +1914,6 @@ def add_features(sender, **kwargs):

FEATURES = (
(ALLOW_DEPRECATED_WEBHOOKS, _("Webhook: Allow deprecated webhook views")),
(
DONT_OVERWRITE_SPHINX_CONTEXT,
_(
"Sphinx: Do not overwrite context vars in conf.py with Read the Docs context",
),
),
(
SKIP_SPHINX_HTML_THEME_PATH,
_(
Expand Down