Catalog
github/md-to-docx

github

md-to-docx

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

global
New~677
v1.0Saved Jun 26, 2026

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

# 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:

![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

---
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.

Files3
3 files · 15.6 KB

Select a file to preview

Overall Score

82/100

Grade

B

Good

Safety

88

Quality

80

Clarity

85

Completeness

78

Summary

A pure JavaScript skill that converts Markdown files to professionally formatted Word documents (.docx) with embedded PNG images. It parses Markdown, extracts YAML front-matter for document metadata, generates a title page and table of contents, and embeds referenced images—all without requiring external tools like Pandoc or LibreOffice.

Detected Capabilities

file read (Markdown input)file read (PNG images)file write (.docx output)npm dependency installationYAML parsingimage dimension extractionNode.js script execution

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

convert markdown to wordgenerate word documentmarkdown to docxembed images in wordcreate technical reportconvert md to docx

Use Cases

  • Convert technical documentation to Word format for distribution
  • Generate professional project reports from Markdown templates
  • Embed diagrams and images into Word documents automatically
  • Create branded documents with title pages and tables of contents
  • Batch convert multiple Markdown files to Word format
  • Distribute documentation in .docx format without manual formatting

Quality Notes

  • Well-scoped skill with clear boundary between input (Markdown file) and output (Word document)
  • Clear prerequisites documented (Node.js 18+, npm dependencies)
  • Practical examples provided (folder structure, command usage, front-matter format)
  • Features comprehensively listed with specific formatting details (font, colors, dimensions)
  • Image embedding logic documented including fallback for missing files
  • No external network access, credential usage, or system-level operations
  • Clear command syntax with optional output parameter
  • File manifest confirms all supporting files are present
  • MIT license included and properly attributed
Model: claude-haiku-4-5-20251001Analyzed: Jun 26, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Add github/md-to-docx to your library

Command Palette

Search for a command to run...