word-docs

Convert markdown drafts into styled Word documents using pypandoc and python-docx.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/Lawrence908/chiron --skill word-docs-lawrence908
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: word-docs
Source: https://github.com/Lawrence908/chiron/tree/main/plugins/writing/skills/word-docs
Command: npx skills add https://github.com/Lawrence908/chiron --skill word-docs-lawrence908

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypandoc-binary, python-docx, @mermaid-js/mermaid-cli, and includes scripts (resource) components.

What problem does it solve? Turning an existing markdown draft into a polished, shareable .docx file is tedious: plain pandoc output lacks table borders, code styling, and proper margins, and mermaid diagrams do not render at all. This Skill packages markdown into a styled Word document while keeping the markdown as the canonical source. ## Core Features & Use Cases - Full-fidelity conversion: Uses pypandoc to convert markdown tables, lists, code blocks, links, and headings into .docx, with a python-docx fallback script when pandoc is unavailable. - Styling pass: A post-processing script adds grid borders and shaded bold header rows to tables, grey backgrounds with Consolas font to code blocks, and configurable page margins. - Mermaid diagram handling: Pre-renders mermaid blocks to PNG via mermaid-cli and swaps image references into a temporary markdown before conversion. - Use Case: You finished a technical spec in markdown and a stakeholder needs it in Word format. Run the conversion and styling pipeline to produce a formatted .docx with real tables and styled code, without touching the prose. ## Quick Start Convert my markdown draft report.md into a styled Word document with tables and code blocks formatted, keeping the markdown file as the source of truth.

Frequently Asked Questions about word-docs

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

FAQPage Schema
How do I convert markdown to Word docx in Python?▼

Use pypandoc to convert markdown to docx with full fidelity for tables, lists, code blocks, and links. Call pypandoc.convert_file with the source markdown path and an output .docx path, then optionally post-process with python-docx for styling.

How to style tables and code blocks in a pandoc-generated docx?▼

Run a python-docx post-processing pass on the pandoc output. The style_docx.py script adds grid borders and shaded bold header rows to tables, grey backgrounds with Consolas 9pt font to code blocks, and configurable page margins.

Does pandoc render mermaid diagrams in Word documents?▼

No, pandoc does not render mermaid blocks. Keep the mermaid blocks in the markdown for GitHub rendering, then extract them at build time, render to PNG with mermaid-cli (mmdc), and convert a temporary markdown with image references swapped in.

What if pypandoc or pandoc is not installed?▼

A fallback script md_to_docx.py uses python-docx directly, but it only supports # and ## headings, paragraphs, inline links, bold, and inline code. It does not handle tables, lists, or fenced code blocks, so install pypandoc-binary whenever possible.

When should I not convert markdown to docx?▼

Skip conversion when the recipient can read markdown, when you need PDF output (pandoc handles that directly), or when you are still authoring prose. Write and revise the markdown first, then package it as docx only as a final delivery step.