API Reference

Config reference

Generated from add_config_value() registrations in gp_furo_theme/__init__.py.

pygments_dark_style
config env
config env
pygments_dark_style
Type:

str

Default:

'native'

Registered by:

gp_furo_theme.setup()

Theme helpers

gp_furo_theme.get_theme_path()
function[source]
function[source]
gp_furo_theme.get_theme_path()

Return the absolute path to the bundled gp-furo theme directory.

Returns:

Directory containing theme.conf and the ported Jinja templates + Vite-built assets.

Return type:

pathlib.Path

Examples

>>> theme_path = get_theme_path()
>>> (theme_path / "theme.conf").exists()
True
gp_furo_theme.setup(app)
function[source]
function[source]
gp_furo_theme.setup(app)

Register the gp-furo theme with Sphinx.

Parameters:

app (Sphinx) – The Sphinx application object.

Returns:

Extension metadata: parallel_read_safe and parallel_write_safe are both True (matching upstream Furo’s guarantees), and version reports the package version.

Return type:

dict[str, bool | str]

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
gp_furo_theme.navigation.get_navigation_tree(toctree_html)
function[source]
function[source]
gp_furo_theme.navigation.get_navigation_tree(toctree_html)

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.

Parameters:

toctree_html (str)

Return type:

str