Rheo is a typesetting and static site engine based on Typst. You can use it to compile folders containing Typst to PDF, HTML, and EPUB simultaneously. Rheo is a standalone CLI tool that includes a development server for rapid website iteration.
Compile all .typ files in a directory to PDF, HTML, and EPUB and recompile on change:
rheo watch examples/blog_site --openThe --open flag starts a development server at http://localhost:3000 with automatic browser refresh.
Use additional flags for customization:
# Custom config file location
rheo compile examples/blog_site --config /path/to/custom.toml
# Custom build directory
rheo compile examples/blog_site --build-dir /tmp/buildSee the documentation for more information regarding which flags are available.
Rheo requires Rust and Cargo. Install from rustup.rs.
# Install from crates.io
cargo install rheo
# Or build the project from source
git clone https://github.com/freecomputinglab/rheo
cd rheo
cargo build --release
cargo install --path .To install the compilation environment, first ensure that you have Nix installed on your computer.
You will also need to enable Nix flakes, which you can do by inserting the following line in your nix.conf:
experimental-features = nix-command flakes
With Nix and flakes installed, run:
# Enter development environment
nix develop
# Or build the package
nix buildRheo automatically transforms cross-document links based on the output format to ensure they work correctly in each context.
See the #link("./about.typ")[about page] for more information.
Visit #link("https://example.com")[our website].In HTML, this would compile as:
See the <a href="./about.html">about page</a> for more information. Visit <a href="https://example.com">our website</a>.`If a linked file doesn't exist, rheo will report a detailed error during compilation.
See the documentation for more information.
Rheo compiles Typst documents to three output formats simultaneously:
- PDF: High-quality print-ready documents.
- HTML: Web-ready output with CSS customization.
- EPUB: E-book format with support for merged multi-chapter books.
By default, all three formats are generated. Use format flags to compile specific outputs:
rheo compile my_project --pdf # PDF only
rheo compile my_project --html # HTML only
rheo compile my_project --epub # EPUB only
rheo compile my_project --pdf --html # PDF and HTMLWatch mode automatically recompiles files when they change, perfect for iterative development:
rheo watch examples/blog_siteAdd the --open flag to launch a development server with automatic browser refresh:
rheo watch examples/blog_site --openThe development server:
- Runs at
http://localhost:3000 - Opens your default browser automatically
- Refreshes the page when files change
- Supports multiple connected browsers
Combine multiple Typst files into a single PDF or EPUB document using the merge feature. Configure in rheo.toml:
[pdf.spine]
title = "My Book"
vertebrae = ["cover.typ", "chapters/**/*.typ"]
merge = true
[epub.spine]
title = "My Book"
vertebrae = ["cover.typ", "chapters/**/*.typ"]The vertebrae uses glob patterns to specify which files to include and in what order.
Globbed files use lexicographic sorting.
Rheo automatically infers sensible defaults for EPUB:
title: Derived from filename (single file) or directory name (project)vertebrae: Single file (single-file mode) or all.typfiles sorted alphabetically (directory mode)
This means you can generate EPUBs without any configuration:
rheo compile my_document.typ --epub
# Creates my_document.epub with title "My Document"
rheo compile my_book/ --epub
# Creates my_book.epub with all .typ files includedProjects can include a rheo.toml configuration file in the project root to customize compilation behavior rather than specifying flags.
See the documentation for more information.
By default, rheo uses a simple, elegant and modern stylesheet to style your HTML.
To customize this, you can add a style.css in your project root, which rheo will inject into your HTML output.
Licensed at your option under either:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.