Markdig.Signed 0.30.4

.NET 6.0 .NET Core 3.1 .NET Standard 2.0 .NET Framework 4.5.2
NuGet\Install-Package Markdig.Signed -Version 0.30.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
dotnet add package Markdig.Signed --version 0.30.4
<PackageReference Include="Markdig.Signed" Version="0.30.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Markdig.Signed --version 0.30.4
#r "nuget: Markdig.Signed, 0.30.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Markdig.Signed as a Cake Addin
#addin nuget:?package=Markdig.Signed&version=0.30.4

// Install Markdig.Signed as a Cake Tool
#tool nuget:?package=Markdig.Signed&version=0.30.4

Markdig Build Status Coverage Status NuGet Donate

<img align="right" width="160px" height="160px" src="img/markdig.png">

Markdig is a fast, powerful, 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!

You can try Markdig online and compare it to other implementations on babelmark3

Features

If you are looking for support for an old .NET Framework 3.5 or 4.0, you can download Markdig 0.18.3.

Third Party Extensions

Documentation

The repository is under construction. There will be a dedicated website and proper documentation at some point!

While there is not yet a dedicated documentation, you can find from the specs documentation how to use these extensions.

In the meantime, you can have a "behind the scene" article about Markdig in my blog post "Implementing a Markdown Engine for .NET"

Download

Markdig is available as a NuGet package: NuGet

Also Markdig.Signed NuGet package provides signed assemblies.

Usage

The main entry point for the API is the Markdig.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 most of all advanced extensions (except Emoji, SoftLine as HardLine, Bootstrap, YAML Front Matter, JiraLinks and SmartyPants)

// Configure the pipeline with all advanced extensions active
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml("This is a text with some *emphasis*", pipeline);

Try it online!

You can have a look at the MarkdownExtensions that describes all actionable extensions (by modifying the MarkdownPipeline)

Build

In order to build Markdig, you need to install .NET 6.0

License

This software is released under the BSD-Clause 2 license.

Benchmarking

The latest benchmark was collected on April 23 2022, against the following implementations:

  • Markdig (version: 0.30.2): itself
  • cmark (version: 0.30.2): Reference C implementation of CommonMark, no support for extensions
  • CommonMark.NET(master) (version: 0.15.1): CommonMark implementation for .NET, no support for extensions, port of cmark, deprecated.
  • MarkdownSharp (version: 2.0.5): Open source C# implementation of Markdown processor, as featured previously on Stack Overflow, regexp based.
// * Summary *

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
AMD Ryzen 9 5950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=6.0.202
  [Host]     : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT
  DefaultJob : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT


|            Method |       Mean |     Error |    StdDev |
|------------------ |-----------:|----------:|----------:|
|           markdig |   1.979 ms | 0.0221 ms | 0.0185 ms |
|             cmark |   2.571 ms | 0.0081 ms | 0.0076 ms |
|    CommonMark.NET |   2.016 ms | 0.0169 ms | 0.0158 ms |
|     MarkdownSharp | 221.455 ms | 1.4442 ms | 1.3509 ms |
  • Markdig is roughly x100 times faster than MarkdownSharp
  • 20% faster than the reference cmark C implementation

If you are using this library and find it useful for your project, please consider a donation for it!

Donate

Credits

Thanks to the fantastic work done by John Mac Farlane for the CommonMark specs and all the people involved in making Markdown a better standard!

This project would not have been possible without this huge foundation.

Thanks also to the project BenchmarkDotNet that makes benchmarking so easy to setup!

Some decoding part (e.g HTML EntityHelper.cs) have been re-used from CommonMark.NET

Thanks to the work done by @clarkd on the JIRA Link extension (https://github.com/clarkd/MarkdigJiraLinker), now included with this project!

Author

Alexandre MUTEL aka xoofx

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.5.2

  • .NETStandard 2.0

  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (37)

Showing the top 5 NuGet packages that depend on Markdig.Signed:

Package Downloads
Microsoft.PowerShell.MarkdownRender The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

MarkdownRenderer for PowerShell

Microsoft.Quantum.Compiler The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

The Q# compiler.

Microsoft.Jupyter.Core The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Provides support for writing Jupyter kernels using the .NET Core SDK.

Microsoft.Quantum.CSharpGeneration The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

C# code generation for executing Q# programs on a quantum simulator.

SIL.ReleaseTasks The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Several release related tasks that can work with a CHANGELOG.md file.

GitHub repositories (13)

Showing the top 5 popular GitHub repositories that depend on Markdig.Signed:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
abpframework/abp
Open Source Web Application Framework for ASP.NET Core
JustArchiNET/ArchiSteamFarm
C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
OrchardCMS/Orchard
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
github/VisualStudio
GitHub Extension for Visual Studio
Version Downloads Last updated
0.30.4 1,531 9/27/2022
0.30.3 7,734 8/12/2022
0.30.2 45,523 4/23/2022
0.30.1 1,125 4/22/2022
0.30.0 466 4/21/2022
0.29.0 1,808 4/20/2022
0.28.1 5,959 3/27/2022
0.28.0 3,332 3/11/2022
0.27.0 17,682 1/23/2022
0.26.0 128,129 8/27/2021
0.25.0 21,824 6/10/2021
0.24.0 26,473 3/20/2021
0.23.0 41,493 1/16/2021
0.22.1 15,791 12/2/2020
0.22.0 697,816 10/5/2020
0.21.1 789,911 8/17/2020
0.20.0 428,744 4/18/2020
0.18.3 671,608 3/8/2020
0.18.2 440 3/8/2020
0.18.1 158,436 1/21/2020
0.18.0 90,924 10/24/2019
0.17.1 610,936 7/4/2019
0.17.0 237,353 5/11/2019
0.16.0 104,417 2/25/2019
0.15.7 58,201 1/11/2019
0.15.6 173,968 12/28/2018
0.15.5 3,167 12/11/2018
0.15.4 176,849 10/7/2018
0.15.3 3,049 9/26/2018
0.15.2 137,545 8/21/2018
0.15.1 354,029 7/10/2018
0.15.0 2,472 4/4/2018
0.14.9 9,540 1/15/2018
0.14.8 2,254 12/5/2017
0.14.7 820 11/25/2017
0.14.6 1,029 11/21/2017
0.14.5 1,033 11/18/2017
0.14.4 996 11/18/2017
0.14.3 2,117 11/1/2017
0.14.2 1,007 11/1/2017
0.14.1 1,028 10/27/2017
0.14.0 1,003 10/27/2017
0.13.4 1,077 10/17/2017
0.13.3 17,743 8/30/2017
0.13.2 838 8/29/2017
0.13.1 846 8/21/2017
0.13.0 12,890 8/3/2017
0.12.4 1,033 8/3/2017