Skip to article frontmatterSkip to article content

here’s how we use MyST admonitions; there are other ways, but these are stable and show up the same in both jlab and jbook, so...

just be wary to not insert a (sub)title inside an admonition, as it would not make it to the table of contents !

no title and no class

in its the simplest form, with no class nor shortcut: this is suboptimal

````{admonition}
with no title nor class
````

renders like this

with a title and no class

````{admonition} a title and no class
this is the same as with the `note` class
````

gives you this

a title and a class

there are a few predefined classes (see table below)

````{admonition} with a title and a class
:class: tip

the color and icon are inherited from the chosen class
````

which renders as

the menagerie of classes

there are some predefined types of admonition that are - see them also below

namecoloricon
tipgreenpen
hintgreenbulb
seealsogreenright arrow
notebluecircled i
importantbluelightning
attentionyellowmegaphone
cautionyellowcircled exclamation mark
warningyellowtriangled exclamation mark
dangerredcircled exclamation mark
errorredcircled x

collapsible contents with the dropdown class

just add the dropdown class to create a collapsible contents

````{admonition} this is a collapsible section
:class: attention dropdown

the whole text goes here....
````

using raw HTML

for the record only, it should also be possible to do create collapsible using plain HTML with a <details> tag

the visible part

and the rest of the message is just mentioned directly in the <details> tag

however do not use this as apparently this requires extra configuration...

start open

custom style

right in admonition

we have defined a CSS class custom in _static/style.css and let’s try to use it

in a div inside admonition

same but now we wrap the admo content within a div MyST tag