pub enum Event<'a> {
Show 14 variants
Start(Tag<'a>),
End(Tag<'a>),
Text(CowStr<'a>),
Code(CowStr<'a>),
Linebreak,
Parbreak,
PageBreak,
Line(Option<(CowStr<'a>, CowStr<'a>)>, Option<(CowStr<'a>, CowStr<'a>)>, Option<CowStr<'a>>, Option<CowStr<'a>>, Option<CowStr<'a>>),
Let(CowStr<'a>, CowStr<'a>),
FunctionCall(Option<CowStr<'a>>, CowStr<'a>, Vec<CowStr<'a>>),
DocumentFunctionCall(Vec<CowStr<'a>>),
Set(CowStr<'a>, CowStr<'a>, CowStr<'a>),
DocumentSet(CowStr<'a>, CowStr<'a>),
Raw(CowStr<'a>),
}
Variants§
Start(Tag<'a>)
Start of a tagged element. Events that are yielded after this event
and before its corresponding End
event are inside this element.
Start and end events are guaranteed to be balanced.
End(Tag<'a>)
End of a tagged element.
Text(CowStr<'a>)
A text node.
Code(CowStr<'a>)
An inline code node.
Linebreak
A soft line break.
Parbreak
A hard line break.
PageBreak
A page break.
Line(Option<(CowStr<'a>, CowStr<'a>)>, Option<(CowStr<'a>, CowStr<'a>)>, Option<CowStr<'a>>, Option<CowStr<'a>>, Option<CowStr<'a>>)
A line. The first field is the start point, the second is the end point, the third field is the length, the fourth is the angle, and the fifth is the stroke.
Let(CowStr<'a>, CowStr<'a>)
A let binding. First argument is lhs, second is rhs.
FunctionCall(Option<CowStr<'a>>, CowStr<'a>, Vec<CowStr<'a>>)
A function call. The first field is the target variable (without #
), the
second is the function name, and the third is a list of arguments.
If calling document()
, prefer [DocumentFunctionCall
].
DocumentFunctionCall(Vec<CowStr<'a>>)
A document
function call. The field is the list of arguments.
Prefer this over the more general FunctionCall
as document calls must appear
before any content.
Set(CowStr<'a>, CowStr<'a>, CowStr<'a>)
A set rule.
If setting document metadata, prefer [DocumentSet
].
DocumentSet(CowStr<'a>, CowStr<'a>)
A document
set rule. The first field is the parameter name, the second is the
parameter value.
Prefer this over the more general [Set
] as document set rules must appear
before any content.
Raw(CowStr<'a>)
Raw string data what will be bassed through directly to typst. Prefer using other strongly-typed rules.