Skip to content

Kit Sets

Pavel edited this page Oct 19, 2026 · 3 revisions

English | Русский

A set connects the ready-made extensions of one program in one line: the syntax of GitHub, GitLab, Obsidian, MkDocs, Docusaurus, HackMD or a chat. The order of the parts inside a set is fixed by the library. A set goes into Extensions like a single extension.

MainWindow.xaml (xmlns:md="https://github.com/porohkun/Beresta.Markdown.Wpf" on the root element):

<md:MarkdownViewer Markdown="{Binding Text}">
    <md:MarkdownViewer.Extensions>
        <md:ObsidianSet />
    </md:MarkdownViewer.Extensions>
</md:MarkdownViewer>

Sets

Set Parts, in order Settings
GitHubSet properties card, mentions, issue links, color codes, emoji Resolver, IssueTemplates
GitLabSet table of contents, issue links, color codes, emoji IssueTemplates
ObsidianSet properties card, Obsidian callouts, comments, embedded images, wiki links, tags, task statuses Resolver
MkDocsSet MkDocs admonitions —
DocusaurusSet :::kind containers; fits VuePress too —
HackMDSet :::kind containers, table of contents, shortcodes ShortcodeHandlers, LoadThumbnails
ChatSet mentions, spoilers, emoji Resolver

Settings

The settings of a set are those of its parts: Resolver is the resolver of mentions or of wiki links and embeds, IssueTemplates are the templates of issue links, ShortcodeHandlers and LoadThumbnails are those of shortcodes.

MainWindow.xaml (xmlns:sys="clr-namespace:System;assembly=System.Runtime" on the root element; local:TeamResolver is your resolver):

<md:MarkdownViewer Markdown="{Binding Text}">
    <md:MarkdownViewer.Extensions>
        <md:GitHubSet Resolver="{x:Static local:TeamResolver.Instance}">
            <md:GitHubSet.IssueTemplates>
                <sys:String x:Key="#">https://github.com/org/repo/issues/{0}</sys:String>
            </md:GitHubSet.IssueTemplates>
        </md:GitHubSet>
    </md:MarkdownViewer.Extensions>
</md:MarkdownViewer>

Switching parts off

Without names the parts a set does not connect — by the names of their extensions.

<md:ObsidianSet Without="Comments, TaskStatuses" />

In code it is the KitParts flags (using Beresta.Markdown.Wpf.Kit;):

Viewer.Extensions.Add(new ObsidianSet { Without = KitParts.Comments | KitParts.TaskStatuses });

Your own extensions in a set

A set is an MdExtensionSet: an extension added to its Extensions is asked after the parts of the set.

MainWindow.xaml.cs, in the window constructor after InitializeComponent() (using Beresta.Markdown.Wpf.Kit;; DiagramExtension is your extension):

var set = new GitHubSet();
set.Extensions.Add(new DiagramExtension());
Viewer.Extensions.Add(set);

Beresta.Markdown.Wpf

Basics

Working with Text

Appearance

Integration

Editing

Your Own Syntax

Ready-made Extensions


По-русски

Основы

Работа с текстом

Оформление

Встраивание в приложение

Правка

Свой синтаксис

Готовые расширения

Clone this wiki locally