实时Markdown渲染 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
高性能实时Markdown渲染器,适用于AI/LLM应用
实时Markdown渲染 是一款基于 C# 开发的开源工具,专注于 ai、avalonia、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
高性能实时Markdown渲染器,适用于AI/LLM应用
实时Markdown渲染 是一款基于 C# 开发的开源工具,专注于 ai、avalonia、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 克隆仓库 git clone https://github.com/DearVa/LiveMarkdown.Avalonia cd LiveMarkdown.Avalonia # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 livemarkdown.avalonia --help # 基本运行 livemarkdown.avalonia [options] <input> # 详细使用说明请查阅文档 # https://github.com/DearVa/LiveMarkdown.Avalonia
# livemarkdown.avalonia 配置说明 # 查看配置选项 livemarkdown.avalonia --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export LIVEMARKDOWN.AVALONIA_CONFIG="/path/to/config.yml"
<img src="https://raw.githubusercontent.com/DearVa/LiveMarkdown.Avalonia/main/img/icon-large.png" alt="LiveMarkdown.Avalonia Logo" width="128" height="128" />
High performance, real-time Markdown renderer for AI/LLM
<p align="center"> <a href="https://deepwiki.com/DearVa/LiveMarkdown.Avalonia"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a> <a href="https://www.nuget.org/packages/LiveMarkdown.Avalonia/"><img src="https://img.shields.io/nuget/v/LiveMarkdown.Avalonia.svg?style=flat-square" alt="NuGet"></a> <a href="https://docs.microsoft.com/en-us/dotnet/standard/net-standard"><img src="https://img.shields.io/badge/netstandard-2.0-blue.svg?style=flat-square" alt="netstandard2.0"></a> <a href="https://avaloniaui.net/"><img src="https://img.shields.io/badge/Avalonia-11-blue.svg?style=flat-square" alt="Avalonia"></a> <a href="https://github.com/DearVa/LiveMarkdown.Avalonia/issues"><img src="https://img.shields.io/github/issues/DearVa/LiveMarkdown.Avalonia.svg?style=flat-square" alt="GitHub issues"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square" alt="License"></a> </p>
<br/>
<img src="https://raw.githubusercontent.com/DearVa/LiveMarkdown.Avalonia/main/img/demo.gif" alt="LiveMarkdown.Avalonia Demo" width="800" />
</div>
<br/>
LiveMarkdown.Avalonia is a High-performance Markdown viewer for Avalonia applications. It supports real-time rendering of Markdown content, so it's ideal for applications that require dynamic text updating, especially when streaming large model outputs.
- 🚀 High-performance rendering powered by Markdig - 🔄 Real-time updates: Automatically re-renders changes in Markdown content - 🎨 Customizable styles: Easily style Markdown elements using Avalonia's powerful styling system - 🔗 Link support: Clickable links with customizable behavior - 📊 Table support: Render tables with proper formatting - 📜 Code block syntax highlighting: Supports multiple languages with TextMateSharp - 🖼️ Image support: Load online, local even avares images asynchronously - ✍️ Selectable text: Text can be selected across different Markdown elements
[!NOTE] This library currently only supportsAppendandClearoperations on the Markdown content, which is enough for LLM streaming scenarios.
[!WARNING] Known issue: Avalonia 11.3.5 and 11.3.6 changed text layout behavior, which may cause some text offset issues in certain scenarios. e.g. code inline has extra bottom margin, wried italic font rendering, etc. Please use 11.3.0 ~ 11.3.4 or >= 11.3.7 to avoid this problem.
You can install the latest version from NuGet CLI:
dotnet add package LiveMarkdown.Avalonia
or use the NuGet Package Manager in your IDE.
LaTeX is supported via the LiveMarkdown.Avalonia.Math package. You can install it via NuGet:
dotnet add package LiveMarkdown.Avalonia.Math
Then register both the MathInlineNode and MathBlockNode before using LaTeX in your Markdown content (e.g. App.axaml.cs):
using LiveMarkdown.Avalonia;
MarkdownNode.Register<MathInlineNode>();
MarkdownNode.Register<MathBlockNode>(); // This is also required for block-level LaTeX support, e.g. $$...$$
// Also, you can use the following code to register/unregister multiple nodes at once if needed:
MarkdownNode.Edit(builder => builder
.Register<MathInlineNode>()
.Register<MathBlockNode>()
// .Unregister<SomeBuiltInNode>() // You can even unregister some built-in nodes if you want to disable certain Markdown features
);
SVG rendering is supported via the LiveMarkdown.Avalonia.Svg or LiveMarkdown.Avalonia.Svg.Skia package. You can install one of them via NuGet:
dotnet add package LiveMarkdown.Avalonia.Svg
or
dotnet add package LiveMarkdown.Avalonia.Svg.Skia
[!NOTE] TheLiveMarkdown.Avalonia.SvgandLiveMarkdown.Avalonia.Svg.Skiapackages provide two different implementations for SVG rendering. The former usesSvg.Controls.Avaloniawhich is more Avalonia-native, while the latter usesSvg.Skiawhich is more powerful and has better compatibility.
Then register the SvgImageDecoder into the AsyncImageLoader before using SVG images in your Markdown content (e.g. App.axaml.cs):
using LiveMarkdown.Avalonia;
AsyncImageLoader.DefaultDecoders =
[
SvgImageDecoder.Shared,
DefaultBitmapDecoder.Shared
];
You can also set the AsyncImageLoader.Decoders property on a per-renderer basis if you want different renderers to use different decoders.
[!WARNING] Mermaid diagram rendering is currently in early preview stage, and may have some issues. Only flowchart and state diagram are supported for now, and the rendering performance may not be optimal.
Mermaid diagram rendering is supported via the LiveMarkdown.Avalonia.Mermaid package. You can install it via NuGet:
dotnet add package LiveMarkdown.Avalonia.Mermaid
Then register the MermaidDiagramNode before using Mermaid diagrams in your Markdown content (e.g. App.axaml.cs):
using LiveMarkdown.Avalonia;
MarkdownRenderer.ConfigurePipeline += x => x.UseMermaid();
MarkdownNode.Register<MermaidBlockNode>();
AsyncImageLoader uses the in-memory RamBasedAsyncImageLoaderCache.Shared by default. If you want persistent caching for remote images, enable the file-backed cache explicitly:
<Image md:AsyncImageLoader.Source="https://example.com/image.png" md:AsyncImageLoader.Cache="File"/>
Or set it globally:
AsyncImageLoader.DefaultCache = FileBasedAsyncImageLoaderCache.Shared;
FileBasedAsyncImageLoaderCache defaults to a cache directory under %LocalAppData%/LiveMarkdown.ImageCache, but you can configure it to any directory you want.
using LiveMarkdown.Avalonia;
FileBasedAsyncImageLoaderCache.CacheDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"YourApp",
"ImageCache");
FileBasedAsyncImageLoaderCache.MaxCacheSizeBytes = 256L * 1024L * 1024L;
FileBasedAsyncImageLoaderCache.MaxEntrySizeBytes = 32L * 1024L * 1024L;
FileBasedAsyncImageLoaderCache.DefaultFreshnessLifetime = TimeSpan.FromDays(7);
HttpAsyncImageLoaderHandler.Shared.EnableConditionalRequests = true;
The file cache stores original image bytes under SHA-256 keys and uses common HTTP freshness/validation headers such as Cache-Control, Expires, ETag, and Last-Modified when available.
For advanced scenarios, you can even implement your own AsyncImageLoaderCache.
- Q: Why some emojis not rendered correctly (rendered in single color)? - A: This is a known issue caused by Skia (the render backend of Avalonia). You can upgrade SkiaSharp version (e.g. >= 3.117.0) to fix this. Related issue
- Q: How does cross-block text selection work? - A: MarkdownRenderer uses MarkdownTextBlock to provide selection across Markdown blocks, including paragraphs, headings, tables, inline code, and code blocks. By default, the bundled style marks each MarkdownRenderer as a selection scope, so users can drag-select text across all selectable text blocks inside the same renderer.
If you need multiple renderers or custom containers to share one selection, set MarkdownTextBlock.IsSelectionScope="True" on their nearest shared visual parent:
<StackPanel md:MarkdownTextBlock.IsSelectionScope="True">
<md:MarkdownRenderer/>
<md:MarkdownRenderer/>
</StackPanel>
When scopes are nested, the topmost scope is used. This makes it possible to set a broad application-level selection scope, while still keeping the default renderer-level behavior for simple cases. The old MarkdownRenderer.SelectionScopeName API is kept for compatibility, but new code should use MarkdownTextBlock.IsSelectionScope.
During drag selection, moving the pointer outside a ScrollViewer automatically scrolls the nearest scrollable parent. For nested scroll viewers, the renderer follows Avalonia scroll chaining: it tries the inner ScrollViewer first and continues to outer scroll viewers only when ScrollViewer.IsScrollChainingEnabled allows it.
- Q: Why is LaTeX like \(xxx\) not rendered? - A: The default Markdig math parser supports $...$ and $$...$$. To support \(...\) and \[...\], enable the extended math parser before creating any MarkdownRenderer instances:
MarkdownRenderer.ConfigurePipeline += x => x.UseExtendedMathematics();
MarkdownNode.Edit(builder => builder
.Register<MathInlineNode>()
.Register<MathBlockNode>()
);
高性能实时Markdown渲染器,适用于AI/LLM应用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,实时Markdown渲染 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | LiveMarkdown-Avalonia |
| Topics | aiavaloniallmmarkdigmarkdownc# |
| GitHub | https://github.com/DearVa/LiveMarkdown.Avalonia |
| License | Apache-2.0 |
| 语言 | C# |
收录时间:2026-06-14 · 更新时间:2026-06-14 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。