{"id":19861288,"url":"https://github.com/sirscriptalot/tempeh","last_synced_at":"2025-11-24T13:04:14.173Z","repository":{"id":59157451,"uuid":"96004155","full_name":"sirscriptalot/tempeh","owner":"sirscriptalot","description":"Tasty Ruby Templates","archived":false,"fork":false,"pushed_at":"2017-08-02T19:22:55.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T11:02:38.754Z","etag":null,"topics":["ruby","template"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/sirscriptalot.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":"2017-07-02T05:23:44.000Z","updated_at":"2017-07-04T04:56:25.000Z","dependencies_parsed_at":"2022-09-13T17:50:48.573Z","dependency_job_id":null,"html_url":"https://github.com/sirscriptalot/tempeh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirscriptalot%2Ftempeh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirscriptalot%2Ftempeh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirscriptalot%2Ftempeh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirscriptalot%2Ftempeh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirscriptalot","download_url":"https://codeload.github.com/sirscriptalot/tempeh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241263404,"owners_count":19936057,"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":["ruby","template"],"created_at":"2024-11-12T15:08:34.085Z","updated_at":"2025-11-24T13:04:09.149Z","avatar_url":"https://github.com/sirscriptalot.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tempeh\n\nTasty Ruby Templates\n\n## Description\n\nTempeh is an opininated template engine for rendering html. It steals\nmost of its ideas from [Mote](https://github.com/soveran/mote)\nand the [Herb](https://github.com/frodsan/herb) fork. The motivation for\na new library is the different rendering API that is designed\nfor lazily binding a context with instance_eval for use with view components.\n\n## Installation\n\n`gem install tempeh`\n\n## Example\n\n```ruby\n# ./templates/eat.tempeh\n#\n# % if hungry? %\n#  Eat {{ food }}!\n# % end %\n\nrequire 'tempeh'\n\nclass View\n  include Tempeh::Helpers\n\n  def initialize(food)\n    @food = food\n  end\n\n  def food\n    @food\n  end\n\n  def hungry?\n    true\n  end\nend\n\nView.new('Tempeh').render('./templates/eat.tempeh') # Eat Tempeh!\n```\n\n## API\n\n### Templates\n\n`% code %`: Ruby to be evaluated but not outputted.\n\n`{{ code }}`: Ruby that gets outputted as an escaped string. Safe for user input.\n\n`{{\u0026 code }}`: Ruby that gets outputted as an unescaped string. Useful for rendering partials and other content that is guarenteed to be safe.\n\n### Module Methods\n\n`cache`: Hash of compiled templates, populated by the `render` helper.\n\n`compile`: Creates a proc from the the given string.\n\n`escape`: HTML escapes the given string.\n\n### Helpers\n\n`render`: instance_eval's a template found at a file path. Saves the compiled template in `Tempeh::cache` for reuse.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirscriptalot%2Ftempeh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirscriptalot%2Ftempeh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirscriptalot%2Ftempeh/lists"}