Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down
25 changes: 25 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os
import sys
from datetime import date
from pathlib import Path

import yaml

Expand Down Expand Up @@ -89,6 +90,8 @@
".DS_Store",
"modules/*",
"*/README.rst",
"partials/*",
"*/partials/*",
]

# The reST default role (used for this markup: `text`) to use for all
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx~=8.0.2
sphinx~=9.1.0
sphinxawesome-theme~=6.0.2
svglib
rst2pdf
Expand Down