{"id":15406781,"url":"https://github.com/dannyben/erbx","last_synced_at":"2025-06-14T21:04:03.307Z","repository":{"id":37007083,"uuid":"258546882","full_name":"DannyBen/erbx","owner":"DannyBen","description":"ERB Extended with Pretty Tags","archived":false,"fork":false,"pushed_at":"2024-01-27T15:13:06.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T11:11:42.887Z","etag":null,"topics":["erb","ruby","template-language"],"latest_commit_sha":null,"homepage":null,"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/DannyBen.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}},"created_at":"2020-04-24T15:11:57.000Z","updated_at":"2024-01-27T11:06:45.000Z","dependencies_parsed_at":"2024-01-27T16:39:12.625Z","dependency_job_id":null,"html_url":"https://github.com/DannyBen/erbx","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"7e177f73d80606abd0047a3c6d9515807b1cc1aa"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/DannyBen/erbx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Ferbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Ferbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Ferbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Ferbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/erbx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Ferbx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259884416,"owners_count":22926440,"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":["erb","ruby","template-language"],"created_at":"2024-10-01T16:25:21.662Z","updated_at":"2025-06-14T21:04:03.290Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ERBX - ERB Extended with Pretty Tags\n\n[![Gem Version](https://badge.fury.io/rb/erbx.svg)](https://badge.fury.io/rb/erbx)\n[![Build Status](https://github.com/DannyBen/erbx/workflows/Test/badge.svg)](https://github.com/DannyBen/erbx/actions?query=workflow%3ATest)\n\n---\n\nERBX is a tiny extension to ERB allowing these tags:\n\n- `{{ ... }}` as an equivalent to `\u003c%= ... %\u003e` (print ruby code)\n- `(( ... ))` as an equivalent to `\u003c%- ... -%\u003e` (run ruby code)\n\nBoth tag pairs are configurable.\n\n---\n\n## Installation\n\n```\n$ gem install erbx\n```\n\n## Usage\n\nGiven this ERBX templalte:\n\n```\n# example/template.md\n((\n# Any ruby code can go here\ntoday = Time.now.strftime \"%B %d, %Y\"\ndice = [rand(6) + 1, rand(6) + 1]\n))\n\nThis roll of a dice happened on {{ today }}.\n(( if dice[0] == dice[1] ))\nCongratulations, its a double: {{ dice }}\n(( else ))\nYou rolled {{ dice }}\n(( end ))\n```\n\nRender it with `ERBX.new`, which returns an `ERB` instance, after replacing\nthe extended tags - `{{ }}` and `(( ))` - with their `ERB` equivalents.\n\n```ruby\n# Render example\nrequire 'erbx'\n\ntemplate = ERBX.load 'example/template.md'\np template.class\n#=\u003e ERB\n\nputs template.result\n#=\u003e \n#=\u003e This roll of a dice happened on April 24, 2020.\n#=\u003e You rolled [4, 2]\n```\n\n## Custom Tags\n\nIf you wish to use different tags in your template, you can provide them using\nthese four options:\n\n- `code_open` - default `((`\n- `code_close` - default `))`\n- `output_open` - default `{{`\n- `output_close` - default `}}`\n\nFor example:\n\n```ruby\n# Render example with options\nrequire 'erbx'\n\ntemplate = ERBX.load 'example/template2.md', code_open: '===[', code_close: ']==='\nputs template.result_with_hash number: rand(100..999)\n#=\u003e This template only uses output tags, and uses data provided by the caller.\n#=\u003e This is useful when the file may contain (( markers like these )) that are\n#=\u003e not intended to be interpreted as code.\n#=\u003e \n#=\u003e Random number: 938\n\n```\n\n## Contributing / Support\n\nIf you experience any issue, have a question or a suggestion, or if you wish\nto contribute, feel free to [open an issue][issues].\n\n---\n\n[issues]: https://github.com/DannyBen/erbx/issues\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Ferbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Ferbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Ferbx/lists"}