Tree-sitter grammar for Hygen templates.
It extends the tree-sitter-embedded-template
grammar.
-
bash
(optional): highlight ofmetadata.value
whenmetadata.key
issh
-
javascript
(optional): highlight ofcode
nodes -
regex
(optional): highlight ofmetadata.value
whenmetadata.key
isafter
,before
orskip_if
- Any other parser that you want to use for dynamic injection
-
hygen.nvim
: plugin that integrates this grammar to yourNeovim
configuration.
To be added
To be added
You can get the built files from the release
branch. If you
have specific instructions for your editor, PR's are welcome.
Thanks to content
node of tree-sitter-embedded-template
grammar, dynamic injections can be attached to
template body.
Just add .hygen
to the end of the file name, i.e.:
index.html.hygen
.gitignore.hygen
.tsconfig.json.hygen
To implement dynamic injection, is recommended to create a directive with the following name:
#inject-hygen-tmpl!
[!NOTE] The creation of this directive varies for each editor
This directive will the responsible to remove .hygen
from the file name and
use the rest of the file name to retrieve the parser
to be used for dynamic
injection. See implementations for more details.
[!WARNING] Ignore dynamic injection for
*.ejs.hygen
,*.erb.hygen
and*.hygen.hygen
files to avoid weird behaviours
Once created, add it to the end of injections.scm
file that will be used by
the editor:
; dynamic injection
((content) @injection.content
(#inject-hygen-tmpl! "")
(#set! injection.combined))
- Hygen repository
- Hygen website (currently down)