How to¶
Integration with gp-sphinx¶
sphinx_gp_opengraph ships in DEFAULT_EXTENSIONS,
so projects that build through merge_sphinx_config()
load it automatically. Passing docs_url= to that function auto-derives
three of the most common config values:
Auto-derived |
Source |
|---|---|
|
|
|
|
|
|
The canonical reference for these and the other auto-derived values
lives in From docs_url. Any value passed via **overrides to
merge_sphinx_config() wins over the auto-derived default —
auto-computation runs first, overrides apply last.
Event hooks¶
config-inited → _warn_if_social_cards_used (deprecation warning)
html-page-context → html_page_context (per-page meta-tag emission)
Both hooks live in
sphinx_gp_opengraph/__init__.py.
There is no builder-inited or build-finished work — the extension
is purely a per-page transformer.
Trade-offs¶
ogp_social_cards is accepted but ignored. The upstream extension
ships a matplotlib renderer that builds per-page PNGs at
builder-inited. sphinx-gp-opengraph deliberately omits the dependency to
keep the install graph small. The config key remains registered so
existing conf.py files do not error; setting it logs a single
WARNING at config-inited directing users to the static-image
workflow documented in the README.
parallel_read_safe and parallel_write_safe are both True.
The extension never writes shared state — every emission is
self-contained inside the per-page hook — so it is safe under any
sphinx-build -j N value.