Skip to content

Commit

Permalink
Sphinx: don't override html_context by default (#10394)
Browse files Browse the repository at this point in the history
We have this feature enabled on .org and .com,
we haven't heard any complaints.

Closes #10293
  • Loading branch information
stsewd authored Jun 6, 2023
1 parent 6f21017 commit 542115d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
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 %}
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

0 comments on commit 542115d

Please sign in to comment.