CodeWF.Markdown
CodeWF.Markdown 是基于 Avalonia 12 的 Markdown 渲染控件、排版主题和可运行示例。该仓库从 CodeWF.AvaloniaControls 中拆分出来,专注维护 MarkdownViewer、主题资源和相关测试。
envelope
| package | description |
|---|---|
CodeWF.Markdown |
Complete MarkdownViewer, supporting common Markdown elements, code highlighting, image previews, SVG/pictures, mathematical rendering extensions, multi-language resources and incremental rendering. |
CodeWF.Markdown.Themes |
Default control template and multiple sets of typography themes. |
installation
Install-Package CodeWF.Markdown
Install-Package CodeWF.Markdown.Themes
use
在 App.axaml 引入主题包:
<Application
xmlns="https://github.com/avaloniaui"
xmlns:markdown="https://codewf.com">
<Application.Styles>
<FluentTheme />
<markdown:MarkdownThemes TypographyTheme="Simple" />
</Application.Styles>
</Application>
在页面中使用 MarkdownViewer:
<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:md="https://codewf.com">
<ScrollViewer
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<md:MarkdownViewer Markdown="{Binding Markdown}" />
</ScrollViewer>
</UserControl>
warehouse structure
src/CodeWF.Markdown MarkdownViewer 类库
src/CodeWF.Markdown.Themes 控件模板和排版主题
src/CodeWF.Markdown.Sample 示例工程
tests/CodeWF.Markdown.Tests 渲染和差异服务测试
Suitable for attention
- Avalonia apps need to directly render Markdown content.
- You need to provide a unified typographical theme for documents, update logs, AI responses, or help centers.
- You need to support images, SVG, code highlighting, multi-language resources and incremental rendering.
- I hope to use sample projects to verify the performance of different Markdown content on the desktop.
build
dotnet restore CodeWF.Markdown.slnx
dotnet build CodeWF.Markdown.slnx --no-restore