Markdown for WPF - alternate version of Markdown.Xaml
MdXaml is a modify version of Markdown.Xaml. It can convert Markdown to FlowDocument of WPF.
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.
https://www.nuget.org/packages/MdXaml/
// using MdXaml;
// using System.Windows.Documents;
Markdown engine = new Markdown();
string markdownTxt = System.IO.File.ReadAllText("example.md");
FlowDocument document = engine.Transform(markdownTxt);
# sample title
* document1
* two
* three
* document2
We can use MarkdownScrollViewer with code-behind and with binding.
IDE: Visual Studio 2022
Framework: .NET Framework 4.6.2, .NET 8
Clone the repository
git clone https://github.com/whistyun/MdXaml.gitIf you use VisualStudio, open MdXaml.sln.
If you use dotnet CLI.
dotnet buildMdXaml is licensed under the MIT license.
MdXaml
MdXaml.SyntaxEditor
MdXaml.Html
MdXaml.Svg
MdXaml.AnimatedGif
No open issues yet, or sync has not completed.