Convert Markdown or HTML to DOCX/PPTX using bentopdf-sh. Use when the user asks to convert markdown to word, create a docx, make a word document, export as docx, convert to pptx, make slides, create a presentation, or mentions "markdown to docx", "md to word", "markdown to pptx", "make a slide deck", "branded document", or asks to apply a template to a document. Supports Markdown and HTML input with optional reference document templates.
The npm package is bentopdf-sh. The CLI command it installs is bentopdf.
!`which bentopdf 2>/dev/null && bentopdf --version 2>/dev/null || echo "NOT_INSTALLED"`
If NOT_INSTALLED, use npx (no install needed): npx bentopdf-sh to-docx <file>
Or install globally: npm install -g bentopdf-sh
Markdown: .md, .markdown HTML: .html, .htm
bentopdf to-docx <input> # → input.docx in same directory
bentopdf to-docx <input> -o <output.docx> # explicit output path
bentopdf to-docx <input> -t template.docx # apply reference doc for styling
bentopdf to-docx *.md -o ./docs/ # batch convert
bentopdf to-pptx <input> # → input.pptx in same directory
bentopdf to-pptx <input> -o <output.pptx> # explicit output path
bentopdf to-pptx <input> -t brand.pptx # apply reference doc for styling
bentopdf to-pptx *.md -o ./slides/ # batch convert
-o, --output <path> — output file or directory (directory must end with /)-t, --template <path> — reference document for styling (fonts, headings, layout)--verbose — show conversion progressThe --template flag accepts a reference document (.docx or .pptx) that controls:
This works like pandoc's --reference-doc. The template file must be a valid .docx or .pptx.
Pandoc splits slides on level-2 headings (##). Each ## heading becomes a new slide title. Content under each ## becomes the slide body. Level-1 headings (#) create title slides.
-o ./output/ directory--template--verbose and report the errorConvert $ARGUMENTS now. First verify the file exists, then determine the right command:
bentopdf to-docx $ARGUMENTSbentopdf to-pptx $ARGUMENTS