Table of Contents

Method MarkdownToDocx

Namespace
LMKit.Document.Conversion
Assembly
LM-Kit.NET.dll

MarkdownToDocx(string, CancellationToken)

Converts Markdown text to a DOCX document represented as bytes.

public static byte[] MarkdownToDocx(string markdown, CancellationToken cancellation = default)

Parameters

markdown string

The Markdown content to convert.

cancellation CancellationToken

A cancellation token used to cancel the conversion operation.

Returns

byte[]

A DOCX document as a byte array.

Examples

using LMKit.Document.Conversion;

string markdown = "# Weekly Update\n\n- Completed API docs";
byte[] docxBytes = MarkdownDocxConverter.MarkdownToDocx(markdown);
File.WriteAllBytes("weekly-update.docx", docxBytes);

Exceptions

ArgumentNullException

Thrown when markdown is null.