Skip to content

Commit 4ba8943

Browse files
authored
remove deprecated configs and associated code/tests (#1698)
deprecations
1 parent 17dba55 commit 4ba8943

File tree

10 files changed

+4
-159
lines changed

10 files changed

+4
-159
lines changed

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@
188188
"json_url": json_url,
189189
"version_match": version_match,
190190
},
191-
"navigation_with_keys": False,
192191
# "back_to_top_button": False,
193-
# "search_bar_position": "navbar", # TODO: Deprecated - remove in future version
194192
}
195193

196194
html_sidebars = {

docs/user_guide/branding.rst

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -142,48 +142,6 @@ this assumption by supplying both ``text`` and ``alt_text``).
142142
Add favicons
143143
============
144144

145-
.. deprecated:: 0.15
146-
147-
Support for complex and multiple favicons will be dropped in version 0.15. Instead, use the `sphinx-favicon <https://sphinx-favicon.readthedocs.io/en/stable/>`__ extension.
148-
It provides the same functionality using more flexible parameters.
149-
150-
151145
``pydata_sphinx_theme`` supports the `standard sphinx favicon configuration <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_favicon>`_, using ``html_favicon``.
152-
153-
Additionally, you may add any number of browser- or device-specific favicons of any size.
154-
To do so, use the ``html_theme_options["favicons"]`` configuration key.
155-
The only required argument is ``href``, which can be either an absolute URL (beginning with ``http``) or a local path relative to your ``html_static_path``.
156-
In addition, you may specify a size with ``sizes``, specify a ``rel`` value, and specify a ``color``.
157-
See `this blog post on SVG favicons for more information <https://medium.com/swlh/are-you-using-svg-favicons-yet-a-guide-for-modern-browsers-836a6aace3df>`_.
158-
159-
For example, below we define three extra favicons of different sizes and ``rel`` types, and one with a specific color.
160-
161-
.. code-block:: python
162-
163-
html_theme_options = {
164-
"favicons": [
165-
{
166-
"rel": "icon",
167-
"sizes": "16x16",
168-
"href": "https://secure.example.com/favicon/favicon-16x16.png",
169-
},
170-
{
171-
"rel": "icon",
172-
"sizes": "32x32",
173-
"href": "favicon-32x32.png",
174-
},
175-
{
176-
"rel": "apple-touch-icon",
177-
"sizes": "180x180",
178-
"href": "apple-touch-icon-180x180.png",
179-
"color": "#000000",
180-
},
181-
]
182-
}
183-
184-
``pydata_sphinx_theme`` will add ``link`` tags to your document's ``head``
185-
section, following this pattern:
186-
187-
.. code-block:: html+jinja
188-
189-
<link rel="{{ favicon.rel }}" sizes="{{ favicon.sizes }}" href="{{ favicon.href }}" color="{{ favicon.color }}">
146+
Support for complex and multiple favicons was dropped in version 0.15.3. Instead, use the `sphinx-favicon <https://sphinx-favicon.readthedocs.io/en/stable/>`__ extension.
147+
It provides the same functionality using more flexible parameters.

src/pydata_sphinx_theme/__init__.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,6 @@ def update_config(app):
2525
theme_options = utils.get_theme_options_dict(app)
2626
warning = partial(utils.maybe_warn, app)
2727

