{"id":21326240,"url":"https://github.com/masylum/trimmer","last_synced_at":"2025-03-15T23:44:38.260Z","repository":{"id":2528796,"uuid":"3505260","full_name":"masylum/trimmer","owner":"masylum","description":"Rack endpoint to make templates and i18n translations available in javascript","archived":false,"fork":false,"pushed_at":"2012-01-25T13:42:10.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T12:32:41.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/teambox/trimmer","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masylum.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-21T15:47:32.000Z","updated_at":"2017-09-21T21:20:20.000Z","dependencies_parsed_at":"2022-09-09T23:02:26.466Z","dependency_job_id":null,"html_url":"https://github.com/masylum/trimmer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Ftrimmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Ftrimmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Ftrimmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Ftrimmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masylum","download_url":"https://codeload.github.com/masylum/trimmer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806041,"owners_count":20350775,"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":[],"created_at":"2024-11-21T21:08:53.574Z","updated_at":"2025-03-15T23:44:38.241Z","avatar_url":"https://github.com/masylum.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Trimmer Controller\n=================\n\nRack endpoint to make templates and i18n translations available in javascript.\n\nSee specs for more details.\n\nHow it works\n------------\n\nTrimmer adds additional routes to your app:\n\n- /trimmer/en.js\n- /trimmer/es.js\n- etc\n\nThis defines two variables in your app: I18n.translations and Templates.\n\nTranslations\n------------\n\nTrimmer will serve the translations you define from your config/locales files available as a JS object.\n\nTemplates\n---------\n\nThis is the cool part. You can define your own structure of client-side templates which will be:\n\n1. Rendered by Rails (where you can access ERB, helpers and Rails i18n)\n2. Available in JS as templates\n\nTo add templates, create a folder structure like this:\n\n    app/\n      templates/\n        users/\n          index.jade.erb\n          show.jade.erb\n        settings.jade.erb\n\nThis will create a JS object with this structure:\n\n    Templates = {\n      users: {\n        index: \"...\",\n        show: \"...\"\n      },\n      settings: \"...\"\n    }\n\n\n          \n          \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasylum%2Ftrimmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasylum%2Ftrimmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasylum%2Ftrimmer/lists"}