Documentation for asciidoctor-html asciidoctor-html

Part 4

Macros

asciidoctor-html includes some convenient inline macros in addition to those made available by Asciidoctor.

cref

The cref inline macro allows you to cross reference blocks or anchors in other pages. Reference text gets properly resolved if unspecified.

Table 4.1Example uses of the cref macro
Source Generated Link
cref:index[] Welcome
cref:lists[] Part 2
cref:lists[Ordered Lists] Ordered Lists
cref:numbered-blocks#tbl-reference[Reference Table] Reference Table
cref:numbered-blocks#lem-monotone-likelihood[] Lemma 3.2
cref:tests[] Appendix

footnote

The footnote macro is included in Asciidoctor. However, instead of creating a link to a footnote at the bottom of the page, asciidoctor-html shows the footnote in a popover.

Use the {parskip} variable to force an appropriate vertical space inside a footnote. Insert the variable directly following the preceding text (with no spaces). This variable can also be useful inside list items.

bi

You can insert any icon from Bootstrap Icons with the bi macro.

Table 4.2Example uses of the bi macro
Source Generated Icon
bi:arrow-through-heart[]
bi:bicycle[130%]
bi:balloon-fill[100%,magenta]

text

Bootstrap’s semantic inline text elements are supported via the text macro.

These types of markup are built in to the AsciiDoc language and don’t require the text macro.

Table 4.3Example uses of the text macro
Source Generated Text
text:del[deleted text] deleted text
text:strike[no longer accurate] no longer accurate
text:ins[an addition] an addition
text:underline[underlined text] underlined text
text:small[fine print] fine print
text:sc[SmallCaps] SmallCaps
text:muted[faint text] faint text
text:danger[a warning] a warning
text:abbr[attr,title=attribute] attr
text:abbr[HTML,title=HyperText Markup Language,role=initialism] HTML
text:kbd[Ctrl + A] Ctrl + A
Syntax: footnote:[$content]
Content can include LaTeX such as \[x + 1 = 2 \Rightarrow x = 1\]