formatting
¶
Directives, roles and nodes for text formatting.
New in version 0.2.0.
Enable sphinx_toolbox.formatting
by adding the following
to the extensions
variable in your conf.py
:
extensions = [
...
'sphinx_toolbox.formatting',
]
For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .
Usage¶
- :iabbr:¶
An abbreviation. If the role content contains a parenthesized explanation, it will be treated specially: it will be shown in a tool-tip in HTML, and output only once in LaTeX.
Unlike Sphinx’s
abbr
role, this one shows the abbreviation in italics.New in version 0.2.0.
Example
:iabbr:`LIFO (last-in, first-out)`
LIFO
- :bold-title:¶
Role for displaying a pseudo title in bold.
This is useful for breaking up Python docstrings.
New in version 2.12.0.
Example
:bold-title:`Examples:` :bold-title:`Other Extensions`
Examples:
Other Extensions
API Reference¶
Classes:
|
Docutils Node to show an abbreviation in italics. |
Docutils role to show an abbreviation in italics. |
Functions:
|
Visit an |
|
Depart an |
|
Visit an |
|
Depart an |
|
Setup |
- class ItalicAbbreviationNode(rawsource='', text='', *children, **attributes)[source]¶
Bases:
abbreviation
Docutils Node to show an abbreviation in italics.
- class ItalicAbbreviation[source]¶
Bases:
Abbreviation
Docutils role to show an abbreviation in italics.
Methods:
run
()Process the content of the italic abbreviation role.
- visit_iabbr_node(translator, node)[source]¶
Visit an
ItalicAbbreviationNode
.- Parameters
translator (
HTMLTranslator
)node (
ItalicAbbreviationNode
) – The node being visited.
- depart_iabbr_node(translator, node)[source]¶
Depart an
ItalicAbbreviationNode
.- Parameters
translator (
HTMLTranslator
)node (
ItalicAbbreviationNode
) – The node being visited.
- latex_visit_iabbr_node(translator, node)[source]¶
Visit an
ItalicAbbreviationNode
.- Parameters
translator (
LaTeXTranslator
)node (
ItalicAbbreviationNode
) – The node being visited.
- latex_depart_iabbr_node(translator, node)[source]¶
Depart an
ItalicAbbreviationNode
.- Parameters
translator (
LaTeXTranslator
)node (
ItalicAbbreviationNode
) – The node being visited.
- setup(app)[source]¶
Setup
sphinx_toolbox.formatting
.- Parameters
app (
Sphinx
) – The Sphinx application.- Return type