Skip to content

Commit 6b60d97

Browse files
authored
docs: use Furo (#3109)
* docs: try using Furo * docs: darker output * docs: improve logo for dark background Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 7c3a031 commit 6b60d97

File tree

6 files changed

+15
-33
lines changed

6 files changed

+15
-33
lines changed

docs/_static/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.highlight .go {
2+
color: #707070;
3+
}

docs/_static/theme_overrides.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/conf.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# ones.
3636
extensions = [
3737
"breathe",
38+
"sphinx_copybutton",
3839
"sphinxcontrib.rsvgconverter",
3940
"sphinxcontrib.moderncmakedomain",
4041
]
@@ -125,23 +126,7 @@
125126
# The theme to use for HTML and HTML Help pages. See the documentation for
126127
# a list of builtin themes.
127128

128-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
129-
130-
if not on_rtd: # only import and set the theme if we're building docs locally
131-
import sphinx_rtd_theme
132-
133-
html_theme = "sphinx_rtd_theme"
134-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
135-
136-
html_context = {"css_files": ["_static/theme_overrides.css"]}
137-
else:
138-
html_context = {
139-
"css_files": [
140-
"//media.readthedocs.org/css/sphinx_rtd_theme.css",
141-
"//media.readthedocs.org/css/readthedocs-doc-embed.css",
142-
"_static/theme_overrides.css",
143-
]
144-
}
129+
html_theme = "furo"
145130

146131
# Theme options are theme-specific and customize the look and feel of a theme
147132
# further. For a list of options available for each theme, see the
@@ -172,6 +157,10 @@
172157
# so a file named "default.css" will overwrite the builtin "default.css".
173158
html_static_path = ["_static"]
174159

160+
html_css_files = [
161+
"css/custom.css",
162+
]
163+
175164
# Add any extra paths that contain custom files (such as robots.txt or
176165
# .htaccess) here, relative to this directory. These files are copied
177166
# directly to the root of the documentation.

docs/pybind11-logo.png

2.46 KB
Loading

docs/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
breathe==4.32.0
2-
sphinx==4.4.0
3-
sphinx_rtd_theme==1.0.0
1+
breathe==4.34.0
2+
furo==2022.6.21
3+
sphinx==5.0.2
4+
sphinx-copybutton==0.5.0
45
sphinxcontrib-moderncmakedomain==3.21.4
56
sphinxcontrib-svg2pdfconverter==1.2.0

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def docs(session: nox.Session) -> None:
6161
session.chdir("docs")
6262

6363
if "pdf" in session.posargs:
64-
session.run("sphinx-build", "-b", "latexpdf", ".", "_build")
64+
session.run("sphinx-build", "-M", "latexpdf", ".", "_build")
6565
return
6666

67-
session.run("sphinx-build", "-b", "html", ".", "_build")
67+
session.run("sphinx-build", "-M", "html", ".", "_build")
6868

6969
if "serve" in session.posargs:
7070
session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")

0 commit comments

Comments
 (0)