Skip to content

Commit

Permalink
docs: try using Furo
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jul 13, 2021
1 parent 6a644c8 commit c0311f4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 40 deletions.
11 changes: 0 additions & 11 deletions docs/_static/theme_overrides.css

This file was deleted.

19 changes: 2 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# ones.
extensions = [
"breathe",
"sphinx_copybutton",
"sphinxcontrib.rsvgconverter",
"sphinxcontrib.moderncmakedomain",
]
Expand Down Expand Up @@ -127,23 +128,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_context = {"css_files": ["_static/theme_overrides.css"]}
else:
html_context = {
"css_files": [
"//media.readthedocs.org/css/sphinx_rtd_theme.css",
"//media.readthedocs.org/css/readthedocs-doc-embed.css",
"_static/theme_overrides.css",
]
}
html_theme = "furo"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
9 changes: 5 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
breathe==4.26.1
sphinx==3.3.1
sphinx_rtd_theme==0.5.0
sphinxcontrib-moderncmakedomain==3.17
sphinxcontrib-svg2pdfconverter==1.1.0
furo
sphinx==3.4.3
sphinx-copybutton
sphinxcontrib-moderncmakedomain==3.19
sphinxcontrib-svg2pdfconverter==1.1.1
19 changes: 11 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ def docs(session: nox.Session) -> None:

session.install("-r", "docs/requirements.txt")
session.chdir("docs")
session.run("sphinx-build", "-M", "html", ".", "_build")

if session.posargs:
if "serve" in session.posargs:
print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
session.run("python", "-m", "http.server", "8000", "-d", "_build/html")
else:
print("Unsupported argument to docs")
if "pdf" in session.posargs:
session.run("sphinx-build", "-M", "latexpdf", ".", "_build")
return
else:
session.run("sphinx-build", "-M", "html", ".", "_build")

if "serve" in session.posargs:
print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
session.run("python", "-m", "http.server", "8000", "-d", "_build/html")
elif session.posargs:
print("Unsupported argument to docs")


@nox.session(reuse_venv=True)
Expand Down

0 comments on commit c0311f4

Please sign in to comment.