Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Code

Code-oriented Spectra combinators: fenced source blocks and inline monospace, as plain Pict/Inline values.

fn main() = println(show(prism_code("fn main() = ()")))
Layout.CodeBlock("prism", "fn main() = ()")

Functions and Values

code_block

code_block : (String, String) -> Layout.Pict

A fenced source block. The language name is passed to Typst’s raw-text renderer, which can apply syntax highlighting when it knows the language.

prism_code

prism_code : (String) -> Layout.Pict

A Prism source block.

inline_code

inline_code : (String) -> Layout.Inline

Inline monospace source.