From c0311f4311c8fe3bef7a11bd4ea3b4e55b33a94b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 13 Jul 2021 14:30:47 -0400 Subject: [PATCH] docs: try using Furo --- docs/_static/theme_overrides.css | 11 ----------- docs/conf.py | 19 ++----------------- docs/requirements.txt | 9 +++++---- noxfile.py | 19 +++++++++++-------- 4 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 docs/_static/theme_overrides.css diff --git a/docs/_static/theme_overrides.css b/docs/_static/theme_overrides.css deleted file mode 100644 index 1071809fa0f..00000000000 --- a/docs/_static/theme_overrides.css +++ /dev/null @@ -1,11 +0,0 @@ -.wy-table-responsive table td, -.wy-table-responsive table th { - white-space: initial !important; -} -.rst-content table.docutils td { - vertical-align: top !important; -} -div[class^='highlight'] pre { - white-space: pre; - white-space: pre-wrap; -} diff --git a/docs/conf.py b/docs/conf.py index 6ac054c6b88..e3decd25f64 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,7 @@ # ones. extensions = [ "breathe", + "sphinx_copybutton", "sphinxcontrib.rsvgconverter", "sphinxcontrib.moderncmakedomain", ] @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 671dc4b3f32..f200e2c34b4 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/noxfile.py b/noxfile.py index 3bc61273ffc..d16c582771c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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)