Code Monkey home page Code Monkey logo

neomarkdigxaml's Introduction

Neo.Markdig.Xaml

Is a xaml/wpf extension for lunet-io/markdig

With this library it is possible to create FlowDocument's

var content = File.ReadAllText(@"..\..\..\..\Readme.md");
var doc = MarkdownXaml.ToFlowDocument(content,
	new MarkdownPipelineBuilder()
	.UseXamlSupportedExtensions()
	.Build()
);
flowDocumentViewer.Document = doc;

or Xaml-Source files.

var content = File.ReadAllText(@"..\..\..\..\Readme.md");
var xaml = MarkdownXaml.ToXaml(content,
	new MarkdownPipelineBuilder()
	.UseXamlSupportedExtensions()
	.Build()
);

Features

Supports standard features from Markdig.

Additionally, the following extensions are supported:

Styles

It is possible to replace the default resource set.

Inherit from XamlMarkdownWriter and override the method GetDefaultStyle.

Difference to markdig.wpf

markdig.wpf implements two renderers, one for xaml-output and one for wpf-objects.

This implementation has only one renderer, that has a xaml-token-stream as output. This stream can written with framework implemented XamlXmlWriter or the XamlObjectWriter.

Numbers:

Markdig.Wpf-toxaml  : 109ms
Markdig.Xaml-toxaml : 850ms
Markdig.Wpf-towpf   : 12.579ms
Markdig.Xaml-towpf  : 6.882ms

If you want to create plain xaml text output, my library is a slower. The reason is, that my implementation validates the output against the wpf-object-schema. That is one expensive step more, but it ensures a valid wpf-xaml.

The object creation should be always faster in Neo.Markdig.Xaml than the Markdig.Wpf approach, because Neo.Markdig.Xaml uses the internal wpf-object creation with all is caching and replay mechanism.

Needs to prove: Neo.Markdig.Xaml should consume less memory on large documents in both cases.

Links

What is missing

Testing.

neomarkdigxaml's People

Contributors

exactamente avatar jairbubbles avatar neolithos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.