A tree-sitter parser for the Vento templating language.
- Full support for Vento template syntax
- YAML front matter parsing with language injection
- JavaScript code injection for dynamic expressions
- HTML content injection for template markup
- Syntax highlighting for all Vento constructs
All Vento keywords are properly parsed and highlighted:
{{ if }}/{{ /if }}- Conditional blocks{{ else if }}- Else-if branches{{ else }}- Else branches{{ for }}/{{ /for }}- Loop blocks (with optionalawait)
{{ set }}/{{ /set }}- Variable assignment (tag and block forms){{ echo }}- Output expressions
{{ layout }}/{{ /layout }}- Layout blocks{{ slot }}/{{ /slot }}- Slot definitions{{ default }}/{{ /default }}- Default content blocks{{ include }}- Include other templates{{ fragment }}/{{ /fragment }}- Fragment blocks (plugin)
{{ function }}/{{ /function }}- Function definitions (with optionalasyncandexport){{ import }}- Import from other templates{{ export }}/{{ /export }}- Export variables (tag and block forms)
{{> }}- JavaScript execution tag{{# #}}- Comment tag
The parser supports YAML front matter at the beginning of Vento templates:
---
title: My Page
date: 2024-01-01
tags:
- vento
- template
---
<h1>{{ title }}</h1>The YAML content within the front matter delimiters (---) will be properly injected and highlighted as YAML.