Skip to content

Commit 580908e

Browse files
authored
Merge pull request #527 from vcs-python/fix/theme-flicker-conf
fix(docs): restore gp-sphinx FOWT prevention
2 parents ccde355 + 8fb250d commit 580908e

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

CHANGES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ $ uv add libvcs --prerelease allow
2020
_Notes on the upcoming release will go here._
2121
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
2222

23+
### Bug fixes
24+
25+
- Fix dark-theme flash when light theme is selected — the docs
26+
`conf.py` was overriding gp-sphinx's `setup()` callback, so the
27+
inline FOWT-prevention `<script>` never landed in `<head>`. Chain
28+
the gp-sphinx setup explicitly so the script (and the
29+
`spa-nav.js` / copybutton / MyST-lexer hooks) register correctly
30+
(#527)
31+
2332
### Documentation
2433

2534
- Bump gp-sphinx docs stack to v0.0.1a16 — docs site now renders

docs/conf.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
html_extra_path=["manifest.json"],
6363
rediraffe_redirects="redirects.txt",
6464
)
65+
66+
_gp_setup = conf.pop("setup")
6567
globals().update(conf)
6668

6769

@@ -91,5 +93,14 @@ def _on_missing_class_reference(
9193

9294

9395
def setup(app: Sphinx) -> None:
94-
"""Connect missing-reference handler to resolve py:data as :class: links."""
96+
"""Chain gp-sphinx setup() and connect the missing-reference handler.
97+
98+
``_gp_setup`` is the callback ``gp_sphinx.config.merge_sphinx_config``
99+
returns; it registers the FOWT-prevention head injection,
100+
``spa-nav.js``, the copy-button bridge, the ``remove_tabs_js``
101+
cleanup, and the MyST Pygments lexers. Without this chain those
102+
hooks never register and the docs site flashes the wrong theme
103+
before settling on the user's preference.
104+
"""
105+
_gp_setup(app)
95106
app.connect("missing-reference", _on_missing_class_reference)

0 commit comments

Comments
 (0)