百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MdXaml

> 编程语言
开源

WPF 版 Markdown - Markdown.Xaml 的替代版本

332 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

WPF 版 Markdown - Markdown.Xaml 的替代版本

MdXaml

MdXaml is a modify version of Markdown.Xaml. It can convert Markdown to FlowDocument of WPF.

What is Markdown XAML?

see the origin project page

Markdown XAML is a port of the popular MarkdownSharp Markdown processor, but with one very significant difference: Instead of rendering to a string containing HTML, it renders to a FlowDocument suitable for embedding into a WPF window or usercontrol.

With HTML output, details of fonts and colours (and so on) are handled by CSS, but with a FlowDocument there's no direct equivalent. Instead of the HTML approach of linking a stylesheet to the rendered output, MarkDown.Xaml uses WPF styles that are linked to the rendering engine and applied to the output as it is generated. See the included demo application for an example of how this can be configured.

Sample

Nuget

https://www.nuget.org/packages/MdXaml/

Quick start

Convert markdown-string in a code.

cs
// using MdXaml;
// using System.Windows.Documents;

Markdown engine = new Markdown();

string markdownTxt = System.IO.File.ReadAllText("example.md");

FlowDocument document = engine.Transform(markdownTxt);

Write markdown in a xaml.

xml

	
		# sample title
		* document1
			* two
			* three
		* document2
	

We can use MarkdownScrollViewer with code-behind and with binding.

How to use (Markdown standard)

  • Transform markdow to flowdocument
  • Render markdown in Control
  • Image reading priority order

How to use (Markdown enhance)

  • list; alphabet-order, roman-order
  • table; row-span, columnspan
  • text alignment
  • text decoration(bold, italic, strikethrough, underline, color)

Development

IDE: Visual Studio 2022
Framework: .NET Framework 4.6.2, .NET 8

Build

  1. Clone the repository

    cmd
    git clone https://github.com/whistyun/MdXaml.git
  2. If you use VisualStudio, open MdXaml.sln.

    If you use dotnet CLI.

    cmd
    dotnet build

License

MdXaml is licensed under the MIT license.

Dependencies (Runtime)

  • MdXaml

    • None
  • MdXaml.SyntaxEditor

    • AvalonEdit (MIT) https://github.com/icsharpcode/AvalonEdit
  • MdXaml.Html

    • AvalonEdit (MIT) https://github.com/icsharpcode/AvalonEdit
    • HtmlAgilityPack (MIT) https://github.com/zzzprojects/html-agility-pack
  • MdXaml.Svg

    • Svg (MIT) https://github.com/svg-net/SVG
  • MdXaml.AnimatedGif

    • WpfAnimatedGif (Apache-2.0) https://github.com/XamlAnimatedGif/WpfAnimatedGif

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#flowdocumentmarkdownwpf

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言