Markdown to Word
v0.6.0Convert GitHub Flavored Markdown to Word (.docx) documents in Node or the browser
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
convert_markdown_to_word Convert Markdown to Word
Convert GitHub Flavored Markdown to a formatted Word (.docx) document and write it to output_path. Pass exactly one of markdown (the text) or path (a Markdown file). Headings, lists, task lists, tables, code, links, and images become real Word formatting; the first heading becomes the document's title. Remote images are not downloaded: they appear as links (fetch one yourself and pass it as a data: URI to embed it). Returns the path and size of the .docx.
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Where to write the .docx; must end in .docx. Prefer an absolute path. Missing folders are created. Never written through a symlink. |
font_preset | string | Restyle the document: chinese-official sets the fonts, sizes, and page layout of a Chinese official document (公文) after GB/T 9704-2012. Omit for Word's default styling. |
markdown | string | The Markdown to convert. Omit when passing path. |
overwrite | boolean | Replace output_path if it already exists. Off by default, so an existing file is never clobbered by accident. |
path | string | Path to a Markdown file (.md, .markdown, .mdown, or .txt) to convert, instead of markdown. Relative paths resolve against the server's working directory, so prefer an absolute path. |