Deterministic, append-only Markdown documents with a small, explicit Python API.
uv add simdocOr with pip:
pip install simdocfrom simdoc import Doc
doc = Doc()
doc.h1("Simple Document")
doc.p("First line\nSecond line")
doc.ul(["alpha", ["beta", "gamma"], "delta"])
doc.code("print('hi')", lang="py")
doc.table([
{"b": "x|y", "a": "1\n2"},
{"a": None, "b": "ok"},
])
doc.hr()
markdown = doc.to_markdown()
doc.save("example.md")See the full API and integration notes in docs/api.md.
Run the full example that exercises every block type:
uv run python examples/example_all_blocks.pyThe script writes examples/example_output.md.
simdoc uses Pandoc + XeLaTeX with the Eisvogel LaTeX template.
System requirements:
- pandoc
- a TeX distribution with xelatex
Recommended installations:
Linux: sudo apt install pandoc texlive-xetex texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra
Windows: Install Pandoc + MiKTeX (enable automatic package installation)
macOS: brew install pandoc brew install --cask mactex
Template project: https://github.com/Wandmalfarbe/pandoc-latex-template
Thanks to Pascal Wagler and contributors for the template.