MarkdownRenderX.Avalonia
12.1.3.8
dotnet add package MarkdownRenderX.Avalonia --version 12.1.3.8
NuGet\Install-Package MarkdownRenderX.Avalonia -Version 12.1.3.8
<PackageReference Include="MarkdownRenderX.Avalonia" Version="12.1.3.8" />
<PackageVersion Include="MarkdownRenderX.Avalonia" Version="12.1.3.8" />
<PackageReference Include="MarkdownRenderX.Avalonia" />
paket add MarkdownRenderX.Avalonia --version 12.1.3.8
#r "nuget: MarkdownRenderX.Avalonia, 12.1.3.8"
#:package MarkdownRenderX.Avalonia@12.1.3.8
#addin nuget:?package=MarkdownRenderX.Avalonia&version=12.1.3.8
#tool nuget:?package=MarkdownRenderX.Avalonia&version=12.1.3.8
MarkdownRenderX.Avalonia
A Markdown rendering control for Avalonia with no FluentAvalonia dependency. It works with any Avalonia theme (Fluent, Simple or your own), and follows light/dark theme variants automatically.
This package is derived from FluentAvalonia.MarkdownRender. Both packages offer the same features and visual design; the only difference is that this one drops the FluentAvalonia dependency — GitHub-style alerts are drawn in-house and accent colors come from the package's own resource keys. If your app already uses FluentAvalonia, prefer
FluentAvalonia.MarkdownRender.
Features
- Standard Markdown: headings, paragraphs, lists, blockquotes, horizontal rules, bold/italic, inline code and links
- Code blocks: syntax highlighting via AvaloniaEdit + TextMate for dozens of languages (C/C++, C#, Java, Python, Go, Rust, TypeScript, JSON, YAML, Dockerfile, PowerShell and more), with one-click copy
- GFM tables
- GitHub-style alerts (
> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING],[!CAUTION]) rendered by a built-in, dependency-free control - Images, including SVG and animated images
- Inline HTML blocks
- 5 built-in color themes: Default, OrangeHeart, Inkiness, ColorfulPurple, TechnologyBlue
- Built-in lightweight localization (English, Simplified Chinese, Traditional Chinese) driven by
CurrentUICulture
Extended inline syntax
The core pipeline (UseAdvancedExtensions) parses these Markdig emphasis extras.
Since 12.1.3.8 they are rendered correctly instead of being mistaken for italic/bold:
| Syntax | Rendered as |
|---|---|
H~2~O |
subscript |
X^2^ |
superscript |
==key== |
highlighted background |
~~gone~~ |
strikethrough |
++added++ |
underline (insertion) |
**bold** / *italic* |
unchanged |
The highlight colour follows the app theme (#FFF2A8 light / #665C15 dark).
Behaviour change: up to 12.1.3.7, ~...~ rendered as italic and ==...==
as bold. Math ($...$) still requires the KaTeX extension, diagrams the
Mermaid extension.
Versioning
The version is four-part: the first three parts match the Avalonia version it targets, the last part is the component's own revision.
| Package version | Targets Avalonia | Target framework | FluentAvalonia dependency |
|---|---|---|---|
12.1.3.x |
12.1.3 | net10.0 |
None |
Main dependencies: Avalonia 12.1.3, Avalonia.AvaloniaEdit 12.0.0, AvaloniaEdit.TextMate 12.0.0, Svg.Controls.Skia.Avalonia 12.0.0.17, Markdig 1.4.0, SkiaSharp 4.153.1, TextMateSharp 2.0.4.
Installation
dotnet add package MarkdownRenderX.Avalonia
Quick start
1. Include the styles in App.axaml (required, otherwise the control has no visual styling):
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://MarkdownRenderX.Avalonia/Index.axaml" />
</Application.Styles>
2. Use the control in your view:
<UserControl xmlns:mrx="https://github.com/RYCBStudio/MarkdownRenderX.Avalonia">
<mrx:MarkdownRender Value="{Binding MarkdownText}" />
<mrx:MarkdownRender>
<mrx:MarkdownRender.Value>
# Heading
| Column A | Column B |
| --- | --- |
| 1 | 2 |
</mrx:MarkdownRender.Value>
</mrx:MarkdownRender>
</UserControl>
Value is the string property holding the Markdown source.
Themes
The Default theme is loaded automatically. To use another one, reference the corresponding theme file after including Index.axaml:
avares://MarkdownRenderX.Avalonia/Themes/Styles/Default.axaml
avares://MarkdownRenderX.Avalonia/Themes/Styles/OrangeHeart.axaml
avares://MarkdownRenderX.Avalonia/Themes/Styles/Inkiness.axaml
avares://MarkdownRenderX.Avalonia/Themes/Styles/ColorfulPurple.axaml
avares://MarkdownRenderX.Avalonia/Themes/Styles/TechnologyBlue.axaml
Light and dark variants are provided by Themes/MarkdownThemes/Light.axaml and Dark.axaml, and switch automatically with the application theme variant.
Customizing colors
The package does not rely on any external theme resources — every color key is shipped with the component. Override the keys below in your application resources to fine-tune the appearance:
| Resource key | Used for |
|---|---|
MdAccentTextFillColorPrimaryBrush |
Link foreground, link underline |
MdAccentTextFillColorTertiaryBrush |
Link pressed state |
MdAlertBodyBrush |
Alert body text |
MdAlert{Kind}AccentBrush / MdAlert{Kind}BackgroundBrush |
Alert colors per kind, where Kind ∈ Tip / Note / Warning / Important / Caution |
Localization
All built-in strings (alert titles, copy prompts) live in i18n/MdStrings.cs and are selected from CultureInfo.CurrentUICulture: English, Simplified Chinese (zh-CN) and Traditional Chinese (zh-Hant). No configuration required — an English UI culture shows English text.
Development
dotnet build -c Release
dotnet pack -c Release -o ./artifacts
License & acknowledgements
- Original project: AIDotNet/Markdown.AIRender, MIT licensed
- This repository: RYCBStudio, MIT licensed (see LICENSE)
Source code comments are written in Chinese; contributions in English are welcome.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Avalonia (>= 12.1.3)
- Avalonia.AvaloniaEdit (>= 12.0.0)
- Avalonia.Skia (>= 12.1.3)
- AvaloniaEdit.TextMate (>= 12.0.0)
- Markdig (>= 1.4.0)
- SkiaSharp (>= 4.153.1)
- SkiaSharp.NativeAssets.Linux (>= 4.153.1)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 4.153.1)
- Svg.Controls.Skia.Avalonia (>= 12.0.0.17)
- TextMateSharp (>= 2.0.4)
- TextMateSharp.Grammars (>= 2.0.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on MarkdownRenderX.Avalonia:
| Package | Downloads |
|---|---|
|
FluentAvalonia.MarkdownRender
Markdown rendering control for Avalonia, styled for FluentAvalonia. Supports headings, lists, blockquotes, syntax-highlighted code blocks, images, inline HTML, GitHub-style alerts and GFM tables. |
|
|
MarkdownRenderX.Avalonia.KaTeX
KaTeX-compatible math rendering for MarkdownRenderX.Avalonia. Renders $inline$ and $$display$$ formulas natively with SkiaSharp - no WebView, no JavaScript runtime. |
|
|
MarkdownRenderX.Avalonia.Emoji
GitHub / GitMoji shortcode support for MarkdownRenderX.Avalonia. Turns :beer:, :tada:, :+1: and ~1900 other shortcodes into native Unicode emoji - selectable text, no images, no WebView. |
|
|
MarkdownRenderX.Avalonia.Mermaid
Renders ```mermaid fenced code blocks as native SVG diagrams in MarkdownRenderX.Avalonia. Powered by Mermaider (pure .NET) and Svg.Skia - no WebView, no browser, no JavaScript. Supports flowcharts, sequence diagrams, class diagrams, Gantt charts and more, with light and dark themes. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Standalone edition with no FluentAvalonia dependency, derived from FluentAvalonia.MarkdownRender. GitHub-style alerts are drawn in-house, and accent colors come from the package's own resource keys.