FluentAvalonia.MarkdownRender
12.1.3.8
dotnet add package FluentAvalonia.MarkdownRender --version 12.1.3.8
NuGet\Install-Package FluentAvalonia.MarkdownRender -Version 12.1.3.8
<PackageReference Include="FluentAvalonia.MarkdownRender" Version="12.1.3.8" />
<PackageVersion Include="FluentAvalonia.MarkdownRender" Version="12.1.3.8" />
<PackageReference Include="FluentAvalonia.MarkdownRender" />
paket add FluentAvalonia.MarkdownRender --version 12.1.3.8
#r "nuget: FluentAvalonia.MarkdownRender, 12.1.3.8"
#:package FluentAvalonia.MarkdownRender@12.1.3.8
#addin nuget:?package=FluentAvalonia.MarkdownRender&version=12.1.3.8
#tool nuget:?package=FluentAvalonia.MarkdownRender&version=12.1.3.8
FluentAvalonia.MarkdownRender
A Markdown rendering control for Avalonia / FluentAvalonia, ready to use out of the box and following the Fluent theme and light/dark variants automatically.
If your app does not use FluentAvalonia, use the sibling package MarkdownRenderX.Avalonia instead — same features and look, without this dependency.
This component was renamed from AIDotNet/Markdown.AIRender (MIT) and further developed; GFM table support was added on top.
Package relationship
Since 12.1.3.6 this is a companion package built on MarkdownRenderX.Avalonia: installing it also installs the core package. Both renderers query the same extension registry, so the KaTeX and Emoji extensions work here as well — just call their Register() methods once at startup. Your existing XAML namespace, styles and FAInfoBar-based alerts are unchanged.
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]), backed by FluentAvalonia's InfoBar - 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
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 | FluentAvaloniaUI |
|---|---|---|---|
12.1.3.x |
12.1.3 | net10.0 |
3.1.0 |
Main dependencies: Avalonia 12.1.3, Avalonia.AvaloniaEdit 12.0.0, AvaloniaEdit.TextMate 12.0.0, Svg.Controls.Skia.Avalonia 12.0.0.17, FluentAvaloniaUI 3.1.0, Markdig 1.4.0, SkiaSharp 4.153.1, TextMateSharp 2.0.4.
Installation
From nuget.org
dotnet add package FluentAvalonia.MarkdownRender
From GitHub Packages
GitHub Packages requires authentication. Add a nuget.config at the root of your repository:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="github" value="https://nuget.pkg.github.com/RYCBStudio/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="YOUR_GITHUB_USERNAME" />
<add key="ClearTextPassword" value="YOUR_GITHUB_PAT" />
</github>
</packageSourceCredentials>
</configuration>
The PAT needs the read:packages scope. Then:
dotnet add package FluentAvalonia.MarkdownRender
Quick start
1. Include the styles in App.axaml (required, otherwise the control has no visual styling):
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://FluentAvalonia.MarkdownRender/Index.axaml" />
</Application.Styles>
2. Use the control in your view:
<UserControl xmlns:mdRender="https://github.com/RYCBStudio/FluentAvalonia.MarkdownRender">
<mdRender:MarkdownRender Value="{Binding MarkdownText}" />
<mdRender:MarkdownRender>
<mdRender:MarkdownRender.Value>
# Heading
| Column A | Column B |
| --- | --- |
| 1 | 2 |
</mdRender:MarkdownRender.Value>
</mdRender: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://FluentAvalonia.MarkdownRender/Themes/Styles/Default.axaml
avares://FluentAvalonia.MarkdownRender/Themes/Styles/OrangeHeart.axaml
avares://FluentAvalonia.MarkdownRender/Themes/Styles/Inkiness.axaml
avares://FluentAvalonia.MarkdownRender/Themes/Styles/ColorfulPurple.axaml
avares://FluentAvalonia.MarkdownRender/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.
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). An English UI culture shows English text without any configuration.
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)
The original copyright and permission notice is retained as required by the MIT license.
| 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)
- FluentAvaloniaUI (>= 3.1.0)
- Markdig (>= 1.4.0)
- MarkdownRenderX.Avalonia (>= 12.1.3.8)
- 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
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Renamed from Markdown.AIRender (https://github.com/AIDotNet/Markdown.AIRender) with added GFM table support. See the repository README and GitHub releases for details.