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
markdownstringThe Markdown content to convert.
cancellationCancellationTokenA 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
markdownisnull.