Directives Support¶
This page documents every Sphinx and docutils directive supported by the
theme, including the HTML elements Sphinx generates and how they are
styled. The theme targets class-only selectors (not div.xxx) to
match both Sphinx 7 (<div>) and Sphinx 8+ (<aside>, <section>).
Admonitions¶
All ten standard admonition types are styled with a coloured left border, background tint, and an SVG icon in the title.
Directive |
Colour |
CSS selector |
|---|---|---|
|
Accent (orange) |
|
|
Green (success) |
|
|
Green (success) |
|
|
Accent (orange) |
|
|
Primary (navy) |
|
|
Primary (navy) |
|
|
Primary (navy) |
|
|
Red (danger) |
|
|
Red (danger) |
|
|
Accent (orange) |
|
Generic .. admonition:: Title uses the base style with no colour.
.. todo:: uses .admonition-todo with info styling.
Version Directives¶
.. versionadded::, .. versionchanged::, .. deprecated::
render as compact pills with green, yellow, and red left borders
respectively.
Topic Directive¶
.. topic:: Title renders as a raised box, similar to admonitions
but without a coloured border.
CSS: .topic, div.topic
Code Blocks¶
Directive / Element |
CSS selector |
|---|---|
|
|
|
|
Line numbers ( |
|
Caption ( |
|
Doctest blocks ( |
|
Literal blocks ( |
|
Inline code |
|
|
|
Code blocks use clear: right to drop below any sidebar float.
Tables¶
All table types — simple, grid, list-table, csv-table — use the same base table styling with alternating hover rows.
Directive / Element |
CSS selector |
|---|---|
|
|
|
|
Field lists |
|
Option lists |
|
Index tables |
|
Tables use clear: right to drop below sidebar floats.
Images & Figures¶
Directive |
CSS selector |
|---|---|
|
|
|
|
|
|
|
|
|
|
Domain Objects (Python, C++, JS)¶
Element |
CSS selector |
|---|---|
Class / function signatures |
|
Object name |
|
Parameter styling |
|
Property keyword |
|
Description body |
|
Inline Roles¶
Role |
Styling |
|---|---|
|
Background pill with border ( |
|
Same as guilabel |
|
Bold monospace |
|
Italic monospace with 📄 prefix |
|
Monospace with code background |
|
Raised key-cap style with bottom border |
|
Dotted underline with cursor help |
|
Bold with ⬇ prefix |
|
Transparent background, link colour |
Block Elements¶
Directive |
Styling |
|---|---|
|
Accent left border, light background |
|
Italic, wider margins, attribution with “—” |
|
Like epigraph but larger font and wider margins |
|
Raised background box |
|
Bold heading that doesn’t appear in TOC |
|
Centred bold text |
|
Generic wrapper with margin |
|
Margin wrapper for compound paragraphs |
Line blocks ( |
Preserved line breaks, nestable |
|
Monospace code-styled grammar box |
|
Scrollable container for MathJax |
Footnotes, Citations, Glossary¶
Element |
Styling |
|---|---|
|
Left border, small font |
|
Same as footnote |
|
Superscript accent colour |
|
Bold with dotted bottom border |
|
Dotted underline, link colour |
HTML5 Elements (Sphinx 8+)¶
Element |
Styling |
|---|---|
|
|
|
Matches |
|
Bordered box, clickable summary with hover accent |
|
Raised box for |
Search Results (Sphinx 8+)¶
Class |
Styling |
|---|---|
|
Blue left border |
|
Green left border |
|
Accent left border |
|
Grey left border |
|
Yellow background highlight |
External Link Indicator¶
a.reference.external appends a small ↗ superscript arrow after the
link text to distinguish external from internal links.