pub fn parse_template(template: &str) -> Vec<TemplateNode>Expand description
Parse a template string into an AST.
Syntax:
{name}- variable reference{name:fallback}- variable with fallback value{name|modifier:arg}- variable with modifier{ segment }- conditional segment (hidden if any variable missing)
§Examples
use termtitle::template_ast::parse_template;
let nodes = parse_template("{name}{ • {version}}");
// Creates: [Variable("name"), ConditionalSegment([Literal(" • "), Variable("version")])]