API Reference¶
Config reference¶
Generated from add_config_value()
registrations in
gp_furo_theme/__init__.py.
Theme helpers¶
-
gp_furo_theme.get_theme_path()¶gp_furo_theme.get_theme_path()¶
Return the absolute path to the bundled
gp-furotheme directory.- Returns:
Directory containing
theme.confand the ported Jinja templates + Vite-built assets.- Return type:
Examples
>>> theme_path = get_theme_path() >>> (theme_path / "theme.conf").exists() True
-
gp_furo_theme.setup(app)¶gp_furo_theme.setup(app)¶
Register the
gp-furotheme with Sphinx.Examples
>>> class FakeApp: ... def __init__(self) -> None: ... self.themes: list[tuple[str, pathlib.Path]] = [] ... self.post_transforms: list[type] = [] ... self.events: list[str] = [] ... self.config_values: list[str] = [] ... def require_sphinx(self, version: str) -> None: ... pass ... def add_config_value(self, name: str, **kwargs: object) -> None: ... self.config_values.append(name) ... def add_html_theme(self, name: str, theme_path: pathlib.Path) -> None: ... self.themes.append((name, theme_path)) ... def add_post_transform(self, transform: type) -> None: ... self.post_transforms.append(transform) ... def connect(self, event: str, callback: object) -> None: ... self.events.append(event) >>> fake = FakeApp() >>> metadata = setup(fake) # type: ignore[arg-type] >>> fake.themes[0][0] 'gp-furo' >>> "pygments_dark_style" in fake.config_values True >>> sorted(fake.events) ['build-finished', 'builder-inited', 'html-page-context'] >>> metadata["parallel_read_safe"] True
Modify the given navigation tree, with furo-specific elements.
Adds a checkbox + corresponding label to <li>s that contain a <ul> tag, to enable the I-spent-too-much-time-making-this-CSS-only collapsing sidebar tree.