Skip to content

Commit a828097

Browse files
committed
Add instructions on how to add a new admonition
1 parent f4736b5 commit a828097

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/authoring.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ Admonitions use a style similar to GitHub-flavored markdown, where the style nam
181181
> [!NOTE]
182182
> This is a note.
183183

184+
> [!EDITION-2024]
185+
> This is an edition-specific difference.
186+
184187
> [!EXAMPLE]
185188
> This is an example.
186189
```

mdbook-spec/src/admonitions.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
//! Support for admonitions using markdown blockquotes.
2+
//!
3+
//! To add support for a new admonition:
4+
//!
5+
//! 1. Modify the [`admonitions`] function below to include an icon.
6+
//! 2. Modify `theme/reference.css` to set the color for the different themes.
7+
//! Look at one of the other admonitions as a guide.
8+
//! 3. Update `src/introduction.md` and describe what this new block is for
9+
//! with an example.
10+
//! 4. Update `docs/authoring.md` to show an example of your new admonition.
211
312
use crate::{Diagnostics, warn_or_err};
413
use mdbook::book::Chapter;

0 commit comments

Comments
 (0)