I converted the report and saved it as .claude/skills/md-to-docx/sample/report.docx (11 KB). The dependencies installed with only an engine warning: nanoid wants Node 22 or later and this machine has v20.19.0. The conversion ran fine anyway. The description below comes from the document XML, not just the script's success message.
What the document contains
- Title page: "Q3 Platform Review" as the title, "Summary for Engineering" as the subtitle, then "Date: 2026-10-01 | Version: 1.2" and "Audience: Engineering, Product". It is followed by a page break.
- Table of contents: It lists Highlights, Key numbers (indented as a sub-entry) and Plan, then a page break.
- Sections:
- Highlights (heading 2) has a paragraph with bold "18%", italic "0.2%",
status.mdin Consolas with a grey background, and "the dashboard" in blue underline. - Key numbers (heading 3) holds the table.
- Plan (heading 2) has the numbered list "1. Migrate the queue" and "2. Add retries", with "exponential backoff" and "jitter" as indented bullets.
- A Python code block follows, in Consolas on a grey background.
- The document ends with the Chinese paragraph (中文段落:延迟下降 18%。), a horizontal rule and "Done."
- Highlights (heading 2) has a paragraph with bold "18%", italic "0.2%",
- Table: It has 3 columns (Metric, Q2, Q3) and 2 data rows, p95 latency (420 → 344) and Error rate (0.3% → 0.19%). The header row is shaded and repeats across pages, and the rows alternate in colour.
- Image:
diagrams/arch.pngis embedded, centred, with the caption "Architecture".
What did not convert cleanly
- Missing image:
diagrams/nope.pngwas not found, so the document has the placeholder text[Image not found: diagrams/nope.png]. - Mermaid diagram: It was not rendered. The document has the placeholder "[Diagram: See source .md file for interactive Mermaid diagram]".
- Tiny image: The embedded architecture image is only about 0.4 × 0.2 inches (381000 × 190500 EMU). The source PNG is probably a tiny placeholder, so it will look very small in Word.
- Dropped H1: The
# Q3 Platform Review — Summary for Engineeringheading does not appear in the body or the table of contents. Its text is only on the title page. - Link has no URL: "the dashboard" is styled as a link, but there is no hyperlink element in the file, so the
https://example.com/dashURL is lost. - Static table of contents: It is plain text with no page numbers and no links, so it won't update in Word.
- Fake lists: The list markers ("1.", "•") are typed characters with indentation, not real Word lists.
- Code language dropped: The code block keeps its text but not the
pythonlanguage tag, and there is no syntax highlighting. - Chinese font: The Chinese text is set in Calibri, which has no CJK glyphs, so Word will substitute a fallback font. I didn't check how it looks.
试用方式:Skill 需要 npm 依赖,我让模型先执行文档里的 npm install,再转换我构造的示例 Markdown(含封面信息、表格、嵌套列表、代码块、PNG 图片、一个故意缺失的图片、Mermaid 代码块、中文段落);Bash 只放行 npm install、转换命令和查看 docx 内部 XML 这三条。我另外手动解压 docx 核对,模型的描述与实际一致。示例中的 PNG 只是 40×20 像素的占位图,所以文中说它在文档里很小。
하는 일
동봉된 Node.js 스크립트를 실행해 npm 패키지 docx와 marked로 .md 파일을 .docx로 바꿉니다. Pandoc이나 LibreOffice는 필요 없습니다. YAML 앞부분 정보(제목, 날짜, 버전, 대상 독자)로 표지를 만들고, H1~H3 제목으로 목차를 만들며, 제목, 줄마다 색이 번갈아 바뀌는 표, 코드 블록에 스타일을 입히고, 목록, 링크, 구분선을 처리하고, Markdown에서 참조한 PNG 이미지를 삽입합니다(경로는 파일 기준 상대 경로, 너비는 약 6인치로 축소). Mermaid 블록은 한 줄짜리 자리 표시 문구가 됩니다.
동작 방식
- scripts 폴더에서 한 번
npm install을 실행합니다. node md-to-docx.mjs input.md [output.docx]를 실행합니다. 출력 이름을 생략하면 현재 디렉터리에 입력 파일 이름으로 만듭니다.
이런 때 좋습니다
Markdown으로 쓴 문서, 명세서, 보고서를 공유용 Word 파일로 바꿀 때.
중간 위험:Node 스크립트를 실행하며 `npm install`(`docx`와 `marked` 내려받기)이 필요합니다. `.docx`를 출력 경로에 쓰고 같은 이름의 파일은 묻지 않고 바꿔 버리므로 새 이름을 쓰거나 백업하세요. Markdown의 이미지 경로는 입력 파일 기준으로 해석되며 그 폴더로 제한되지 않고 PNG인지도 확인하지 않으므로, 출처가 불분명한 Markdown을 변환하면 디스크의 다른 파일이 문서에 들어갈 수 있습니다. 스크립트는 네트워크 요청을 하지 않습니다. 시험 실행했고 변환 결과는 정확했습니다. 제한: 링크는 글자만 남고 URL은 사라집니다. 목차는 정적인 텍스트로 페이지 번호나 이동이 없습니다. 목록은 문자로 흉내 낸 것입니다. PNG만 삽입되며 다른 이미지 형식은 PNG로 기록되어 표시되지 않을 수 있습니다.