Documentation
¶
Overview ¶
Package mist renders a strict subset of Liquid in a single pass, bailing with ErrUnsupported on anything outside the subset so the caller can fall back to a full engine. See SPEC.md for the exact subset.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupported means the template is outside the subset; render it with the full engine instead. ErrUnsupported = errors.New("mist: unsupported") // ErrUndefined is a strict-mode undefined variable. The full engine fails too, though a // syntax error later in the template may take precedence there. ErrUndefined = errors.New("mist: undefined variable") )
Functions ¶
Types ¶
type Error ¶
type Result ¶
func RenderChain ¶
RenderChain renders steps in order, binding each output into the vars seen by later steps exactly as the render service does. It stops at the first step mist can't render and returns n, its index; the caller renders steps[n:] with the full engine using the returned vars. The caller's maps are never mutated.
type Step ¶
type Step struct {
Body string
Key []string // where the output is bound for later steps
Strict bool
Premailer bool // unsupported: inlined output may feed later steps
Vars map[string]any // replaces the chain vars for this step only
}
Step mirrors one entry of the render service's `render` array.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
mistcheck
command
Command mistcheck reports whether Liquid templates are inside the mist subset.
|
Command mistcheck reports whether Liquid templates are inside the mist subset. |
|
scripts
|
|
|
gen
command
Command gen writes random templates drawn from the SPEC.md grammar, with random data, in harvest.rb's format for oracle.mjs.
|
Command gen writes random templates drawn from the SPEC.md grammar, with random data, in harvest.rb's format for oracle.mjs. |
Click to show internal directories.
Click to hide internal directories.