Skip to main content

A simple Python package for deterministic Markdown documents

Project description

simple-document

Deterministic, append-only Markdown documents with a small, explicit Python API.

Installation

uv add simdoc

Or with pip:

pip install simdoc

Usage

from 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")

API Reference

See the full API and integration notes in docs/api.md.

Example script

Run the full example that exercises every block type:

uv run python examples/example_all_blocks.py

The script writes examples/example_output.md.

PDF Rendering

simdoc uses Pandoc + XeLaTeX with the Eisvogel LaTeX template.

PDF Toolchain Setup

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simdoc-0.2.0.tar.gz (323.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simdoc-0.2.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file simdoc-0.2.0.tar.gz.

File metadata

  • Download URL: simdoc-0.2.0.tar.gz
  • Upload date:
  • Size: 323.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for simdoc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c75d1fb6f7b83dc2ae790541d10b54bf07d2ea5c135735aa75f3c0a5d06563e9
MD5 b794be406789c1cb09699622da115b24
BLAKE2b-256 463bf6353e40dde953ed262c246e6d34e115cc693442a244f3e8865c39521a7f

See more details on using hashes here.

File details

Details for the file simdoc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: simdoc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for simdoc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce30e5fefe94b9a5dac296ac59280c5d30cbce59065298b76486ff2dc24b925e
MD5 ffc35cbc99771b5be265d9dabbcb4796
BLAKE2b-256 9d712e28845b6b3e40dbe4078df45c0602889560cb8112e2863f5363eb2e2580

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page