GHSoftware.MarkdownToRtf
0.1.0
dotnet add package GHSoftware.MarkdownToRtf --version 0.1.0
NuGet\Install-Package GHSoftware.MarkdownToRtf -Version 0.1.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="GHSoftware.MarkdownToRtf" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GHSoftware.MarkdownToRtf --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GHSoftware.MarkdownToRtf, 0.1.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.
// Install GHSoftware.MarkdownToRtf as a Cake Addin #addin nuget:?package=GHSoftware.MarkdownToRtf&version=0.1.0 // Install GHSoftware.MarkdownToRtf as a Cake Tool #tool nuget:?package=GHSoftware.MarkdownToRtf&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MarkdownToRtf
MarkdownToRtf is a basic C# library that converts Markdown to RTF (Rich Text Format). It supports standard Markdown elements such as headings, bold, italic, underline, lists, and more.
Features
- Markdown parsing: Converts Markdown syntax into RTF.
- Standard elements:
- Headings (
# Heading 1
,## Heading 2
, etc.) - Bold (
**bold**
) - Italic (
*italic*
) - Underline (
__underline__
) - Ordered and unordered lists (
1. Item
,- Bullet
)
- Headings (
- RTF output: Generates a valid RTF string that can be saved to a file or rendered in controls like
RichTextBox
.
Usage
Basic Example
using MarkdownToRtf;
class Program
{
static void Main()
{
string markdown = @"
# Heading 1
This is **bold**, *italic*, and __underline__ text.
1. First item
2. Second item
- Bullet 1
- Bullet 2
";
string rtf = MarkdownToRtfConverter.Convert(markdown);
Console.WriteLine(rtf);
// Save to file or use in a RichTextBox
}
}
Output
Input Markdown:
# Heading 1
This is **bold**, *italic*, and __underline__ text.
1. First item
2. Second item
- Bullet 1
- Bullet 2
Output RTF (simplified for readability):
{\rtf1\ansi\deff0
\pard\sa180\fs30 \b Heading 1\b0\par
\pard\ This is \b bold \b0 , \i italic \i0 , and \ul underline \ulnone text.\par
\pard\ 1. First item\par
\pard\ 2. Second item\par
\pard\ \bullet Bullet 1\par
\pard\ \bullet Bullet 2\par
}
Requirements
- .NET 6 or higher (check the csproj)
- Markdig (Markdown parser)
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Markdig (>= 0.40.0)
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 |
---|---|---|
0.1.0 | 69 | 1/15/2025 |