Skip to content

How to add custom title to admonitions #834

Answered by NickleDave
ma-sadeghi asked this question in Q&A
Discussion options

You must be logged in to vote

Not an expert but I think:

If you do this with the generic admonition directive then the text right after the directive will become the title. This is the way to add a custom title.
https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html?highlight=admonition#admonitions
https://docutils.sourceforge.io/docs/ref/doctree.html#admonition

But for the note directive there's no arguments -- see how it's an example for how you can cram directives onto one line here.
https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#how-directives-parse-content

:::{note} Notes require **no** arguments, so content can start here.:::

That's because note is a more sp…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ma-sadeghi
Comment options

@rowanc1
Comment options

Answer selected by ma-sadeghi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants