Small Python CLI for converting documents to Markdown with Microsoft's MarkItDown.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'MarkItDown supports PDF, Word, PowerPoint, Excel, HTML, CSV, JSON, XML, ZIP, EPub, and other formats depending on installed optional dependencies.
Convert one file:
doc2md input.pdfThis creates input.md in the same folder as input.pdf.
Quick test after setup:
printf "Hello from MarkItDown" > sample.txt
doc2md sample.txtConvert several files into the default markdown_output/ directory:
doc2md report.pdf deck.pptx notes.docxConvert a directory:
doc2md ./documents --recursiveThe older doc-to-md command remains available as an alias:
doc-to-md input.pdfUse --use-plugins to enable installed MarkItDown plugins.
MarkItDown runs with the privileges of the current Python process. Avoid passing untrusted paths or URLs into this script without validating them first.