01 · Front Doors
One command per source type.
hoja document.pdf # local PDF, mixed page sizes preservedhoja 1706.03762 # arXiv ID, cached locally, resumes pagehoja https://example.com/deck.pdf # remote PDF validated by %PDF- headerhoja https://example.com/post # web article -> Markdown -> sandboxed Typsthoja book.epub # EPUB unpacked in memory -> Typsthoja secret.pdf --password 'hunter2' # encrypted PDF (or HOJA_PDF_PASSWORD)hoja notes.typ --watch # Typst source, live reloadhoja notes.md --watch # Markdown with $...$ and $$...$$ mathhoja paper.tex --watch # LaTeX via tectonic| Source | Engine | Safeguards & behavior |
|---|---|---|
| Local PDF / arXiv | pdfium-render | Bounded 8-page LRU cache + 3x double-buffered GPU strips; 500-page books stay flat |
| Remote PDF URL | pdfium-render | Sniffed by %PDF- magic bytes, 512 MiB cap, query tokens stripped from titles and logs |
| Web article URL | defuddle / Rust HTML + Typst | Uses defuddle when on PATH, else built-in pure-Rust extractor; set HOJA_DEFUDDLE=0 to force built-in |
| EPUB book | In-memory ZIP + Typst | Rejects zip bombs, zip-slip paths, XML entity expansion, and DRM-protected files before rendering |
| Encrypted PDF | pdfium-render | Password read from --password or HOJA_PDF_PASSWORD in memory only; never saved to disk |
| .md / .tex / .typ | Typst (cmarker+mitex) / tectonic | Compiles in place on save with --watch without losing your scroll position |
02 · Sandboxed Typst Pipeline
Safe web and EPUB rendering.
Web articles and EPUB books compile inside a scratch directory with typst --root, with raw Typst injection disabled (raw-typst: false) and math routed through a MiTeX guard. Compiled PDFs cache under ~/Library/Caches/hoja/url and ~/Library/Caches/hoja/epub (or ~/.cache/hoja/ on Linux) alongside a title sidecar so the stack switcher shows readable titles.
03 · Scope
When not to use hoja.
hoja is read-only toward source documents. It intentionally rejects DRM-protected EPUBs and does not fill interactive PDF forms, apply digital signatures, or mutate embedded PDF annotations in place.