mirror of
https://github.com/xoofx/markdig.git
synced 2026-10-08 22:57:51 +00:00
v0.1.0
Markdig 
Markdig is a fast, powerfull, CommonMark compliant, extensible Markdown processor for .NET.
NOTE: The repository is under construction. There will be a dedicated website and proper documentation at some point!
Features
- Very fast parser (no-regexp), very lightweight in terms of GC pressure. See benchmarks
- Abstract Syntax Tree
- Converter to HTML
- Passing more than 600+ tests from the latest CommonMark specs
- Includes all the core elements of CommonMark:
- including GFM fenced code blocks.
- Extensible architecture
- Built-in with 18+ extensions, including:
- Abbreviations (inspired from PHP Markdown Extra - Abbreviations)
- Auto-identifiers for headings (similar to Pandoc
- Bootstrap class (to output bootstrap class)
- Citation text by enclosing
""...""(inspired by this CommonMark discussion ) - Custom containers similar to fenced code block
:::for generating a proper<div>...</div>instead (inspired by this CommonMark discussion ) - Definition lists (inspired from PHP Markdown Extra - Definitions Lists)
- Emoji support (inspired from Markdown-it)
- Extra emphasis (inspired from Pandoc and Markdown-it)
- strike through
~~, - Subscript
~ - Superscript
^ - Inserted
++ - Marked
==
- strike through
- Figures (inspired from this CommonMark discussion)
- Footers (inspired from this CommonMark discussion)
- Footnotes (inspired from PHP Markdown Extra - Footnotes)
- Special attributes or attached HTML attributes (inspired from PHP Markdown Extra - Footnotes)
- Soft lines as hard lines
- Extra bullet lists, supporting alpha bullet
a.b.and roman bullet (i,ii...etc.) - Mathematics/Latex extension by enclosing
$$for block and$for inline math (inspired from this CommonMark discussion) - Embed player for media url (youtube, vimeo, mp4...etc.) (inspired from this CommonMark discussion)
- SmartyPants (inspired from Daring Fireball - SmartyPants)
- Tables:
- Compatible with .NET 3.5, 4.0+ and .NET Core (
netstandard1.1+)
Download
Markdig is available as a NuGet package:
Usage
The main entry point for the API is the Markdown class:
By default, without any options, Markdig is using the plain CommonMark parser:
var result = Markdown.ToHtml("This is a text with some **emphasis**");
Console.WriteLine(result); // prints: <p>This is a text with some <em>emphasis</em></p>
In order to activate all extensions (except Emoji)
var result = Markdown.ToHtml("This is a text with some **emphasis**", new MarkdownPipeline().UseAllExtensions());
You can have a look at the MarkdownPipeline file that describes all actionable extensions.
License
This software is released under the BSD-Clause 2 license.
Author
Alexandre MUTEL aka xoofx
Description
Releases
21
Languages
C#
99.9%