Crate typst

Source
Expand description

The compiler for the Typst markup language.

§Steps

  • Parsing: The compiler first transforms a plain string into an iterator of tokens. This token stream is parsed into a syntax tree. The tree itself is untyped, but the AST module provides a typed layer over it.
  • Evaluation: The next step is to evaluate the markup. This produces a module, consisting of a scope of values that were exported by the code and content, a hierarchical, styled representation of what was written in the source file. The elements of the content tree are well structured and order-independent and thus much better suited for further processing than the raw markup.
  • Layouting: Next, the content is laid out into a PagedDocument containing one frame per page with items at fixed positions.
  • Exporting: These frames can finally be exported into an output format (currently PDF, PNG, SVG, and HTML).

Re-exports§

pub extern crate comemo;
pub extern crate ecow;

Modules§

diag
Diagnostics.
engine
Definition of the central compilation context.
foundations
Foundational types and functions.
html
HTML output.
introspection
Interaction between document parts.
layout
Composable layouts.
loading
Data loading.
math
Mathematical formulas.
model
Structuring elements that define the document model.
pdf
PDF-specific functionality.
routines
symbols
Modifiable symbols.
syntax
Parser and syntax tree for Typst.
text
Text handling.
utils
Utilities for Typst.
visualize
Drawing and visualization.

Structs§

Features
A selection of in-development features that should be enabled.
Library
Definition of Typst’s standard library.
LibraryBuilder
Configurable builder for the standard library.

Enums§

Category
A group of related standard library definitions.
Feature
An in-development feature that should be enabled.

Statics§

ROUTINES
Defines implementation of various Typst compiler routines as a table of function pointers.

Traits§

Document
A document is what results from compilation.
World
The environment in which typesetting occurs.
WorldExt
Helper methods on World implementations.

Functions§

compile
Compile sources into a fully layouted document.
trace
Compiles sources and returns all values and styles observed at the given span during compilation.