Expand description
= Cookie Cutter core
This is the core crate of the cookie cutter template engine.
Have a look at the main cookie_cutter crate for further information.
Modules§
- builtins
- Contains builtin functions and contextualizers.
Macros§
- __
internal__ parse_ include_ str - Internal macro. Semver exempt. Do not use.
- __
internal__ parse_ with_ path - Internal macro. Semver exempt. Do not use.
- __
internal__ parser - Internal macro. Semver exempt. Do not use.
- __
internal__ span_ macro_ include_ str - Internal macro. Semver exempt. Do not use.
- __
internal__ span_ macro_ with_ path - Internal macro. Semver exempt. Do not use.
- value
- Constructs a
Valueusing a literal syntax.
Structs§
- Indentation
- An amount of indentation. Typically of a template / template literal line.
- Span
- A span referencing a portion of template source code. Typically returned by errors to indicate the particular location of the problem.
- Templates
- The core struct of the templating engine. It represents fully type checked and ready to
Templates::rendertemplates. - Templates
Builder - The main way of obtaining
Templates.
Enums§
- Contextualization
Error - An error that can happen when static text gets contextualized.
- Error
- The error type returned if building
Templatesfailed. - Parse
Error - Represents a failure to parse a source file
- Rendertime
Error - An error which can occur when attempting to render a template.
- Type
- The type of a cookie cutter
crate::Value. Since this is used in earlier stages than the value more information is still available. For example the text type or whether it is a tuple or an array. - Type
Checking Error - An error which can occur in the type checking phase of the build process for a
crate::Templates. Encountering this indicates the syntax of the source file(s) is correct since parsing errors would have ended the process early. - Value
- A cookie cutter value used by the template engine to process data. Also used to provide data to
templates in the form of paramters on the initial call to a render* function of a
crate::Templates.
Traits§
- Context
Worker - A trait to be implemented in tandem with
Contextualizerby users wishing to change how static text is analysed to determine context and appropriate text type. - Contextualizer
- A trait implemented by users wishing to change the way text types behave. This determines the default text type, how static text get’s analyzed and changes the context and how to escape text to safely get from one text type to another.
- Escaper
- A trait to be implemented in tandem with
Contextualizerby users wishing to change how values are escaped to make it safe to include in a different context. - Function
- A function to be used by template authors. There are several builtin ones. This can be implemented by users wishing to extend (or change) those.