This is an extension for Markdig to add admonitions (also known as call-outs).
We can instanciate BootstrapAdmonitionExtension
in two ways.
The first, and the simplest way:
new BootstrapAdmonitionExtension("Warning", "Danger", "Tips", "Notes")
We only have to specify the titles for the four admonitions configured by default.
The second allows us to create our own types of admonitions: :
new BootstrapAdmonitionExtension(new List<BootstrapAdmonitionTemplate>()
{
new BootstrapAdmonitionTemplate("tip", "success", "lightbuld", "Tip"),
new BootstrapAdmonitionTemplate("note", "info", "info-circle-fill", "Notes"),
...
}
To instanciate BootstrapAdmonitionTemplate
, we have to provide 4 aguments:
- The key name of the admonition
- The name of the bootstrap alert type. See the bootstrap documentation
- The name of the bootstrap icon. See the bootstrap documentation
- The title of the admonition, as it will appear in the rendering.
In our markdown document we will use the following syntax specifying the key name of the admonition we want to use (case insensitive). :
::: warning
This is a sample warning
:::