Messagebox
Innehåll
Messageboxes can be added with:
Input:
::: messagebox
Lorem ipsum dolor sit amet.
:::
Output:
Messages may contain additional markdown:
Input:
::: messagebox
Lorem **ipsum** dolor sit amet.
- foo
- bar
- baz
:::
Output:
Variants
An optional variant can be specified:
::: messagebox warning
lorem ipsum dolor sit amet
:::
The following variants are supported:
info
(default)warning
danger
For these variants the following aliases can also be used:
Input:
::: info
This is an info box.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
Output:
Custom title
A custom title can be set by appending the text right after the variant of the container:
Input:
::: messagebox warning Lorem ipsum
Dolor sit amet.
:::
Output:
Custom variant
Custom variants can be implemented by adding the CSS-class docs-messagebox--${variant}
.
.docs-messagebox--rainbow {
border-color: black;
background: linear-gradient(in hsl longer hue 45deg, red 0 0);
p {
color: white;
font-weight: bold;
text-shadow:
0 0 5px black,
1px 1px 0px black;
}
}
Input:
::: messagebox rainbow
Custom variant
:::
Output:
Localization
The default titles can be set globally in the site configuration:
const docs = new Generator({
markdown: {
messagebox: {
title: {
info: "Information",
warning: "Varning",
danger: "Se upp!",
},
},
},
});