Admonition Category Keys
admonition
The keys in the admonition
category control the arrangement and style of admonition blocks and the icon used for each admonition type.
Key | Value Type | Example |
---|---|---|
background-color |
Color |
|
border-color |
Color |
|
border-radius |
Measurement |
|
border-style |
Border style |
|
border-width |
Measurement | Measurement[] |
|
column-rule-color |
Color |
|
column-rule-style |
|
|
column-rule-width |
Measurement |
|
font-color |
Color |
|
font-family |
Font family name |
|
font-kerning |
|
|
font-size |
Font size |
|
font-style |
Font style |
|
padding |
Measurement | Measurement[] |
|
text-transform |
Text transform |
|
admonition-label
The keys in the admonition-label
category control the arrangement and style of the text-based labels on admonition blocks.
Key | Value Type | Example |
---|---|---|
font-color |
Color |
|
font-family |
Font family name |
|
font-kerning |
|
|
font-size |
Font size |
|
font-style |
Font style |
|
min-width |
Measurement |
|
Measurement | Measurement[top(n/a),right,bottom(n/a),left] |
|
|
text-align |
Text alignment |
|
text-transform |
Text transform |
|
vertical-align |
|
|
admonition-label-<name>
The keys in the admonition-label-<name>
category control the arrangement and style of the text-based label that matches a built-in admonition name.
<name>
can be note
, tip
, warning
, important
, or caution
.
Key | Value Type | Example |
---|---|---|
font-color |
Color |
|
font-family |
Font family name |
|
font-kerning |
|
|
font-size |
Font size |
|
font-style |
Font style |
|
text-transform |
Text transform |
|
admonition-icon-<name>
The keys in the admonition-icon-<name>
category control the arrangement and style of the specified icon associated with a built-in admonition name.
<name>
can be note
, tip
, warning
, important
, or caution
.
All icon types must be grouped under a single icon
category.
In other words, the icon
category cannot be declared multiple times and its keys cannot be flattened (e.g., tip-name: far-lightbulb
is not valid syntax).
A font-based icon is placed in a container with a width 1.5 times the size of the icon. This is done to give the icon more padding than the textual label. This behavior will be configurable starting in Asciidoctor PDF 3.
The image
key is only relevant when image-based icons are used (icons=image
).
It’s an alternative to using the icon
attribute on the admonition block.
The path is resolved starting from the location of the AsciiDoc document and relative to the value of the iconsdir
attribute.
The image macro syntax is not supported for this key.
Key | Value Type | Example |
---|---|---|
image |
path |
|
<icon set>-<icon name> |
|
|
size |
Number |
|
stroke-color |
Color |
|
Identifying an icon
The name
key assigned to a built-in admonition only accepts a value in the format of <icon set>-<icon name>`.
A value is always required when assigning an icon to a built-in admonition.
See the .yml
files in the prawn-icon repository for a list of valid icon names.
The prefix (e.g., fas-
) of the value determines which font set to use.
If the prefix is not specified, fa-
is assumed.
admonition-<name>
Asciidoctor PDF does not currently support theming admonitions by name (i.e., type).
In other words, the theming system doesn’t provide the admonition-<name>
category key, where <name>
is the admonition name (e.g., note, tip, etc).
That means it’s not possible to apply a background color to one admonition type, such as NOTE, without applying it to all admonitions.
However, it is possible to extend Asciidoctor PDF to add this capability.
In order to add support for the admonition-<name>
category key to the theming system, you need to create an extended converter.
That converter will intercept requests to convert an admonition and temporarily promote settings on the admonition-<name>
category key to the admonition
category key.
Once the admonition is converted (i.e., rendered), the original theme settings will be restored.
You can find the details of this extended converter in the theme admonition per type use case on the Extended Converter Use Cases page. To apply the extension, refer to Use the Extended Converter.