OfficeIMO.Word.Markdown 1.0.33

Prefix Reserved
dotnet add package OfficeIMO.Word.Markdown --version 1.0.33
                    
NuGet\Install-Package OfficeIMO.Word.Markdown -Version 1.0.33
                    
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="OfficeIMO.Word.Markdown" Version="1.0.33" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.Word.Markdown" Version="1.0.33" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.Word.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 OfficeIMO.Word.Markdown --version 1.0.33
                    
#r "nuget: OfficeIMO.Word.Markdown, 1.0.33"
                    
#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 OfficeIMO.Word.Markdown@1.0.33
                    
#: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=OfficeIMO.Word.Markdown&version=1.0.33
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.Word.Markdown&version=1.0.33
                    
Install as a Cake Tool

OfficeIMO.Word.Markdown — Markdown ↔ Word Converters

Converters between Word documents and Markdown, built on top of OfficeIMO.Word and OfficeIMO.Markdown.

What it does

  • Convert Word → Markdown with GitHub‑friendly output (headings, lists incl. tasks, tables with alignment, images, links, code, footnotes).
  • Convert Markdown → Word using OfficeIMO.Markdown’s typed model (maps to real Word constructs).

Usage

using OfficeIMO.Word;
using OfficeIMO.Word.Markdown;

using var doc = WordDocument.Create();
doc.AddParagraph("Hello");
var md = doc.ToMarkdown();            // Word → Markdown

using var doc2 = "# Title\nBody".LoadFromMarkdown(); // Markdown → Word

AST-first Markdown → Word

using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Html;
using OfficeIMO.Word.Markdown;

var markdownDoc = "<table><tr><td><p>Line 1</p><p>Line 2</p></td></tr></table>".LoadFromHtml();
using var doc3 = markdownDoc.ToWordDocument();
  • Use MarkdownDoc.ToWordDocument() when you already have a typed AST and want to avoid flattening back to markdown text before Word conversion.

HTML → Word via Markdown AST

using OfficeIMO.Word.Markdown;

using var doc4 = "<table><tr><td><p>Line 1</p><p>Line 2</p></td></tr></table>"
    .LoadFromHtmlViaMarkdown();
  • Use LoadFromHtmlViaMarkdown() when your source is HTML but you want the AST-first markdown bridge instead of flattening HTML into markdown text first.

HTML via Markdown

using OfficeIMO.Markdown;
var html = doc.ToHtmlViaMarkdown();           // full HTML document (defaults to HtmlStyle.Word)
var fragment = doc.ToHtmlFragmentViaMarkdown();
doc.SaveAsHtmlViaMarkdown("report.html");     // defaults to HtmlStyle.Word

// Override style if desired:
doc.SaveAsHtmlViaMarkdown("report.html", new HtmlOptions { Style = HtmlStyle.GithubAuto });

Notes

  • Default styling: ToHtmlViaMarkdown/SaveAsHtmlViaMarkdown use HtmlStyle.Word for a document‑like look.
  • TOC markers: [TOC], [[TOC]], {:toc}, and `` are recognized and rendered. Parameterized form: [TOC min=2 max=3 layout=sidebar-right sticky=true scrollspy=true title="On this page"].
  • Table cells: inline markdown (code/links/emphasis/images) is supported and <br> becomes a real line break in HTML.
  • AST-preserved inline HTML wrappers such as <u>, <sub>, and <sup> map to real Word run formatting during Markdown → Word conversion.
  • Inline tags without a native Word run equivalent degrade intentionally on the Word leg: <ins> is treated as underline semantics and <q> roundtrips as literal quoted text.

Markdown → Word image layout options

var options = new MarkdownToWordOptions {
    AllowLocalImages = true,
    FitImagesToPageContentWidth = true,           // page width minus margins
    MaxImageWidthPercentOfContent = 85            // optional percent-based cap
};

using var doc = markdown.LoadFromMarkdown(options);
  • Typed contract is available via MarkdownToWordOptions.ImageLayout.
  • PreferNarrativeSingleLineDefinitions = true keeps isolated Label: value lines as narrative paragraphs while still allowing grouped definition-list blocks.
  • OnImageLayoutDiagnostic can be used to inspect final width/height and applied layout constraints.

Explicit IntelligenceX transcript contract

var options = MarkdownToWordPresets.CreateIntelligenceXTranscript(
    allowedImageDirectories: new[] { @"C:\Exports\Images" },
    visualMaxWidthPx: 760);

using var doc = markdown.LoadFromMarkdown(options);
  • MarkdownToWordPresets.CreateIntelligenceXTranscript(...) is the explicit DOCX preset for IX transcript export.
  • That preset now reuses the shared MarkdownTranscriptPreparation.CreateIntelligenceXTranscriptReaderOptions(...) contract, including legacy IX visual JSON upgrades through document transforms.
  • MarkdownToWordCapabilities.PreservesNarrativeSingleLineDefinitionsAsSeparateParagraphs() exposes the grouped Label: value capability probe as a reusable OfficeIMO contract instead of host-local reflection logic.

Supported features (core)

  • Headings 1–6, paragraphs, hard breaks
  • Lists (unordered, ordered) and task items
  • Tables with per‑column alignment
  • Images (alt/title; size hints when provided in Markdown)
  • Links and autolinks
  • Code spans/blocks
  • AST-preserved inline HTML wrappers for underline, superscript, and subscript
  • Footnotes
  • Front matter passthrough when using OfficeIMO.Markdown model
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OfficeIMO.Word.Markdown:

Package Downloads
OfficeIMO.Reader

Unified, read-only document extraction facade for OfficeIMO (Word/Excel/PowerPoint/Markdown/PDF) intended for AI ingestion.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OfficeIMO.Word.Markdown:

Repository Stars
EvotecIT/PSWriteOffice
PowerShell Module to create and edit Microsoft Word, Microsoft Excel, and Microsoft PowerPoint documents without having Microsoft Office installed.
Version Downloads Last Updated
1.0.33 434 5/27/2026
1.0.32 509 5/26/2026
1.0.31 445 5/26/2026
1.0.30 507 5/23/2026
1.0.29 482 5/22/2026
1.0.28 430 5/21/2026
1.0.27 440 5/21/2026
1.0.26 448 5/20/2026
1.0.25 450 5/19/2026
1.0.24 417 5/18/2026
1.0.23 679 5/16/2026
1.0.22 445 5/14/2026
1.0.21 628 5/14/2026
1.0.20 673 5/7/2026
1.0.19 542 5/1/2026
1.0.18 435 4/27/2026
1.0.17 689 4/10/2026
1.0.16 148 4/9/2026
1.0.15 372 4/3/2026
1.0.14 156 4/1/2026
Loading failed