Open.Markdown 1.0.0

dotnet add package Open.Markdown --version 1.0.0
                    
NuGet\Install-Package Open.Markdown -Version 1.0.0
                    
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.
<PackageReference Include="Open.Markdown" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Open.Markdown" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Open.Markdown" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Open.Markdown --version 1.0.0
                    
#r "nuget: Open.Markdown, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Open.Markdown@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Open.Markdown&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Open.Markdown&version=1.0.0
                    
Install as a Cake Tool

OpenMarkdown

A lightweight, extensible Markdown parser for .NET, built with a clean, modular architecture. It provides a simple way to convert Markdown source into HTML, supporting multiple dialects.


Key Features

  • Extensible Architecture: Easily add new Markdown dialects by inheriting from the BaseMarkdown class.
  • CommonMark Support: The default CommonMarkdown renderer handles standard Markdown syntax.
  • GitHub Flavored Markdown (GFM): A dedicated GitHubFlavoredMarkdown renderer adds GFM features like tables, task lists, and strikethrough.
  • Simple API: A static OpenMarkDown utility class provides a clean, user-friendly interface for rendering.

Usage

1. Basic Usage (using the default renderer)

The library is pre-configured to use the CommonMarkdown renderer by default.

using OpenMarkdown;

string markdown = "# Hello, Markdown!\nThis is a **bold** paragraph.";
string html = OpenMarkDown.Render(markdown);
Console.WriteLine(html);
// Output: <h1>Hello, Markdown!</h1><p>This is a <strong>bold</strong> paragraph.</p>

2. Using a Specific Renderer

You can specify a different renderer for a one-off conversion using the generic Render<T> method.

using OpenMarkdown;
using OpenMarkdown.Dialects;

string gfmMarkdown = "- [x] Task list item\n\n~~Strikethrough~~";
string html = OpenMarkDown.Render<GitHubFlavoredMarkdown>(gfmMarkdown);
Console.WriteLine(html);
// Output: <ul><li class="task-list-item"><input type="checkbox" disabled checked /> Task list item</li></ul><p><del>Strikethrough</del></p>

3. Setting a Default Renderer

To change the default renderer for all subsequent OpenMarkDown.Render() calls, use the UseRenderer method.

using OpenMarkdown;
using OpenMarkdown.Dialects;

// Set GFM as the new default renderer
OpenMarkDown.UseRenderer<GitHubFlavoredMarkdown>();

string markdown = "A raw link: https://example.com";
string html = OpenMarkDown.Render(markdown); // Uses the new GFM default
Console.WriteLine(html);
// Output: <p>A raw link: <a href="https://example.com">https://example.com</a></p>

Project Structure

The project is designed to be modular and easy to navigate.

  • BaseMarkdown.cs: The abstract base class that defines the core rendering contract.
  • OpenMarkDown.cs: The static entry point for the library.
  • Dialects/: A folder containing specific Markdown dialect implementations.
    • CommonMarkdown.cs: The standard CommonMark renderer.
    • GitHubFlavoredMarkdown.cs: Extends CommonMarkdown to add GFM features.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 137 9/27/2025