Markdown to Word

v0.6.0
io.github.benbalter/markdown-to-word Checked 4 hours ago Published 13 days ago

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

ParameterTypeDescription
output_path *stringWhere to write the .docx; must end in .docx. Prefer an absolute path. Missing folders are created. Never written through a symlink.
font_presetstringRestyle 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.
markdownstringThe Markdown to convert. Omit when passing path.
overwritebooleanReplace output_path if it already exists. Off by default, so an existing file is never clobbered by accident.
pathstringPath 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.