Skip to content

Commit 4fc00f7

Browse files
behacklpre-commit-ci[bot]jsonvillanueva
authored
Switch documentation from guzzle-sphinx-theme to furo (#1251)
* prototype: switch from guzzle-sphinx-theme to furo * try workaround for displaying navbar elements * more specific css targeting * further color adjustments * manim-example block: larger font size * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove unused import * increase font size for references * fix hover colors * html_title with explicit version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jason Villanueva <[email protected]>
1 parent cdaf501 commit 4fc00f7

File tree

9 files changed

+236
-269
lines changed

9 files changed

+236
-269
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Sphinx==3.1.2
2-
guzzle-sphinx-theme
2+
furo
33
recommonmark>=0.5.0
44
sphinx-copybutton
55
sphinxext-opengraph

docs/source/_static/custom.css

Lines changed: 30 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,29 @@
1-
td {
2-
padding: 0px 10px 0px 10px;
1+
@media (prefers-color-scheme: dark) {
2+
span.nc {
3+
text-decoration: none !important;
4+
}
35
}
46

5-
a {
6-
color: #b0604b;
7-
}
8-
9-
a:hover {
10-
color: #ad9088;
11-
}
12-
13-
p {
14-
color: #353535;
15-
}
16-
17-
dl.function {
18-
border-bottom: 1px solid #ccc;
19-
}
20-
21-
.sidebar-toc ul li a:hover {
22-
background-color: #e07a5f;
23-
}
24-
25-
.text-logo {
26-
background-color: #525893;
27-
}
28-
29-
h1 {
30-
background-color: #d7d8e6;
31-
border-bottom: 1px solid #525893;
32-
}
33-
34-
.admonition.tip {
35-
border-left-color: #87c2a5;
36-
}
37-
38-
.admonition.tip .admonition-title {
39-
color: #87c2a5;
40-
}
41-
42-
.admonition.note {
43-
border-left-color: #525893;
44-
}
45-
46-
.admonition.note .admonition-title {
47-
color: #525893;
48-
}
49-
50-
.admonition.warning {
51-
border-left-color: #e07a5f;
52-
}
53-
54-
.admonition.warning .admonition-title {
55-
color: #e07a5f;
56-
}
57-
58-
img.align-center {
59-
width: 100%;
60-
margin-bottom: 20px;
61-
margin-top: 20px;
62-
}
63-
64-
img {
65-
display: block;
66-
max-width: 100%;
67-
height: auto;
68-
}
69-
70-
div.highlight {
71-
background-color: #fafafa;
72-
margin: 8px 0;
73-
}
74-
75-
div.highlight pre {
76-
background-color: inherit;
77-
border-color: #525893;
78-
}
79-
80-
div.seealso {
81-
background-color: #d9edf7;
82-
border: 1px solid #525893;
7+
.admonition-manim-example {
8+
padding: 0;
9+
display: flex;
10+
flex-direction: column;
8311
}
8412

85-
.footer-relations a.btn.btn-default {
86-
display: flex;
87-
align-items: center;
88-
background-image: none;
89-
color: #b0604b;
90-
border-color: #b0604b;
13+
.admonition-manim-example p.admonition-title {
14+
margin: 0;
9115
}
9216

93-
.footer-relations .pull-left a.btn.btn-default::before {
94-
font-family: 'Glyphicons Halflings';
95-
content: "\e079";
96-
margin-right: 4px;
97-
margin-left: -2px;
17+
.admonition-manim-example .highlight-python {
18+
margin: 0;
9819
}
9920

100-
.footer-relations .pull-right a.btn.btn-default::after {
101-
font-family: 'Glyphicons Halflings';
102-
content: "\e080";
103-
margin-left: 4px;
104-
margin-right: -2px;
21+
.admonition-manim-example .highlight {
22+
border-radius: 0;
10523
}
10624

107-
.footer-relations a.btn.btn-default:hover {
108-
background-image: none;
109-
background-color: #b0604b;
110-
color: #fff;
111-
border-color: #b0604b;
112-
transition: all 0.3s ease;
113-
text-shadow: none;
25+
.admonition-manim-example .highlight pre {
26+
font-size: 15px;
11427
}
11528

11629
.manim-video {
@@ -119,68 +32,31 @@ div.seealso {
11932
outline: 0;
12033
}
12134

122-
.manim-example {
123-
background-color: #525893;
124-
margin-bottom: 50px;
125-
box-shadow: 2px 2px 4px #ddd;
126-
}
127-
128-
.manim-example .manim-video {
35+
.admonition-manim-example .manim-video {
12936
padding: 0;
13037
}
13138

132-
.manim-example img {
39+
.admonition-manim-example img {
13340
margin-bottom: 0;
13441
}
13542

136-
h5.example-header {
137-
font-size: 18px;
138-
font-weight: bold;
139-
padding: 8px 16px;
140-
color: white;
141-
margin: 0;
142-
font-family: inherit;
143-
}
144-
145-
.manim-example .highlight {
146-
background-color: #fafafa;
147-
border: 2px solid #525893;
148-
padding: 8px 8px 16px 8px;
149-
margin: 0;
150-
}
151-
152-
.manim-example .highlight pre {
153-
background-color: inherit;
154-
border-left: none;
155-
margin: 0;
156-
padding: 0 6px 0 6px;
157-
}
158-
159-
.manim-example .admonition {
43+
.admonition-manim-example p:last-child {
16044
margin-top: 0;
161-
padding: 12px 20px;
162-
}
163-
164-
.manim-example .admonition-title {
165-
font-size: 14px;
166-
font-weight: 500;
167-
color: white;
45+
padding-left: 0.5rem;
46+
padding-bottom: 0.15rem;
47+
font-size: 15px;
16848
}
16949

170-
.manim-example .example-reference {
171-
border: none;
172-
background-color: inherit;
173-
}
174-
175-
.manim-example .example-reference p:not(:first-child) {
176-
margin-bottom: 0;
177-
}
178-
179-
.manim-example .copybtn {
50+
.admonition-manim-example .copybtn {
18051
margin-right: 6px;
18152
font-size: 18px;
18253
}
18354

184-
.manim-example .copybtn:hover {
55+
.admonition-manim-example .copybtn:hover {
18556
cursor: pointer;
186-
}
57+
}
58+
59+
/* yikes-ish attempt at bugfix for navbar on some browsers */
60+
.sidebar-tree a.internal.reference {
61+
display: table-cell;
62+
}
Lines changed: 88 additions & 0 deletions
Loading

docs/source/conf.py

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from distutils.sysconfig import get_python_lib
1616
from pathlib import Path
1717

18-
import guzzle_sphinx_theme
18+
import manim
1919

2020
sys.path.insert(0, os.path.abspath("."))
2121

@@ -88,23 +88,42 @@
8888
# a list of builtin themes.
8989
#
9090

91-
html_theme_path = guzzle_sphinx_theme.html_theme_path()
92-
html_theme = "guzzle_sphinx_theme"
91+
html_theme = "furo"
9392
html_favicon = str(Path("_static/favicon.ico"))
9493

95-
# There's a standing issue with Sphinx's new-style sidebars. This is a
96-
# workaround. Taken from
97-
# https://github.com/guzzle/guzzle_sphinx_theme/issues/33#issuecomment-637081826
98-
html_sidebars = {"**": ["logo-text.html", "globaltoc.html", "searchbox.html"]}
99-
100-
# Register the theme as an extension to generate a sitemap.xml
101-
extensions.append("guzzle_sphinx_theme")
102-
10394
# Add any paths that contain custom static files (such as style sheets) here,
10495
# relative to this directory. They are copied after the builtin static files,
10596
# so a file named "default.css" will overwrite the builtin "default.css".
10697
html_static_path = ["_static"]
10798

99+
html_theme_options = {
100+
"light_logo": "manim-logo-sidebar.svg",
101+
"dark_logo": "manim-logo-sidebar-dark.svg",
102+
"light_css_variables": {
103+
"color-content-foreground": "#413c3c",
104+
"color-background-primary": "#f1ece9",
105+
"color-background-border": "#ded6d4",
106+
"color-sidebar-background": "#ece6e2",
107+
"color-brand-content": "#2196f3",
108+
"color-brand-primary": "#525893",
109+
"color-link": "#e07a5f",
110+
"color-link--hover": "#a05744",
111+
"color-inline-code-background": "#f9f9f9",
112+
},
113+
"dark_css_variables": {
114+
"color-content-foreground": "#ffffffd9",
115+
"color-background-primary": "#131416",
116+
"color-background-border": "#303335",
117+
"color-sidebar-background": "#1a1c1e",
118+
"color-brand-content": "#2196f3",
119+
"color-brand-primary": "#87c2a5",
120+
"color-link": "#e07a5f",
121+
"color-link--hover": "#ffb7a4",
122+
"color-inline-code-background": "#383838",
123+
},
124+
}
125+
html_title = f"Manim Community v{manim.__version__}"
126+
108127
# This specifies any additional css files that will override the theme's
109128
html_css_files = ["custom.css"]
110129

docs/source/examples.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Enjoy this taste of Manim!
2424
*manimations*!
2525

2626

27-
.. contents:: Overview of thematic video categories
28-
:backlinks: none
29-
:local:
30-
3127

3228
Basic Concepts
3329
==============

0 commit comments

Comments
 (0)