{"id":18105451,"url":"https://github.com/iamvery/ratchet","last_synced_at":"2025-04-13T19:32:01.324Z","repository":{"id":57540257,"uuid":"58683970","full_name":"iamvery/ratchet","owner":"iamvery","description":"Plain HTML Templates","archived":false,"fork":false,"pushed_at":"2017-07-18T03:40:36.000Z","size":88,"stargazers_count":27,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T10:21:20.508Z","etag":null,"topics":["elixir","ratchet","template","template-engine","views"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/ratchet","language":"Elixir","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/iamvery.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-12T23:26:49.000Z","updated_at":"2024-07-06T22:05:32.000Z","dependencies_parsed_at":"2022-09-26T18:31:08.219Z","dependency_job_id":null,"html_url":"https://github.com/iamvery/ratchet","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamvery%2Fratchet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamvery%2Fratchet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamvery%2Fratchet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamvery%2Fratchet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamvery","download_url":"https://codeload.github.com/iamvery/ratchet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248767989,"owners_count":21158568,"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":["elixir","ratchet","template","template-engine","views"],"created_at":"2024-10-31T22:18:49.660Z","updated_at":"2025-04-13T19:32:00.993Z","avatar_url":"https://github.com/iamvery.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ratchet\n\n[![Build Status][travis-img]][travis] [![Hex Version][hex-img]][hex]\n\n[travis-img]: https://travis-ci.org/iamvery/ratchet.svg?branch=master\n[travis]: https://travis-ci.org/iamvery/ratchet\n[hex-img]: https://img.shields.io/hexpm/v/ratchet.svg\n[hex]: https://hex.pm/packages/ratchet\n\nRatchet is a friendly little transformer that's here to fix your views.\n\nFor use with [Phoenix][phoenix], check out [PhoenixRatchet][phoenix-ratchet].\n\nFor more information, see the [Documentation][docs].\n\nGiven a plain HTML view template like this:\n\n```html\n\u003csection\u003e\n  \u003carticle data-prop=\"post\"\u003e\n    \u003ch2 data-prop=\"title\"\u003e\u003c/h2\u003e\n    \u003cp data-prop=\"body\"\u003e\u003c/p\u003e\n    \u003ca data-prop=\"permalink\"\u003e\u003c/a\u003e\n    \u003cul\u003e\n      \u003cli data-prop=\"comments\"\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/article\u003e\n\u003c/section\u003e\n```\n\nIt can be transformed into your final view by applying data:\n\n```elixir\ndata = %{\n  post: [\n    %{title: \"Ratchet is here!\", body: \"Hope you like it\", permalink: {\"Iamvery\", href: \"https://iamvery.com\"}, comments: [\"Not bad\"]},\n    %{title: \"Robots\", body: \"What's the deal with them?\", permalink: {\"Google\", href: \"https://google.com\"}, comments: [\"Yea!\", \"Nah\"]},\n  ]\n}\n```\n\n```html\n\u003csection\u003e\n  \u003carticle data-prop=\"post\"\u003e\n    \u003ch2 data-prop=\"title\"\u003eRatchet is here!\u003c/h2\u003e\n    \u003cp data-prop=\"body\"\u003eHope you like it\u003c/p\u003e\n    \u003ca href=\"https://iamvery.com\" data-prop=\"permalink\"\u003eIamvery\u003c/a\u003e\n    \u003cul\u003e\n      \u003cli data-prop=\"comments\"\u003eNot bad\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/article\u003e\n  \u003carticle data-prop=\"post\"\u003e\n    \u003ch2 data-prop=\"title\"\u003eRobots\u003c/h2\u003e\n    \u003cp data-prop=\"body\"\u003eWhat's the deal with them?\u003c/p\u003e\n    \u003ca href=\"https://google.com\" data-prop=\"permalink\"\u003eGoogle\u003c/a\u003e\n    \u003cul\u003e\n      \u003cli data-prop=\"comments\"\u003eYea!\u003c/li\u003e\n      \u003cli data-prop=\"comments\"\u003eNah\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/article\u003e\n\u003c/section\u003e\n```\n\n## Installation\n\n1. Install with Hex:\n\n   ```elixir\n   def deps do\n     [{:ratchet, \"~\u003e 0.4\"}]\n   end\n   ```\n\n## Background\n\nRatchet is inspired by [Pakyow's][pakyow] [view transformation protocol][vtp].\nOne of the benefits of this style of view templates is designers don't have to learn whatever the latest templating language.\nInstead views are plain HTML and CSS.\nOnce you get an HTML prototype from design, you can sprinkle in the appropriate properties for data binding.\n\n## Release\n\n1. Bump the version in `mix.exs`.\n1. Add version to CHANGELOG.\n1. Commit version with Git tag `vX.X.X`.\n1. Draft GitHub release.\n1. Publish to Hex.\n\n   ```\n   $ mix do hex.publish, hex.publish docs\n   ```\n\n\n[phoenix]: http://www.phoenixframework.org/\n[phoenix-ratchet]: https://github.com/iamvery/phoenix_ratchet\n[pakyow]: https://pakyow.org\n[docs]: https://hexdocs.pm/ratchet\n[vtp]: https://pakyow.org/docs/concepts/view-transformation-protocol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamvery%2Fratchet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamvery%2Fratchet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamvery%2Fratchet/lists"}