{"id":15916811,"url":"https://github.com/hdoc1509/tree-sitter-hygen-template","last_synced_at":"2025-03-24T07:31:38.028Z","repository":{"id":257811693,"uuid":"863078099","full_name":"Hdoc1509/tree-sitter-hygen-template","owner":"Hdoc1509","description":"Tree-sitter grammar for Hygen templates","archived":false,"fork":false,"pushed_at":"2024-11-27T02:16:00.000Z","size":250,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T03:05:58.358Z","etag":null,"topics":["hygen","parser","template","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hdoc1509.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-25T17:14:41.000Z","updated_at":"2024-12-27T11:46:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"54c5fd66-e0fe-4e3c-8bd9-6f85f28a4017","html_url":"https://github.com/Hdoc1509/tree-sitter-hygen-template","commit_stats":{"total_commits":127,"total_committers":1,"mean_commits":127.0,"dds":0.0,"last_synced_commit":"c2ba0b3641f14c0ae54675f7d0b87c9e77962f92"},"previous_names":["hdoc1509/tree-sitter-hygen-template"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hdoc1509%2Ftree-sitter-hygen-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hdoc1509%2Ftree-sitter-hygen-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hdoc1509%2Ftree-sitter-hygen-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hdoc1509%2Ftree-sitter-hygen-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hdoc1509","download_url":"https://codeload.github.com/Hdoc1509/tree-sitter-hygen-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245227415,"owners_count":20580873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hygen","parser","template","tree-sitter"],"created_at":"2024-10-06T18:04:55.131Z","updated_at":"2025-03-24T07:31:38.020Z","avatar_url":"https://github.com/Hdoc1509.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u003c!--\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--\u003e\n\n### Emacs\n\n_To be added_\n\n\u003c!--\nTODO: take reference from:\nhttps://github.com/tree-sitter-perl/tree-sitter-perl?tab=readme-ov-file#emacs\n--\u003e\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\u003cfile-name\u003e.(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\u003e [!NOTE]\n\u003e 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\u0026label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix\u0026label=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\u0026logoColor=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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdoc1509%2Ftree-sitter-hygen-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdoc1509%2Ftree-sitter-hygen-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdoc1509%2Ftree-sitter-hygen-template/lists"}