md-to-docx — GitHub Copilot skill: Markdown to Word
Turns a Markdown file into a Word document with a title page, table of contents and embedded PNGs. Useful when a .md draft has to reach people as .docx.
npx skills add github/awesome-copilot --skill md-to-docxWhat md-to-docx does
The skill runs a Node.js script, scripts/md-to-docx.mjs, which reads your .md and builds a .docx with the docx and marked npm packages. No Pandoc, no LibreOffice, no native binaries. It works on Windows, macOS and Linux.
What lands in the document: a title page filled from YAML front-matter (title, date, version, audience), a table of contents from H1–H3 headings, tables, code blocks, lists and links. Images written as  are resolved relative to the input .md, dimensions come from the PNG header, and width is capped at 6 inches. A missing file leaves [Image not found: ] behind.
You need Node.js 18+ and a one-time npm install inside skills/md-to-docx/scripts. Worth installing if your docs live in Markdown and reviewers keep asking for Word. If everything already flows through Google Docs or Confluence, the script just adds a step.
What it helps with
- turn a README into a .docx for review
- embed PNG diagrams inline in the Word file
- get a title page and table of contents without manual layout
- hand a client a Word version of technical docs
- merge a set of .md files into one document with tables and code
Example prompts for the agent
- Convert docs/architecture.md to Word
- Build a .docx from README.md with the images in diagrams
- Run md-to-docx on the report and pull the title from front-matter
How to install md-to-docx
1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill md-to-docx2GitHub CLI
gh skill install github/awesome-copilot md-to-docx3Manually: put the files in place
.github/skills/md-to-docx/SKILL.md1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill md-to-docx -a claude-code2Manually: put the files in place
~/.claude/skills/md-to-docx/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/md-to-docx/
Manually: put the files in place
.agents/skills/md-to-docx/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/md-to-docx/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
Platform CLI
gemini skills install https://github.com/github/awesome-copilot --path skills/md-to-docxManually: put the files in place
.devin/skills/md-to-docx/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set554
The whole set →Similar
Questions about md-to-docx
How do I install md-to-docx in GitHub Copilot?
Run npx skills add github/awesome-copilot --skill md-to-docx or gh skill install github/awesome-copilot md-to-docx. The skill file ends up at .github/skills/md-to-docx/SKILL.md.
What does md-to-docx do?
It converts Markdown into .docx with a title page, table of contents, tables, code and embedded PNGs. All in pure JavaScript, no external tools.
What does the skill need to run?
Node.js 18+ plus the docx 9+ and marked 15+ dependencies, installed with npm install in skills/md-to-docx/scripts.
Source text
SKILL.md · MIT
--- name: md-to-docx description: Convert Markdown files to professionally formatted Word (.docx) documents with embedded PNG images — pure JavaScript, no external tools required --- # Markdown to Word (.docx) Skill Convert Markdown (`.md`) files into professionally formatted Word (`.docx`) documents with embedded PNG images. Uses **pure JavaScript** via the `docx` and `marked` npm packages — no Pandoc, LibreOffice, or any native binary required. ## How to Convert ```bash # Install dependencies (one-time, from the scripts folder) cd skills/md-to-docx/scripts && npm install # Convert (run from workspace root) node skills/md-to-docx/scripts/md-to-docx.mjs <input.md> [output.docx] ``` If `output.docx` is omitted, it defaults to `<input-basename>.docx` in the current directory. ## Skill Folder Contents | File | Purpose | |------|---------| | `SKILL.md` | This instruction file | | `scripts/md-to-docx.mjs` | Node.js Markdown-to-Word converter | | `scripts/package.json` | Dependencies (`docx`, `marked`) | ## Prerequisites | Requirement | Version | Notes | |-------------|---------|-------| | **Node.js** | 18+ | Required runtime | | **`docx`** | 9+ | Pure JS Word document generator | | **`marked`** | 15+ | Markdown parser | No native binaries. No system-level installs. Works on Windows, macOS, and Linux. ## Features The converter: - **Extracts YAML front-matter** — uses `title`, `date`, `version`, `audience` for the title page - **Generates a title page** — with project name, subtitle, date, version, and audience - **Generates a table of contents** — built from H1-H3 headings - **Embeds PNG images** — resolves `` references relative to the input `.md` file, reads the PNG, and embeds it inline in the Word document - **Styled output** — Calibri font, colored headings (`#1F3864`), styled tables with alternating row colors, code blocks in Consolas - **Handles all Markdown elements** — headings, paragraphs, tables, code blocks, lists, images, links, horizontal rules ## Image Embedding The converter automatically embeds PNG images referenced in the Markdown: ```markdown  ``` The image path is resolved **relative to the input Markdown file**. The PNG is read, dimensions are extracted from the PNG header, and the image is scaled to fit within 6 inches width while preserving aspect ratio. If an image file is not found, a placeholder `[Image not found: <path>]` is inserted. ## Front-Matter Format ```yaml --- title: Project Name — Project Summary date: 2025-01-15 version: 1.0 audience: Engineering Team, Architects, Stakeholders --- ``` The title is split on `—` or `–` into main title and subtitle for the title page.
© github · MIT · github/awesome-copilot