markdown-to-docx

Convert Markdown files to DOCX with Mermaid diagrams and a table of contents.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/desmondc9/agent-skills --skill markdown-to-docx-desmondc9
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: markdown-to-docx
Source: https://github.com/desmondc9/agent-skills/tree/main/markdown-to-docx
Command: npx skills add https://github.com/desmondc9/agent-skills --skill markdown-to-docx-desmondc9

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, and includes scripts (resource) components.

What problem does it solve?

This skill converts Markdown documents into formatted Word (.docx) files, preserving structure, embedded Mermaid diagrams, and a native Table of Contents.

Core Features & Use Cases

  • Pre-processes Markdown to ensure proper TOC placement and injects Word TOC logic after the header.
  • Renders Mermaid diagrams to high-resolution PNGs and embeds them in the document.
  • Post-processes the DOCX to apply table styling (header row formatting, borders) and maintain consistent appearance.
  • Use cases include technical reports, product documentation, and notes authored in Markdown that need shareable Word output.

Quick Start

Run the converter to produce a DOCX from a Markdown file by executing the script with your input file.

Frequently Asked Questions about markdown-to-docx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to Word with a table of contents and Mermaid diagrams?▼

To convert Markdown to Word, this skill applies a Pandoc-based pipeline that renders Mermaid diagrams to PNGs, embeds them in the document, and post-processes the DOCX to inject a native table of contents and style tables.

How do I generate a formatted Word document from Markdown notes?▼

Generating a formatted Word document from Markdown notes involves executing the conversion script with your input file, which processes headings and applies border styling to ensure a consistent, shareable DOCX output.

Does Pandoc support embedding Mermaid diagrams when converting Markdown to DOCX?▼

Pandoc does not natively render Mermaid diagrams into DOCX, so this skill pre-processes the Markdown to render diagrams into high-resolution PNG images before embedding them in the final Word document.

What is the best way to convert technical reports from Markdown to Word with table styling?▼

The best way to convert technical reports is using an automated pipeline that post-processes the DOCX output to apply header row formatting and borders, ensuring the Markdown structure translates into polished Word formatting.

Do I need python-docx to apply table borders in a converted Word document?▼

Yes, python-docx is required as a dependency to post-process the generated DOCX file and apply table styling, including header row formatting and consistent border appearance.

Why does my Markdown to Word conversion lack a native table of contents?▼

A Markdown to Word conversion lacks a native table of contents when TOC logic is not injected, so this skill pre-processes headings and injects Word TOC logic after the header to ensure proper placement.