Formats
Since v0.2.0, Rheo has a plugin architecture, meaning that it can produce an arbitrary number of formats. By default, Rheo produces three different formats simultaneously: PDF, HTML, and EPUB. There are cases in which you may only want to produce one of these formats, however, or to exclude one format because your project either cannot support or does not require it.
Typst, the programming language and compilation toolchain that underwrites Rheo, natively and fully supports PDF. Rheo adds the additional ability to merge multiple different Typst files into a single PDF. This is useful when you want to separate sections of your book in individual files, or show the sections of your book as separate web pages in the HTML output.
HTML
Typst experimentally supports HTML. This means that not all Typst syntax will translate to a meaningful HTML structure. The most common features in everyday prose are all supported, however, such as text markup, links, headings, footnotes, and citations. For more information on which features are currently supported in Typst’s HTML export, refer to the HTML export tracking issue.
Rheo’s HTML format provides additional utilities for referencing CSS and Javascript in the built site, as well as passing through assets.1
EPUB
Typst does not yet support EPUB. The Rheo EPUB format bridges the gap to this, allowing you to compile fully functional EPUB documents from a Rheo project directory. As EPUB export is on Typst’s roadmap, we will track this feature closely in the upstream and look to integrate with it when it lands in the future.
Configuration
CLI flag
You can constrain Rheo to producing one or more formats by passing one or more of the following flags to compile or watch:
rheo compile path/to/project --pdf
rheo compile path/to/project --html
rheo compile path/to/project --epub
rheo.toml
You can also specify formats at the top level of rheo.toml in an array that contains one or more formats. The default, if formats is not specified, is an array with all three formats:
formats = ["pdf", "html", "epub"]