A professional, modular CLI for recursive document conversion workflows, starting with Markdown → PDF.
Developed by raymsm
GitHub: https://github.com/raymsm
MPRecursive scans a directory tree, detects supported files, and converts them into a single output document. The first production pipeline is markdown aggregation and PDF generation powered by Pandoc.
- Recursive directory scanning for markdown files
- Deterministic sorting (
name,modified,created) - Merge all discovered markdown files into one PDF with per-file sections
- Automatic Obsidian syntax normalization:
[[wikilink]]→wikilink![[image.png]]→
- Strips leading YAML front matter per file before merge to avoid malformed metadata crashes
- Resolves local image paths against each source note directory for more reliable Pandoc resource loading
- Table of contents support via Pandoc
- Modular converter architecture for future pipelines
- Colorful startup banner with developer attribution
pip install markdown-pdf-recursivegit clone https://github.com/raymsm/markdown-pdf-recursive
cd markdown-pdf-recursive
pip install -e .- Python 3.9+
- Pandoc
- A LaTeX engine for PDF generation (default:
xelatex)
MPRecursive ./vault --output vault.pdf --tocpath- Root directory to scan (positional)-o, --output FILE- Output PDF path--toc- Include table of contents--sort name|modified|created- File ordering mode--include-images- Reserved for future image strategy controls--ignore FOLDER- Ignore directory name (repeatable)--verbose- Print detailed conversion command--engine pandoc- Conversion engine selector--pdf-engine ENGINE- Pandoc PDF engine (default:xelatex)
MPRecursive ./vault -o vault.pdf
MPRecursive ./notes --sort modified --toc -o notes.pdf
MPRecursive ./knowledge-base --ignore .git --ignore archive --verbose -o kb.pdf- Install Python and Pandoc in Termux.
- Install a TeX environment compatible with Pandoc PDF export.
- Install MPRecursive:
pip install markdown-pdf-recursive
- Run:
MPRecursive /sdcard/Documents/vault -o /sdcard/Documents/vault.pdf --toc
- Fork the repository.
- Create a feature branch.
- Add/adjust tests for your change.
- Run
pytest. - Submit a pull request with clear rationale.
- Markdown → PDF
- HTML → PDF converter plugin
- DOCX → PDF converter plugin
- TXT → PDF converter plugin
- PDF → Markdown converter plugin
- PDF → Text converter plugin
- Markdown → HTML converter plugin
- Plugin discovery/registration system
MIT License.
- YAML parse errors: MPRecursive strips leading front matter from each file before merge, which avoids failures caused by malformed note properties.
pdflatex/xelatexnot found: install a TeX engine or run with another installed engine (for example--pdf-engine=tectonicif available).- Missing images: ensure image links are relative to each note location or absolute valid paths.