28-
# TODO: deprecation; remove after 0.14 release
29-
if theme_options.get("logo_text"):
30-
logo = theme_options.get("logo", {})
31-
logo["text"] = theme_options.get("logo_text")
32-
theme_options["logo"] = logo
33-
warning(
34-
"The configuration `logo_text` is deprecated. Use `'logo': {'text': }`."
35-
)
36-
37-
# TODO: DEPRECATE after 0.14
38-
if theme_options.get("footer_items"):
39-
theme_options["footer_start"] = theme_options.get("footer_items")
40-
warning(
41-
"`footer_items` is deprecated. Use `footer_start` or `footer_end` instead."
42-
)
43-
44-
# TODO: DEPRECATE after v0.15
45-
if theme_options.get("favicons"):
46-
warning(
47-
"The configuration `favicons` is deprecated. "
48-
"Use the sphinx-favicon extension instead."
49-
)
50-
51-
# TODO: in 0.15, set the default navigation_with_keys value to False and remove this deprecation notice
52-
if theme_options.get("navigation_with_keys", None) is None:
53-
warning(
54-
"The default value for `navigation_with_keys` will change to `False` in "
55-
"the next release. If you wish to preserve the old behavior for your site, "
56-
"set `navigation_with_keys=True` in the `html_theme_options` dict in your "
57-
"`conf.py` file. Be aware that `navigation_with_keys = True` has negative "
58-
"accessibility implications: "
59-
"https://github.com/pydata/pydata-sphinx-theme/issues/1492"
60-
)
61-
theme_options["navigation_with_keys"] = False
62-
6328
# Validate icon links
6429
if not isinstance(theme_options.get("icon_links", []), list):
6530
raise ExtensionError(
@@ -228,18 +193,6 @@ def update_and_remove_templates(
228193
if asset_path == theme_css_name:
229194
del context["css_files"][i]
230195
break
231-
# Add links for favicons in the topbar
232-
for favicon in context.get("theme_favicons", []):
233-
icon_type = Path(favicon["href"]).suffix.strip(".")
234-
opts = {
235-
"rel": favicon.get("rel", "icon"),
236-
"sizes": favicon.get("sizes", "16x16"),
237-
"type": f"image/{icon_type}",
238-
}
239-
if "color" in favicon:
240-
opts["color"] = favicon["color"]
241-
# Sphinx will auto-resolve href if it's a local file
242-
app.add_css_file(favicon["href"], **opts)
243196

244197
# Add metadata to DOCUMENTATION_OPTIONS so that we can re-use later
245198
# Pagename to current page

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ twitter_url =
1919
icon_links_label = Icon Links
2020
icon_links =
2121
analytics =
22-
favicons =
2322
show_prev_next = True
2423
search_bar_text = Search the docs ...
25-
search_bar_position = sidebar
26-
navigation_with_keys =
24+
navigation_with_keys = False
2725
collapse_navigation = False
2826
navigation_depth = 4
2927
show_nav_level = 1
@@ -55,6 +53,3 @@ footer_end = theme-version
5553
secondary_sidebar_items = page-toc, edit-this-page, sourcelink
5654
show_version_warning_banner = False
5755
announcement =
58-
59-
# DEPRECATE after 0.14
60-
footer_items =

tests/sites/base/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@
2020
html_sourcelink_suffix = ""
2121

2222
# Base options, we can add other key/vals later
23-
html_theme_options = {"navigation_with_keys": False}
24-
2523
html_sidebars = {"section1/index": ["sidebar-nav-bs.html"]}

tests/sites/deprecated/conf.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,7 @@
2121

2222
# Base options, we can add other key/vals later
2323
html_theme_options = {
24-
"search_bar_position": "navbar",
2524
"surface_warnings": True,
26-
"logo_text": "DOCS",
27-
"footer_items": ["page-toc.html"],
28-
"favicons": [
29-
{
30-
"rel": "icon",
31-
"sizes": "16x16",
32-
"href": "https://secure.example.com/favicon/favicon-16x16.png",
33-
},
34-
{
35-
"rel": "icon",
36-
"sizes": "32x32",
37-
"href": "favicon-32x32.png",
38-
},
39-
{
40-
"rel": "apple-touch-icon",
41-
"sizes": "180x180",
42-
"href": "apple-touch-icon-180x180.png",
43-
},
44-
],
4525
}
4626

4727
html_sidebars = {"section1/index": ["sidebar-nav-bs.html"]}

tests/sites/sidebars/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@
1111
# -- General configuration ---------------------------------------------------
1212

1313
html_theme = "pydata_sphinx_theme"
14-
15-
html_theme_options = {"navigation_with_keys": False}

tests/sites/test_included_toc/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@
1313
# -- Options for HTML output -------------------------------------------------
1414

1515
html_theme = "pydata_sphinx_theme"
16-
17-
html_theme_options = {"navigation_with_keys": False}

tests/sites/test_navbar_no_in_page_headers/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414

1515
html_copy_source = True
1616
html_sourcelink_suffix = ""
17-
18-
html_theme_options = {"navigation_with_keys": False}

0 commit comments

Comments
 (0)