Skip to content

Admonition - custom title? #2975

@kg4zow

Description

@kg4zow

Problem

Is there a way to specify the title when creating an "admonition"?

As an example, I've been creating admonitions using syntax like this:

> ❌ **DON'T UPGRADE PRODUCTION SYSTEMS ON A FRIDAY!**
> If you do, and something goes wrong, it will create a flood of support tickets that will ruin your entire weekend.

DON'T UPGRADE PRODUCTION SYSTEMS ON A FRIDAY!
If you do, and something goes wrong, it will create a flood of support tickets that will ruin your entire weekend.

Because I'm creating them by hand, I can specify whatever title makes sense within the context of the page, rather than being limited to the "Note", "Tip", "Important", etc. titles which are built into mdbook.

Proposed Solution

Add an optional way to provide a custom title. My thought is something like ...

[!CAUTION title="DON'T UPGRADE PRODUCTION SYSTEMS ON A FRIDAY"]

This also provides an obvious way to add other attributes like icon=, color=, and maybe bgcolor= (although that would need to take the "theme" into account).

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions