# tree-sitter-hygen-template
[![CI][ci]](https://github.com/Hdoc1509/tree-sitter-hygen-template/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-hygen-template)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-hygen-template)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-hygen-template)
[Tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for
[Hygen](https://www.hygen.io/) templates.
It extends the [`tree-sitter-embedded-template`][embedded-template] grammar.
## Parser requirements
- [`embedded-template`][embedded-template]: highlight of [`ejs`
tags](https://github.com/mde/ejs?tab=readme-ov-file#tags)
- [`bash`](https://github.com/tree-sitter/tree-sitter-bash) (optional):
highlight of `metadata.value` when `metadata.key` is `sh`
- [`javascript`](https://github.com/tree-sitter/tree-sitter-javascript)
(optional): highlight of `code` nodes
- Any other parser that you want to use for [dynamic injection](#dynamic-injection)
## Usage in Editors
### Neovim
- [`hygen.nvim`](https://github.com/Hdoc1509/hygen.nvim): plugin that integrates
this grammar to your `Neovim` configuration.
### Helix
_To be added_
<!--
TODO: add script to add this grammar to Helix configuration. see:
- https://docs.helix-editor.com/guides/adding_languages.html
- https://docs.helix-editor.com/languages.html
take reference from:
https://github.com/IndianBoy42/tree-sitter-just?tab=readme-ov-file#manual-installation-helix
-->
### Emacs
_To be added_
<!--
TODO: take reference from:
https://github.com/tree-sitter-perl/tree-sitter-perl?tab=readme-ov-file#emacs
-->
### In General
You can get the built files from the [`release` branch][release-branch]. If you
have specific instructions for your editor, PR's are welcome.
## Dynamic Injection
Thanks to `content` node of [`tree-sitter-embedded-template`
grammar][embedded-template-grammar], dynamic injections can be attached to
template body.
### File name pattern convention
To make it easier to understand which `parser` will be injected and which
filetype is used in template `body`, the following pattern is recommended to
implement this grammar:
```
<file-name>.(ext).hygen
```
### Tree-sitter predicate/directive
To implement dynamic injection, is recommended to create a predicate/directive
with the following name:
```
#inject-hygen-tmpl!
```
> [!NOTE]
> The creation of this predicate/directive varies for each editor
### Implementations
#### hygen.nvim
- [Filetype detection][hygen-nvim-filetype]
- [Parser register and injection directive][hygen-nvim-tree-sitter]
- [Dynamic injection query][hygen-nvim-injection-queries]
## References
- [Hygen repository](https://github.com/jondot/hygen)
- [Hygen website](https://www.hygen.io/)
[ci]: https://github.com/Hdoc1509/tree-sitter-hygen-template/actions/workflows/ci.yml/badge.svg
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[crates]: https://img.shields.io/crates/v/tree-sitter-hygen-template?logo=rust
[npm]: https://img.shields.io/npm/v/tree-sitter-hygen-template?logo=npm
[pypi]: https://img.shields.io/pypi/v/tree-sitter-hygen-template?logo=pypi&logoColor=ffd242
[embedded-template]: https://github.com/tree-sitter/tree-sitter-embedded-template
[embedded-template-grammar]: https://github.com/tree-sitter/tree-sitter-embedded-template/blob/master/grammar.js
[hygen-nvim-filetype]: https://github.com/Hdoc1509/hygen.nvim/blob/master/ftdetect/hygen.vim
[hygen-nvim-injection-queries]: https://github.com/Hdoc1509/hygen.nvim/blob/master/queries/hygen_template/injections.scm
[hygen-nvim-tree-sitter]: https://github.com/Hdoc1509/hygen.nvim/blob/master/lua/hygen/tree-sitter.lua
[release-branch]: https://github.com/Hdoc1509/tree-sitter-hygen-template/tree/release
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-hygen-template",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, hygen-template",
"author": null,
"author_email": "H\u00e9ctor Ochoa <hector.ochoa.dev@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f3/26/1f5413693ec7d89d69ecd8eb887b599a58afbe2391fdc1c076a5412f96fa/tree_sitter_hygen_template-0.3.2.tar.gz",
"platform": null,
"description": "# tree-sitter-hygen-template\n\n[![CI][ci]](https://github.com/Hdoc1509/tree-sitter-hygen-template/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-hygen-template)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-hygen-template)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-hygen-template)\n\n[Tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for\n[Hygen](https://www.hygen.io/) templates.\n\nIt extends the [`tree-sitter-embedded-template`][embedded-template] grammar.\n\n## Parser requirements\n\n- [`embedded-template`][embedded-template]: highlight of [`ejs`\n tags](https://github.com/mde/ejs?tab=readme-ov-file#tags)\n- [`bash`](https://github.com/tree-sitter/tree-sitter-bash) (optional):\n highlight of `metadata.value` when `metadata.key` is `sh`\n- [`javascript`](https://github.com/tree-sitter/tree-sitter-javascript)\n (optional): highlight of `code` nodes\n- Any other parser that you want to use for [dynamic injection](#dynamic-injection)\n\n## Usage in Editors\n\n### Neovim\n\n- [`hygen.nvim`](https://github.com/Hdoc1509/hygen.nvim): plugin that integrates\n this grammar to your `Neovim` configuration.\n\n### Helix\n\n_To be added_\n\n<!--\nTODO: add script to add this grammar to Helix configuration. see:\n- https://docs.helix-editor.com/guides/adding_languages.html\n- https://docs.helix-editor.com/languages.html\ntake reference from:\nhttps://github.com/IndianBoy42/tree-sitter-just?tab=readme-ov-file#manual-installation-helix\n-->\n\n### Emacs\n\n_To be added_\n\n<!--\nTODO: take reference from:\nhttps://github.com/tree-sitter-perl/tree-sitter-perl?tab=readme-ov-file#emacs\n-->\n\n### In General\n\nYou can get the built files from the [`release` branch][release-branch]. If you\nhave specific instructions for your editor, PR's are welcome.\n\n## Dynamic Injection\n\nThanks to `content` node of [`tree-sitter-embedded-template`\ngrammar][embedded-template-grammar], dynamic injections can be attached to\ntemplate body.\n\n### File name pattern convention\n\nTo make it easier to understand which `parser` will be injected and which\nfiletype is used in template `body`, the following pattern is recommended to\nimplement this grammar:\n\n```\n<file-name>.(ext).hygen\n```\n\n### Tree-sitter predicate/directive\n\nTo implement dynamic injection, is recommended to create a predicate/directive\nwith the following name:\n\n```\n#inject-hygen-tmpl!\n```\n\n> [!NOTE]\n> The creation of this predicate/directive varies for each editor\n\n### Implementations\n\n#### hygen.nvim\n\n- [Filetype detection][hygen-nvim-filetype]\n- [Parser register and injection directive][hygen-nvim-tree-sitter]\n- [Dynamic injection query][hygen-nvim-injection-queries]\n\n## References\n\n- [Hygen repository](https://github.com/jondot/hygen)\n- [Hygen website](https://www.hygen.io/)\n\n[ci]: https://github.com/Hdoc1509/tree-sitter-hygen-template/actions/workflows/ci.yml/badge.svg\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[crates]: https://img.shields.io/crates/v/tree-sitter-hygen-template?logo=rust\n[npm]: https://img.shields.io/npm/v/tree-sitter-hygen-template?logo=npm\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-hygen-template?logo=pypi&logoColor=ffd242\n[embedded-template]: https://github.com/tree-sitter/tree-sitter-embedded-template\n[embedded-template-grammar]: https://github.com/tree-sitter/tree-sitter-embedded-template/blob/master/grammar.js\n[hygen-nvim-filetype]: https://github.com/Hdoc1509/hygen.nvim/blob/master/ftdetect/hygen.vim\n[hygen-nvim-injection-queries]: https://github.com/Hdoc1509/hygen.nvim/blob/master/queries/hygen_template/injections.scm\n[hygen-nvim-tree-sitter]: https://github.com/Hdoc1509/hygen.nvim/blob/master/lua/hygen/tree-sitter.lua\n[release-branch]: https://github.com/Hdoc1509/tree-sitter-hygen-template/tree/release\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Hygen Template grammar for tree-sitter",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/Hdoc1509/tree-sitter-hygen-template"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" hygen-template"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "318f3e260fd38b7062a3fd3106d8e850a96bbba6fd9eb5ad13dffdc3a5eef5f8",
"md5": "1434f5a082a871e663f09ea66dd48ba1",
"sha256": "7685e81037c8bbf00c0553faa4e0d6b67569c386c5d13e330e0ce5fcc6d3b74a"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "1434f5a082a871e663f09ea66dd48ba1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 10999,
"upload_time": "2024-11-27T02:18:32",
"upload_time_iso_8601": "2024-11-27T02:18:32.009951Z",
"url": "https://files.pythonhosted.org/packages/31/8f/3e260fd38b7062a3fd3106d8e850a96bbba6fd9eb5ad13dffdc3a5eef5f8/tree_sitter_hygen_template-0.3.2-cp39-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1adfadb6bf35dd69fb865a87196464b0858a9eee6278810a1afa6d4564a12fcc",
"md5": "b1f5b38ee9f8e835606f05a82580f02b",
"sha256": "911db72e17e21356e85e29be7d183ecb3fd421e7dbbf07365ed5581b99992d3e"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "b1f5b38ee9f8e835606f05a82580f02b",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 11473,
"upload_time": "2024-11-27T02:18:33",
"upload_time_iso_8601": "2024-11-27T02:18:33.488225Z",
"url": "https://files.pythonhosted.org/packages/1a/df/adb6bf35dd69fb865a87196464b0858a9eee6278810a1afa6d4564a12fcc/tree_sitter_hygen_template-0.3.2-cp39-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27e9802cc41084c2844fca4f7a979b7e428ed4ab9f07688797f014e31bd52526",
"md5": "ab066374abc5113b55862e27bde77f63",
"sha256": "cf0969133276c40da948477efdec53f9544c046e26ef82068f1954b55f1409a7"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "ab066374abc5113b55862e27bde77f63",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 19970,
"upload_time": "2024-11-27T02:18:34",
"upload_time_iso_8601": "2024-11-27T02:18:34.907857Z",
"url": "https://files.pythonhosted.org/packages/27/e9/802cc41084c2844fca4f7a979b7e428ed4ab9f07688797f014e31bd52526/tree_sitter_hygen_template-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "99e00545cec259f74e86adbfdcb24e6f52a6771d72b81e36eff9492a52d35f63",
"md5": "76a27be7d02e491e54dd670486411b40",
"sha256": "2b9bbc4c890ab8b3045143e24d1baebb986effe9d60e7a90933aa0b09cf38c50"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "76a27be7d02e491e54dd670486411b40",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 19732,
"upload_time": "2024-11-27T02:18:35",
"upload_time_iso_8601": "2024-11-27T02:18:35.759584Z",
"url": "https://files.pythonhosted.org/packages/99/e0/0545cec259f74e86adbfdcb24e6f52a6771d72b81e36eff9492a52d35f63/tree_sitter_hygen_template-0.3.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9fd3a55eb6110351ad8bbc4ed616309f58439245c15b05906e8a54a2456c911",
"md5": "0ece3a0b867b1fb662454fc66585a1e1",
"sha256": "ba554c963d576a18ecb68e1028f442c8c4348c3bd016db2bf9f0b67af74b80de"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "0ece3a0b867b1fb662454fc66585a1e1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 18702,
"upload_time": "2024-11-27T02:18:36",
"upload_time_iso_8601": "2024-11-27T02:18:36.604787Z",
"url": "https://files.pythonhosted.org/packages/b9/fd/3a55eb6110351ad8bbc4ed616309f58439245c15b05906e8a54a2456c911/tree_sitter_hygen_template-0.3.2-cp39-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "882eff2542ec7c584baf49b96177aff0eac85d7f2f5f801780fa08e7dd6caa0a",
"md5": "a1b33a7a07baea969f429afa0c7067f7",
"sha256": "fc15753d2e9cfb33f07eea3751983bb327295c9b988c03f477bab0e606182a7e"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "a1b33a7a07baea969f429afa0c7067f7",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 14097,
"upload_time": "2024-11-27T02:18:38",
"upload_time_iso_8601": "2024-11-27T02:18:38.045633Z",
"url": "https://files.pythonhosted.org/packages/88/2e/ff2542ec7c584baf49b96177aff0eac85d7f2f5f801780fa08e7dd6caa0a/tree_sitter_hygen_template-0.3.2-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ee9df1879c311ff0192accf714010e95ff63a7397eeca9d924feed142a521c7",
"md5": "a4aa2bada2609cc9e2a7cc68cf57a004",
"sha256": "c15813df864d25bc09b8c5a04e180946cf3f7a7b1de9323b5d21a2bf185debdb"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2-cp39-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "a4aa2bada2609cc9e2a7cc68cf57a004",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 12783,
"upload_time": "2024-11-27T02:18:38",
"upload_time_iso_8601": "2024-11-27T02:18:38.822182Z",
"url": "https://files.pythonhosted.org/packages/5e/e9/df1879c311ff0192accf714010e95ff63a7397eeca9d924feed142a521c7/tree_sitter_hygen_template-0.3.2-cp39-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3261f5413693ec7d89d69ecd8eb887b599a58afbe2391fdc1c076a5412f96fa",
"md5": "98b7f0a53eece129d8203159666e3999",
"sha256": "a731805b21df6afe4593deefd150666c298ff9c80fb9d4bd4cb4660913a241d5"
},
"downloads": -1,
"filename": "tree_sitter_hygen_template-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "98b7f0a53eece129d8203159666e3999",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 10996,
"upload_time": "2024-11-27T02:18:40",
"upload_time_iso_8601": "2024-11-27T02:18:40.218120Z",
"url": "https://files.pythonhosted.org/packages/f3/26/1f5413693ec7d89d69ecd8eb887b599a58afbe2391fdc1c076a5412f96fa/tree_sitter_hygen_template-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 02:18:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Hdoc1509",
"github_project": "tree-sitter-hygen-template",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-hygen-template"
}