{"id":13483871,"url":"https://github.com/jeromegn/kilt","last_synced_at":"2025-08-21T00:32:06.207Z","repository":{"id":4020735,"uuid":"51705778","full_name":"jeromegn/kilt","owner":"jeromegn","description":"Generic template interface for Crystal","archived":false,"fork":false,"pushed_at":"2022-06-01T22:13:15.000Z","size":31,"stargazers_count":151,"open_issues_count":4,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-07T23:39:06.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/jeromegn.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}},"created_at":"2016-02-14T17:52:54.000Z","updated_at":"2024-11-28T16:32:17.000Z","dependencies_parsed_at":"2022-08-30T16:41:36.364Z","dependency_job_id":null,"html_url":"https://github.com/jeromegn/kilt","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/jeromegn/kilt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromegn%2Fkilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromegn%2Fkilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromegn%2Fkilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromegn%2Fkilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeromegn","download_url":"https://codeload.github.com/jeromegn/kilt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromegn%2Fkilt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271409459,"owners_count":24754716,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-07-31T17:01:16.295Z","updated_at":"2025-08-21T00:32:05.967Z","avatar_url":"https://github.com/jeromegn.png","language":"Crystal","funding_links":[],"categories":["Template Engine"],"sub_categories":[],"readme":"# Kilt [![Build Status](https://travis-ci.org/jeromegn/kilt.svg?branch=master)](https://travis-ci.org/jeromegn/kilt)\n\nGeneric templating interface for Crystal.\n\n## Goal\n\nSimplify developers' lives by abstracting template rendering for multiple template languages.\n\n## Supported out of the box\n\n| Language | File extensions | Required libraries | Maintainer |\n| -------- | --------------- | ------------------ | ---------- |\n| ECR      | .ecr            | none (part of the stdlib) | |\n| Mustache | .mustache       | [crustache](https://github.com/MakeNowJust/crustache) | [@MakeNowJust](https://github.com/MakeNowJust) |\n| Slang    | .slang          | [slang](https://github.com/jeromegn/slang) | [@jeromegn](https://github.com/jeromegn) |\n| Temel    | .temel          | [temel](https://github.com/f/temel) | [@f](https://github.com/f) |\n| Crikey   | .crikey         | [crikey](https://github.com/domgetter/crikey) | [@domgetter](https://github.com/domgetter) |\n| Liquid   | .liquid         | [liquid](https://github.com/TechMagister/liquid.cr) | [@docelic](https://github.com/docelic) |\n| Jbuilder | .jbuilder       | [jbuilder](https://github.com/shootingfly/jbuilder) | [@shootingfly](https://github.com/shootingfly) |\n| Water    | .water          | [water](https://github.com/shootingfly/water) | [@shootingfly](https://github.com/shootingfly) |\n\nSee also:\n[Registering your own template engine](#registering-your-own-template-engine).\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  kilt:\n    github: jeromegn/kilt\n\n  # Any other template languages Crystal shard\n```\n\n## Usage\n\n- Kilt essentially adds two macros `Kilt.embed` and `Kilt.file`, the code is really simple.\n- Add template language dependencies, as listed in the support table above.\n\nBoth macros take a `filename` and a `io_name` (the latter defaults to `\"__kilt_io__\"`)\n\n### Example\n\n```crystal\nrequire \"kilt\"\n\n# For slang, add:\nrequire \"kilt/slang\"\n\n# With a Class\n\nclass YourView\n  Kilt.file(\"path/to/template.ecr\") # Adds a to_s method\nend\nputs YourView.new.to_s # =\u003e \u003ccompiled template\u003e\n\n\n# Embedded\n\nstr = Kilt.render \"path/to/template.slang\"\n\n# or\n\nstr = String.build do |__kilt_io__|\n  Kilt.embed \"path/to/template.slang\"\nend\n\nputs str # =\u003e \u003ccompiled template\u003e\n```\n\n## Registering your own template engine\n\nUse `Kilt.register_engine(extension, embed_command)` macro:\n\n```crystal\nrequire \"kilt\"\n\nmodule MyEngine\n  macro embed(filename, io_name)\n    # ....\n  end\nend\n\nKilt.register_engine(\"myeng\", MyEngine.embed)\n```\n\nThis can be part of your own `my-engine` library: in this case it should depend\non `kilt` directly, or this could be a part of adapter library, like:\n`kilt-my-engine`, which will depend on both `kilt` and `my-engine`.\n\n## Contributing\n\nPlease contribute your own \"adapter\" if you create a template language for Crystal that's not yet supported here!\n\n1. Fork it ( https://github.com/jeromegn/kilt/fork )\n2. Create your feature branch (git checkout -b my-awesome-template-language)\n3. Commit your changes (git commit -am 'Add my-awesome-template-language')\n4. Push to the branch (git push origin my-awesome-template-language)\n5. Create a new Pull Request\n\n## Contributors\n\n- [jeromegn](https://github.com/jeromegn) Jerome Gravel-Niquet - creator, maintainer\n- [waterlink](https://github.com/waterlink) Oleksii Fedorov\n- [MakeNowJust](https://github.com/MakeNowJust) TSUYUSATO Kitsune\n- [f](https://github.com/f) Fatih Kadir Akın\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeromegn%2Fkilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeromegn%2Fkilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeromegn%2Fkilt/lists"}