{"id":31581435,"url":"https://github.com/federicotdn/templ-mode","last_synced_at":"2026-05-15T13:06:45.809Z","repository":{"id":305040812,"uuid":"1021019863","full_name":"federicotdn/templ-mode","owner":"federicotdn","description":"Emacs major mode for editing Templ template files","archived":false,"fork":false,"pushed_at":"2025-08-19T21:51:06.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T21:58:46.171Z","etag":null,"topics":["emacs","go","html","mode","templ","template","tool"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/federicotdn.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2025-07-16T18:46:41.000Z","updated_at":"2025-10-05T12:32:53.000Z","dependencies_parsed_at":"2025-07-18T03:01:12.261Z","dependency_job_id":"98ad853a-9e80-4874-9199-855094ef62f7","html_url":"https://github.com/federicotdn/templ-mode","commit_stats":null,"previous_names":["federicotdn/templ-mode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/federicotdn/templ-mode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicotdn%2Ftempl-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicotdn%2Ftempl-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicotdn%2Ftempl-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicotdn%2Ftempl-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/federicotdn","download_url":"https://codeload.github.com/federicotdn/templ-mode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicotdn%2Ftempl-mode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["emacs","go","html","mode","templ","template","tool"],"created_at":"2025-10-05T21:57:53.346Z","updated_at":"2026-05-15T13:06:45.803Z","avatar_url":"https://github.com/federicotdn.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# templ-mode\n\nEmacs (30.1+) major mode for editing [Templ](https://templ.guide/) template files.\n\nTempl is a language for writing HTML user interfaces in Go. This mode provides syntax highlighting, formatting, and LSP support for `.templ` files in Emacs.\n\n\u003e [!NOTE]\n\u003e This mode depends on and extends [go-mode](https://github.com/dominikh/go-mode.el). It will not work with other Go-related modes.\n\n\u003e [!NOTE]\n\u003e This mode does **not** depend on tree-sitter.\n\n## Installation\n\nDownload `templ-mode.el` and place it in your Emacs load path.\n\n## Usage\n\n### Basic Usage\n\nThe mode automatically activates for `.templ` files. It extends `go-mode` with additional syntax highlighting for:\n\n- `templ` keywords and function definitions.\n- `@` directives for component calls.\n- HTML-like tags within templates.\n\n### Formatting\n\nUse \u003ckbd\u003eM-x\u003c/kbd\u003e `templ-fmt` \u003ckbd\u003eRET\u003c/kbd\u003e to format the current buffer using `templ fmt`.\n\n### Configuration\n\nBy default, `templ-mode` looks for the `templ` binary in your PATH. You can customize this:\n\n```elisp\n;; Use a specific path to the templ binary\n(setq templ-mode-command \"/path/to/templ\")\n\n;; Or use templ as a Go tool (requires templ to be installed as a Go tool)\n(setq templ-mode-command 'tool)\n```\n\nWhen using `'tool`, the mode will run `go tool templ` from your project root as returned by `(project-root (project-current))`.\n\nGo tools were introduced in Go 1.24. Read more about them [here](https://tip.golang.org/doc/go1.24#tools).\n\n### LSP Support\n\nThe mode automatically configures Eglot to work with the Templ LSP server. To start the server, use \u003ckbd\u003eM-x\u003c/kbd\u003e `eglot` \u003ckbd\u003eRET\u003c/kbd\u003e in a `.templ` buffer.\n\n\u003e [!WARNING]\n\u003e After running `eglot`, the server may take an unusual amount of time to start up, e.g. 15 seconds or more.\n\n## Related Packages\n\n- [templ-ts-mode](https://github.com/danderson/templ-ts-mode): Uses tree-sitter instead of the older regexp-based approach for font-locking.\n- [poly-templ](https://github.com/rcy/poly-templ): Uses [polymode](https://github.com/polymode/polymode) to implement Templ syntax highlighting.\n\n## License\n\nDistributed under the GNU General Public License, version 3.\n\nSee [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericotdn%2Ftempl-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericotdn%2Ftempl-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericotdn%2Ftempl-mode/lists"}