Repository navigation
Kit Callouts
English | Русский
Ready-made extensions for callouts and collapsible blocks in the syntax of Obsidian, MkDocs, Docusaurus, VuePress and HackMD. They come with the package, are off by default and are connected with one line each.

The ready-made extensions live in the namespace Beresta.Markdown.Wpf.Kit.
MainWindow.xaml (xmlns:md="https://github.com/porohkun/Beresta.Markdown.Wpf" on
the root element):
<md:MarkdownViewer Markdown="{Binding Text}">
<md:MarkdownViewer.Extensions>
<md:ObsidianCallouts />
<md:MkDocsAdmonitions />
<md:CalloutContainers />
</md:MarkdownViewer.Extensions>
</md:MarkdownViewer>MainWindow.xaml.cs, in the constructor (using Beresta.Markdown.Wpf.Kit;):
Viewer.Extensions.Add(new ObsidianCallouts());All three draw the same callouts. Besides the five GitHub kinds there
are ten more, each with its own color, icon and title — the theme keys Md.Callout.<Kind>.Brush,
.Icon and .Title, see Theming → Callout kinds. Letter case does not
matter. Another name of a kind gets the look of that kind and keeps itself as the title.
| Kind | Other names |
|---|---|
note |
— |
tip |
hint |
important |
— |
warning |
attention |
caution |
— |
abstract |
summary, tldr
|
info |
— |
todo |
— |
success |
check, done
|
question |
help, faq
|
failure |
fail, missing
|
danger |
error |
bug |
— |
example |
— |
quote |
cite |
Any other kind is drawn as a note titled with its name. Obsidian treats important and caution as
other names of tip and warning; here they keep their GitHub look.
ObsidianCallouts adds to the GitHub syntax what Obsidian adds: a title after the kind, and - or
+ right after the kind for a callout that folds; - starts it folded. Callouts nest.
Any .md file:
> [!faq]- Why is the sky blue?
> Because of Rayleigh scattering.
> [!example] Nested
> > [!quote]
> > A callout inside a callout.MkDocsAdmonitions reads !!! kind "Title" with the content indented by four spaces; ??? starts
a folded collapsible admonition, ???+ an expanded one. The title is plain text; without it, the
title of the kind is shown.
Any .md file:
!!! warning "Breaking change"
`Render` is gone, use `Draw`.
??? tip "More"
Hidden until expanded.CalloutContainers reads the containers of Docusaurus, VuePress and HackMD: a known kind becomes a
callout, details and spoiler become collapsible blocks. The title follows the name or goes into
square brackets, as in Docusaurus 3; {state="open"} expands a HackMD spoiler at once. A container
with any other name shows its content, as without the extension.
Any .md file:
:::tip Pro tip
Callouts cost nothing.
:::
:::details Click to expand
Hidden text.
:::By default whether a block is expanded lives in the viewer only. While controls edit the source —
AreControlsEditable, see Ticking tasks — expanding and collapsing
writes into the source the way the syntax marks it, the HTML <details> included:
| Block | Expanded | Collapsed |
|---|---|---|
<details> |
<details open> |
the open attribute is removed in any spelling: open, open="", open="open"
|
| Obsidian callout | > [!faq]+ |
> [!faq]- |
| MkDocs admonition | ???+ tip |
??? tip |
container :::details, :::spoiler
|
state="open" in the braces after the name: :::details {state="open"} Title
|
the parameters with open are removed, and empty braces with them |
The rest of the line stays as written: other attributes, the title, other parameters.
In the editor the lines of a callout get a bar in the color of its kind,
Md.Callout.<Kind>.Brush, and the kind in the title line — [!note], the word after !!! or ::: —
the same color. A kind without its own brush is drawn as note, as in the drawing.
The callouts of all three extensions are copied in the Obsidian syntax — > [!KIND] with the fold
mark and the title; collapsible blocks — as <details> with <summary>.
Beresta.Markdown.Wpf · Issues · MIT License
Basics
- Getting Started
- How It Renders
- Supported Markdown
- Settings and Hooks
- Scrolling and Virtualization
- Comparison
Working with Text
Appearance
Integration
- Application Links
- Images
- Untrusted Text
- Task Lists
- Source Lines and Two Panes
- Coordinates
- Live Preview
Editing
Your Own Syntax
Ready-made Extensions
Основы
- Начало работы
- Как рисует вьюер
- Что поддерживается
- Настройки и перехват
- Прокрутка и виртуализация
- Сравнение
Работа с текстом
Оформление
Встраивание в приложение
- Ссылки приложения
- Картинки
- Чужой текст
- Списки задач
- Строки исходника и две панели
- Координаты
- Живой предпросмотр
Правка
Свой синтаксис
Готовые расширения