diff --git a/_static/custom.css b/_static/custom.css index 29232e04..f51145cf 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -314,6 +314,9 @@ header.sticky > .container > .md\:flex { margin: 0; width: 100%; } +header.sticky .text-sm { + line-height: inherit; +} header.sticky nav.items-center { margin: 0 auto; } @@ -329,6 +332,11 @@ header.sticky nav.items-center a:focus { color: var(--link-hover-color); } +/* minor correction of first menu item right margin */ +header.sticky nav.items-center > a:first-child { + margin-right: 5px; +} + footer p { font-size: 0.8rem; color: var(--text-color); diff --git a/conf.py b/conf.py index 1c8fb627..6bab602c 100644 --- a/conf.py +++ b/conf.py @@ -19,6 +19,7 @@ import os import sys from datetime import date +from pathlib import Path import yaml @@ -89,6 +90,8 @@ ".DS_Store", "modules/*", "*/README.rst", + "partials/*", + "*/partials/*", ] # The reST default role (used for this markup: `text`) to use for all @@ -502,3 +505,25 @@ epub_basename = f"OpenWISP-{version}" nitpicky = True + + +def write_pygments_dark_css(app, exception): + """Write the dark Pygments stylesheet expected by Sphinx 9. + + sphinxawesome-theme appends dark styles to pygments.css, but Sphinx 9 + links pygments_dark.css separately when a dark Pygments style is set. + """ + if exception or app.builder.format != "html": + return + dark_highlighter = getattr(app.builder, "dark_highlighter", None) + if dark_highlighter is None: + return + static_dir = Path(app.outdir) / "_static" + static_dir.mkdir(exist_ok=True) + (static_dir / "pygments_dark.css").write_text( + dark_highlighter.get_stylesheet(), encoding="utf-8" + ) + + +def setup(app): + app.connect("build-finished", write_pygments_dark_css) diff --git a/requirements.txt b/requirements.txt index 4e22f084..c55b3e91 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -sphinx~=8.0.2 +sphinx~=9.1.0 sphinxawesome-theme~=6.0.2 svglib rst2pdf