File tree Expand file tree Collapse file tree 6 files changed +32
-7
lines changed Expand file tree Collapse file tree 6 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 44
44
html_theme = "mpl_sphinx_theme"
45
45
html_favicon = "_static/favicon.ico"
46
46
html_theme_options = {
47
- "logo" : {"link" : "https://matplotlib.org/stable/" ,
48
- "image_light" : "images/logo2.svg" ,
49
- "image_dark" : "images/logo_dark.svg" },
47
+ # logo is installed by mpl-sphinx-theme as:
48
+ # "logo": {"link": "https://matplotlib.org/stable/",
49
+ # "image_light": "_static/logo2.svg",
50
+ # "image_dark": "_static/logo_dark.svg"},
51
+ # if this default is OK, then no need to modify "logo"
50
52
# collapse_navigation in pydata-sphinx-theme is slow, so skipped for local
51
53
# and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
52
54
"collapse_navigation" : not is_release_build ,
62
64
# Add any paths that contain custom static files (such as style sheets) here,
63
65
# relative to this directory. They are copied after the builtin static files,
64
66
# so a file named "default.css" will overwrite the builtin "default.css".
65
- # html_static_path = ["static "]
67
+ # html_static_path = ["_static "]
Original file line number Diff line number Diff line change 1
- pydata-sphinx-theme >= 0.10.0
1
+ pydata-sphinx-theme >= 0.13.1
2
2
matplotlib
Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
5
5
6
+ def set_config_defaults (app ):
7
+
8
+ try :
9
+ theme = app .builder .theme_options
10
+ except AttributeError :
11
+ theme = None
12
+ if not theme :
13
+ theme = {}
14
+
15
+ # Default logo
16
+ logo = theme .get ("logo" , {})
17
+ if "image_dark" not in logo :
18
+ logo ["image_dark" ] = "_static/logo_dark.svg"
19
+ if "image_light" not in logo :
20
+ logo ["image_light" ] = "_static/logo2.svg"
21
+ if "link" not in logo :
22
+ logo ["link" ] = "https://matplotlib.org/stable/"
23
+ theme ["logo" ] = logo
24
+
25
+ # Update the HTML theme config
26
+ app .builder .theme_options = theme
27
+
28
+
6
29
def get_html_theme_path ():
7
30
"""Return list of HTML theme paths."""
8
31
return [str (Path (__file__ ).parent .parent .resolve ())]
@@ -34,7 +57,7 @@ def setup(app):
34
57
here = Path (__file__ ).parent .resolve ()
35
58
# Include component templates
36
59
app .config .templates_path .append (str (here / "components" ))
37
-
38
60
app .add_html_theme ("mpl_sphinx_theme" , str (here ))
61
+ app .connect ("builder-inited" , set_config_defaults )
39
62
app .connect ("html-page-context" , setup_html_page_context )
40
63
return {'version' : __version__ , 'parallel_read_safe' : True }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
- pydata-sphinx-theme >= 0.11.0
1
+ pydata-sphinx-theme >= 0.13.1
2
2
matplotlib
You can’t perform that action at this time.
0 commit comments