Skip to main content

Crate cooklang_format

Crate cooklang_format 

Source
Expand description

Render Cooklang recipes into text formats.

Each module turns a parsed cooklang::Recipe into one target format. The print_* functions write into a std::io::Write; the *_to_string wrappers are for callers that want a String.

§Errors

These functions return a bare std::io::Error. The only thing that can fail is the caller’s own writer: the recipe is already parsed, and every field is optional, so there is nothing left to reject.

Re-exports§

pub use cooklang;

Modules§

cooklang_source
Format a recipe as cooklang
human
Format a recipe for humans to read
latex
Format a recipe as a standalone LaTeX document.
markdown
Format a recipe as markdown
number
Human-friendly rendering of quantity numbers.
quantity
Deterministic ordering for GroupedQuantity.
schema
Format a recipe as schema.org/Recipe JSON-LD.
typst
Format a recipe as a standalone Typst document.

Enums§

PaperSize
Page size for the latex and typst formatters.
Style
Whether formatters emit ANSI escape codes.

Constants§

REFERENCE_SEPARATOR
The separator a recipe reference’s path is built and reported with.

Functions§

human_to_string
Render a recipe the way cook recipe prints it, into a String.
markdown_to_string
Render a recipe as Markdown, into a String.