diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css new file mode 100644 index 000000000..7a49a6ac4 --- /dev/null +++ b/docs/_static/css/custom.css @@ -0,0 +1,3 @@ +.highlight .go { + color: #707070; +} diff --git a/docs/_static/theme_overrides.css b/docs/_static/theme_overrides.css deleted file mode 100644 index 1071809fa..000000000 --- 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 00796fbdb..2da6773f4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,6 +35,7 @@ DIR = Path(__file__).parent.resolve() # ones. extensions = [ "breathe", + "sphinx_copybutton", "sphinxcontrib.rsvgconverter", "sphinxcontrib.moderncmakedomain", ] @@ -125,23 +126,7 @@ todo_include_todos = False # 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 @@ -172,6 +157,10 @@ else: # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] +html_css_files = [ + "css/custom.css", +] + # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. diff --git a/docs/pybind11-logo.png b/docs/pybind11-logo.png index 4cbad54f7..2d633a4d0 100644 Binary files a/docs/pybind11-logo.png and b/docs/pybind11-logo.png differ diff --git a/docs/requirements.txt b/docs/requirements.txt index e452ed261..d2a9ae164 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,6 @@ -breathe==4.32.0 -sphinx==4.4.0 -sphinx_rtd_theme==1.0.0 +breathe==4.34.0 +furo==2022.6.21 +sphinx==5.0.2 +sphinx-copybutton==0.5.0 sphinxcontrib-moderncmakedomain==3.21.4 sphinxcontrib-svg2pdfconverter==1.2.0 diff --git a/noxfile.py b/noxfile.py index 341d964e9..fe36d70fe 100644 --- a/noxfile.py +++ b/noxfile.py @@ -61,10 +61,10 @@ def docs(session: nox.Session) -> None: session.chdir("docs") if "pdf" in session.posargs: - session.run("sphinx-build", "-b", "latexpdf", ".", "_build") + session.run("sphinx-build", "-M", "latexpdf", ".", "_build") return - session.run("sphinx-build", "-b", "html", ".", "_build") + session.run("sphinx-build", "-M", "html", ".", "_build") if "serve" in session.posargs: session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")