• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DotMarkdown is Markdown framework for .NET

DotMarkdown

Introduction

  • DotMarkdown is a framework for creating markdown content
  • The library is distributed as NuGet.

Supported Frameworks

  • .NET Standard 1.3
  • .NET Framework 4.5

Documentation

Usage

Commonly Used Types

  • DotMarkdown.MarkdownWriter
  • DotMarkdown.MarkdownWriterSettings
  • DotMarkdown.MarkdownFormat
  • DotMarkdown.Linq.MFactory

How to Use MarkdownWriter

using System.Text;
using DotMarkdown;

var sb = new StringBuilder();

using (MarkdownWriter writer = MarkdownWriter.Create(sb))
{
    writer.WriteHeading1("Markdown Sample");
    writer.WriteHeading2("Bullet List");
    writer.WriteBulletItem("text");
    writer.WriteStartBulletItem();
    writer.WriteBold("bold text");
    writer.WriteEndBulletItem();

    writer.WriteHorizontalRule();

    writer.WriteHeading2("Indented Code Block");
    writer.WriteIndentedCodeBlock("string s = null;");
}

Console.WriteLine(sb.ToString());

Output

# Markdown Sample

## Bullet List

* text
* **bold text**
- - -

## Indented Code Block

    string s = null;

How to Use LINQ to Markdown

using DotMarkdown.Linq;
using static DotMarkdown.Linq.MFactory;

MDocument document = Document(
    Heading1("Markdown Sample"),
    Heading2("Bullet List"),
    BulletList(
        "text",
        Bold("bold text")),
    HorizontalRule(),
    Heading2("IndentedCodeBlock"),
    IndentedCodeBlock("string s = null;"));

Console.WriteLine(document.ToString());

Output

# Markdown Sample

## Bullet List

* text
* **bold text**

- - -

## IndentedCodeBlock

    string s = null;

Links