mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Increase the minimum supported version of Alabaster to 0.7.14 (#11858)
This commit is contained in:
parent
a6b0dbc5b9
commit
db9e476288
@ -67,7 +67,7 @@ dependencies = [
|
|||||||
"docutils>=0.18.1,<0.21",
|
"docutils>=0.18.1,<0.21",
|
||||||
"snowballstemmer>=2.0",
|
"snowballstemmer>=2.0",
|
||||||
"babel>=2.9",
|
"babel>=2.9",
|
||||||
"alabaster>=0.7,<0.8",
|
"alabaster~=0.7.14",
|
||||||
"imagesize>=1.3",
|
"imagesize>=1.3",
|
||||||
"requests>=2.25.0",
|
"requests>=2.25.0",
|
||||||
"packaging>=21.0",
|
"packaging>=21.0",
|
||||||
|
@ -961,22 +961,8 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
customsidebar = None
|
customsidebar = None
|
||||||
|
|
||||||
# default sidebars settings for selected theme
|
# default sidebars settings for selected theme
|
||||||
if self.theme.name == 'alabaster':
|
if theme_default_sidebars := self.theme.get_config('theme', 'sidebars', None):
|
||||||
# provide default settings for alabaster (for compatibility)
|
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
|
||||||
# Note: this will be removed before Sphinx-2.0
|
|
||||||
try:
|
|
||||||
# get default sidebars settings from alabaster (if defined)
|
|
||||||
theme_default_sidebars = self.theme.config.get('theme', 'sidebars')
|
|
||||||
if theme_default_sidebars:
|
|
||||||
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
|
|
||||||
except Exception:
|
|
||||||
# fallback to better default settings
|
|
||||||
sidebars = ['about.html', 'navigation.html', 'relations.html',
|
|
||||||
'searchbox.html', 'donate.html']
|
|
||||||
else:
|
|
||||||
theme_default_sidebars = self.theme.get_config('theme', 'sidebars', None)
|
|
||||||
if theme_default_sidebars:
|
|
||||||
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
|
|
||||||
|
|
||||||
# user sidebar settings
|
# user sidebar settings
|
||||||
html_sidebars = self.get_builder_config('sidebars', 'html')
|
html_sidebars = self.get_builder_config('sidebars', 'html')
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import alabaster
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import sphinx.builders.html
|
import sphinx.builders.html
|
||||||
@ -18,13 +17,7 @@ def test_theme_api(app, status, warning):
|
|||||||
|
|
||||||
themes = ['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
|
themes = ['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
|
||||||
'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav',
|
'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav',
|
||||||
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child']
|
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child', 'alabaster']
|
||||||
try:
|
|
||||||
alabaster_version = alabaster.__version_info__
|
|
||||||
except AttributeError:
|
|
||||||
alabaster_version = alabaster.version.__version_info__
|
|
||||||
if alabaster_version >= (0, 7, 11):
|
|
||||||
themes.append('alabaster')
|
|
||||||
|
|
||||||
# test Theme class API
|
# test Theme class API
|
||||||
assert set(app.registry.html_themes.keys()) == set(themes)
|
assert set(app.registry.html_themes.keys()) == set(themes)
|
||||||
|
Loading…
Reference in New Issue
Block a user