Examples¶
Live demos¶
Every variant rendered by the real build_badge / build_badge_group /
build_toolbar API:
No icon
label build_badge("label")
With icon — left (default, gp-sphinx-badge[data-icon])
readonly mutating build_badge("readonly", icon="🔍")
With icon — right (gp-sphinx-badge–icon-right)
build_badge("readonly", icon="🔍", classes=[SAB.ICON_RIGHT])
Icon-only — 16x16 coloured box (gp-sphinx-badge–icon-only)
build_badge("", style="icon-only", icon="🔍")
Inline-icon — bare emoji inside code chip (gp-sphinx-badge–inline-icon)
some_function() other_func() build_badge("", style="inline-icon", icon="✏️")
Outline (gp-sphinx-badge–outline)
outline outline + icon build_badge("outline", fill="outline")
Dense (gp-sphinx-badge–dense) — compact bordered, dotted underline
dense dense + icon left SAB.DENSE + icon variants
Dense + outline
dense outline dense outline + icon left SAB.DENSE + outline
Underline control modifiers
dense default no underline solid dotted (opt-in) solid (opt-in) SAB.NO_UNDERLINE / SAB.UNDERLINE_SOLID / SAB.UNDERLINE_DOTTED
All sizes — standard pill
xxs xxs+icon xs xs+icon sm sm+icon md md+icon default default+icon lg lg+icon xl xl+icon xxs / xs / sm / md / default / lg / xl
All sizes — dense
xxs xxs+icon xs xs+icon sm sm+icon md md+icon default default+icon lg lg+icon xl xl+icon xxs / xs / sm / md / default / lg / xl (gp-sphinx-badge--dense)
Icon positions — standard (no icon / left / right / icon-only)
function function function: none / left / right / icon-only
fixture fixture fixture: none / left / right / icon-only
config config config: none / left / right / icon-only
directive directive directive: none / left / right / icon-only
Icon positions — dense
function function function (dense): none / left / right
fixture fixture fixture (dense): none / left / right
config config config (dense): none / left / right
directive directive directive (dense): none / left / right
Badge group
alpha beta gamma build_badge_group([...badges...])
Toolbar (push-right in flex heading)
build_toolbar(build_badge_group([...]))
Python API types (gp-sphinx-badge–type-*)
function class method property attribute data exception type alias module
Python API types — dense variant (gp-sphinx-badge–dense)
function class method property attribute data exception type alias module
Python API modifiers (gp-sphinx-badge–mod-*, outlined)
async classmethod staticmethod abstract final
Python API modifiers — dense variant
async classmethod staticmethod abstract final
pytest fixture types (gp-sphinx-badge–type-fixture)
fixture SAB.TYPE_FIXTURE — standard
fixture SAB.TYPE_FIXTURE — dense
pytest fixture scopes (gp-sphinx-badge–scope-*)
session module class
session module class
pytest fixture kinds / states (outlined)
factory override auto deprecated
factory override auto deprecated
Sphinx config (gp-sphinx-badge–type-config / gp-sphinx-badge–mod-rebuild)
config env html standard
config env html dense
docutils (gp-sphinx-badge–type-directive / role / option)
directive role option standard
directive role option dense
Package metadata — maturity
gp-sphinx-badge--meta-alpha / gp-sphinx-badge--meta-beta (filled)
Package metadata — link badges (outline)
GitHub PyPI _link_badge(label, url) — gp-sphinx-badge gp-sphinx-badge--outline gp-sphinx-badge--meta-link <a>
Package metadata — full header row