Giter VIP home page Giter VIP logo

markdown.xaml's Introduction

Markdown XAML

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 approch 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.

Where would I use this?

I wrote this to use in a WPF application where I was generating paragraphs of text for that described the output of a rules engine, and I wanted a richer display than just a column of plain text.

Potentially, I could have used MarkdownSharp and an embeded browser or other HTML renderer to achieve this (the route taken by MarkPad, but this didn't give me the fine control over appearance that I desired.

Where shouldn't I use this?

If the Markdown you are processing is going to end up translated to HTML, stick with MarkdownSharp or one of the other similar translators, so that your rendering is as accurate as possible. On the otherhand, if you are showing the Markdown within your WPF application and not passing it out to a browser elsewhere, Markdown XAML may be a great fit.

What differences are there?

Since the output is not HTML, any embedded HTML is going to end up displayed as raw code. This also means that there's no way to bypass (or tunnel through) the Markdown engine to achieve anything not supported by Markdown directly. Depending on your context this may or may not be a significant issue.

What remains to be done?

The core of the Markdown render is complete, as is support for basic styling. The structure of the MarkdownSharp codebase has been retained to aid maintenance - if there are any regular expression fixes there, they should be easy to patch in here.

There are a number of Markdown extensions that could be supported, though since MarkdownSharp targets only the core, this would necessitate a departure from keeping the codebase as similar as possible.

License

Markdown XAML is licensed under the MIT license.

markdown.xaml's People

Contributors

francescoformenti avatar gpailler avatar theunrepentantgeek avatar thoemmi avatar trigger-segfault avatar whistyun 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.