Skip to content

Repository files navigation

Markdown Convertor

Small Python CLI for converting documents to Markdown with Microsoft's MarkItDown.

Setup

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.

Usage

Convert one file:

doc2md input.pdf

This creates input.md in the same folder as input.pdf.

Quick test after setup:

printf "Hello from MarkItDown" > sample.txt
doc2md sample.txt

Convert several files into the default markdown_output/ directory:

doc2md report.pdf deck.pptx notes.docx

Convert a directory:

doc2md ./documents --recursive

The older doc-to-md command remains available as an alias:

doc-to-md input.pdf

Use --use-plugins to enable installed MarkItDown plugins.

Notes

MarkItDown runs with the privileges of the current Python process. Avoid passing untrusted paths or URLs into this script without validating them first.

About

[CLI script | macOS/Linux] Convert documents to Markdown with MarkItDown.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages