Chuyển đến nội dung
Skillpedia
Viết lách40k · #7285

md-to-docx

Skill này làm gì

Công cụ này biến văn bản viết bằng định dạng Markdown (.md) thành tài liệu Word (.docx) trông chuyên nghiệp. Nó cũng đưa vào các ảnh PNG mà bạn đã tham chiếu trong văn bản.

Khi nào nên dùng

  • ✓Khi bạn cần biến bản nháp thành một tài liệu chính thức.
  • ✓Khi bạn muốn tự động tạo mục lục từ các tiêu đề.
  • ✓Khi bạn cần chia sẻ tài liệu phải mở được bằng Word.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/md-to-docx/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/md-to-docx/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chuyển file Markdown này sang Word: my_document.md”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cung cấp một file văn bản viết bằng Markdown. Công cụ dùng chương trình Node.js để đọc văn bản, nhận diện tiêu đề, danh sách và ảnh, rồi tạo một file mới ở định dạng Word (.docx).

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Câu hỏi thường gặp

Tôi có cần cài đặt gì phức tạp không?

Bạn cần cài Node.js trên máy tính. Phần còn lại được thiết lập tự động khi bạn chạy lệnh cài đặt.

Nếu tôi có ảnh trong văn bản thì sao?

Nếu ảnh là định dạng PNG và nằm cùng vị trí hoặc trong thư mục liên quan với file Markdown, chúng sẽ được đưa vào tài liệu Word.

“YAML front-matter” là gì?

Đây là một đoạn văn bản nhỏ ở đầu file Markdown, nằm giữa ba dấu gạch ngang (---). Bạn có thể ghi các thông tin như tiêu đề, ngày tháng và đối tượng đọc cho tài liệu Word.

Chi tiết

Mô tả gốc của tác giả

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

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7285
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự