diff options
| author | Liran Tal <liran.tal@gmail.com> | 2023-03-30 07:38:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-30 00:38:17 -0600 |
| commit | af53714c64a561a56b0cb9dc9773f13350187438 (patch) | |
| tree | 89f2dca4a1c0f2aee74273c7b0522d2f361651a1 | |
| parent | add5942c4e546925ddde696b0e63c662a7680d01 (diff) | |
explain how to add support for admonition-<name> category on admonition theme page (PR #2397)
| -rw-r--r-- | docs/modules/theme/pages/admonition.adoc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/modules/theme/pages/admonition.adoc b/docs/modules/theme/pages/admonition.adoc index 3e59a52b..3a35774c 100644 --- a/docs/modules/theme/pages/admonition.adoc +++ b/docs/modules/theme/pages/admonition.adoc @@ -338,7 +338,7 @@ admonition: stroke-color: #FF0000 |=== -[#name] +[#icon] === Identifying an icon The `name` key assigned to a built-in admonition only accepts a value in the format of <icon set>-<icon name>`. @@ -346,3 +346,18 @@ A value is always required when assigning an icon to a built-in admonition. See the `.yml` files in the https://github.com/jessedoyle/prawn-icon/tree/master/data/fonts[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. + +[#name] +== 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 xref:extend:use-cases.adoc#theme-admonition-per-type[theme admonition per type] use case on the xref:extend:use-cases.adoc[] page. +To apply the extension, refer to xref:extend:use-converter.adoc[]. |
