Skylighting.Format.Typst

skylighting-format-typst-0.1: Typst formatter for skylighting syntax highlighting library

Safe Haskell | None
Language | Haskell2010

Skylighting.Format.Typst

Synopsis

- formatTypstInline :: FormatOptions -> [SourceLine] -> Text
- formatTypstBlock :: FormatOptions -> [SourceLine] -> Text
- styleToTypst :: Style -> Text

# Documentation

formatTypstInline :: FormatOptions -> [SourceLine] -> Text #

Formats tokens as Typst using custom commands inside `|` characters. Assumes that `|` is defined as a short verbatim command by the macros produced by `styleToTypst`. A `KeywordTok` is rendered using `\KeywordTok{..}`, and so on.

formatTypstBlock :: FormatOptions -> [SourceLine] -> Text #

Format tokens as a Typst `Highlighting` environment inside a Skylighting block that can be styled. `Skylighting` is defined by the macros produced by `styleToTypst`.

styleToTypst :: Style -> Text #

Converts a `Style` to a set of Typst macro definitions, which should be placed in the document's preamble.