#parser #twig #html #vue #template


Parser for twig / html / vue templating syntax

6 releases

0.3.3 May 23, 2021
0.3.2 May 23, 2021
0.3.0 Feb 6, 2021
0.2.1 Jan 31, 2021

#437 in Parser implementations

36 downloads per month
Used in ludtwig

MIT license

3.5K SLoC


GitHub Crates.io Crates.io

Rust crate that parses twig / html / vue.js templating syntax into an AST (abstract syntax tree). It does not conform to any spec and the input is required to be as idiomatic as possible. For example missing closing tags in html result in a parsing error (even if browsers can interpret the html and reconstruct the closing tag). This makes it possible to represent the template in a hierarchical AST.

Documentation for this crate exists but read the disclaimer before you start using this crate.


This crate is still in early development and the API can break with any release until it reaches a stable v1.0.0 version (semantic versioning). It is developed together with the ludtwig CLI application for formatting and analyzing templating files.


MIT - see LICENSE file.

License notices

For testing purposes this repository also includes code from the following sources:


~35K SLoC