{"id":21409840,"url":"https://github.com/stackbuilders/simple_templates","last_synced_at":"2025-03-16T17:45:08.366Z","repository":{"id":33094238,"uuid":"36731757","full_name":"stackbuilders/simple_templates","owner":"stackbuilders","description":"DEPRECATED: A minimalistic templating engine for Ruby","archived":false,"fork":false,"pushed_at":"2023-08-02T17:21:42.000Z","size":182,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-01-23T04:32:39.623Z","etag":null,"topics":["archived","deprecated","obsolete"],"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/stackbuilders.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}},"created_at":"2015-06-02T12:33:14.000Z","updated_at":"2023-08-30T17:54:13.000Z","dependencies_parsed_at":"2024-11-22T21:34:04.045Z","dependency_job_id":null,"html_url":"https://github.com/stackbuilders/simple_templates","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fsimple_templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fsimple_templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fsimple_templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbuilders%2Fsimple_templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbuilders","download_url":"https://codeload.github.com/stackbuilders/simple_templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910690,"owners_count":20367538,"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":["archived","deprecated","obsolete"],"created_at":"2024-11-22T17:34:33.975Z","updated_at":"2025-03-16T17:45:08.343Z","avatar_url":"https://github.com/stackbuilders.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/stackbuilders/simple_templates.svg?branch=master)](https://travis-ci.org/stackbuilders/simple_templates)\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n\u003e **⚠️ Warning:** This library has been deprecated and is no longer maintained. It will not receive any further security patches, features, or bug fixes and is preserved here at GitHub for archival purposes. If you want to use it, we suggest forking the repository and auditing the codebase before use. For more information, contact us at info@stackbuilders.com.\n\n# DEPRECATED - simple_templates\n\n`simple_templates` is a minimalistic templates engine. This gem allows you to\nwork with several types of templates.\n\n## Installation\n\nClone the project\n\n```\ngit@github.com:stackbuilders/simple_templates.git\n```\n\nInstall the dependencies\n\n```\nbundle install\n```\n\nRun the tests\n\n```\nrake test\n```\n\n## Quick Start\n\nThe basic use of the library can be seen like this:\n\nYou can send a `String` with the raw input that includes your placeholders and\na list of `String` containing the allowed placeholders, if it is `nil`, then all\nthe placeholders are allowed.\n\nA example without errors, that allows us to call the method `render`\n\n```ruby\n  template = SimpleTemplates.parse(\"Hi \u003cname\u003e\", %w[name])\n  template.render({ name: \"Bob\" }) if template.errors.empty?\n  =\u003e \"Hi Bob\"\n  template.remaining_tokens\n  =\u003e []\n```\n\nAn example with errors. Since the allowed placeholder is not in the raw input.\nSo we get are going to get a list of errors when parsing\n\n```ruby\n  template = SimpleTemplates.parse(\"Hi \u003cname\u003e\", %w[date])\n  template.errors\n  =\u003e [...] # unknown placeholder\n```\n\n### Serialization Support\n\nYou can serialize a template out of the box by calling the method `to_json`.\n\n```ruby\n  template = SimpleTemplates.parse(\"Hi \u003cname\u003e\", %w[name])\n  template.to_json\n  # =\u003e \"{\\\"ast\\\":[{\\\"contents\\\":\\\"Hi...\n```\n\nYou can also deserialize a serialized template.\n\n```ruby\n  SimpleTemplates::Template.from_json(template.to_json)\n  # =\u003e #\u003cSimpleTemplates::Template:0x007fad96056ae0...\n```\n\n## Tasks\n\nThe default task executed by `rake` is only\n\n```\nrake test\n```\n\nAdditionally you can generate the documentation by running\n\n```\nrake docs\n```\n\n## License\n\nMIT. See [LICENSE](https://github.com/stackbuilders/simple_templates/blob/master/LICENSE)\n\n---\n\u003cimg src=\"https://cdn.stackbuilders.com/media/images/Sb-supports.original.png\" alt=\"Stack Builders\" width=\"50%\"\u003e\u003c/img\u003e  \n[Check out our libraries](https://github.com/stackbuilders/) | [Join our team](https://www.stackbuilders.com/join-us/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fsimple_templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbuilders%2Fsimple_templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbuilders%2Fsimple_templates/lists"}