MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Md-To-Docx

Md-To-Docx是一款code方向的AI技能,核心价值是Convert Markdown files to professionally formatted Word (,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Convert Markdown files to professionally formatted Word (.docx) documents with embedded PNG images — pure JavaScript, no external tools required

Last verified on: 2026-05-30
mkdir -p ./skills/md-to-docx && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/md-to-docx/SKILL.md -o ./skills/md-to-docx/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# 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 `![alt](path)` 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
![High-Level Architecture](diagrams/high-level-architecture.drawio.png)

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.

🎯 Best For

  • Technical writers
  • API documentation teams
  • UI designers
  • Product designers
  • Claude users

💡 Use Cases

  • Generating JSDoc/TSDoc comments
  • Writing README files for new projects
  • Generating component mockups
  • Creating design system tokens

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Md-To-Docx to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does it follow my documentation style?

Most documentation skills respect existing style. Provide a style guide or example in your prompt.

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Is Md-To-Docx compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Md-To-Docx?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Md-To-Docx?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/md-to-docx/SKILL.md, ready to use.

⚠️ Common Mistakes to Avoid

Auto-generating without reviewing

AI documentation can contain inaccuracies. Always verify technical accuracy.

Skipping usability testing

AI-generated designs should be validated with real users before development.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills