Skip to main content

Crate carta_core

Crate carta_core 

Source
Expand description

Shared carta core: the conversion traits, their option types, and the common error type.

Reader turns input text into a Document; Writer turns a Document back into output text. Readers and writers depend only on the AST contract and this crate, so input and output formats stay independent.

Re-exports§

pub use extensions::Extension;
pub use extensions::Extensions;
pub use extensions::presets;

Modules§

extensions
Format extensions: the set of optional syntax features a reader or writer may honor.
sections
Section numbering and table-of-contents construction over the document model.
template
A small string-template engine: variables, conditionals, loops, pipes, and partials over a Value context. The language uses $-delimited directives; see parse for the grammar and the surrounding module docs for whitespace handling.

Structs§

ReaderOptions
Options controlling a Reader. Extended (not resignatured) as real options land.
WriterOptions
Options controlling a Writer. Extended (not resignatured) as real options land.

Enums§

Error
The error type returned across the conversion pipeline.
MathMethod
How math is presented by a format that offers a choice of renderers (the HTML family). The method decides both the inline markup inside a span.math and which loader a standalone document pulls in to typeset it: a MathJax (or plain) document carries the source TeX wrapped in \(…\) / \[…\], whereas a KaTeX document carries the bare TeX, which its in-browser loader reads from the span directly.
MetaVarStyle
Which plain-text identity variables a writer’s standalone template draws on. The document’s title, authors, and date are exposed as markup-free, target-escaped text for places that cannot carry markup — a web document head or a PDF document’s properties. See Writer::meta_var_style.
TocStyle
How a writer supplies a table of contents.
WrapMode
How a text writer lays out the lines of a paragraph.

Traits§

Reader
Parses input text in some source format into the document model.
Writer
Renders the document model into some target format’s text.

Type Aliases§

Result
A Result whose error is Error.