{"id":16985379,"url":"https://github.com/fengb/tilt-prawn","last_synced_at":"2026-03-17T14:54:41.761Z","repository":{"id":18418685,"uuid":"21600683","full_name":"fengb/tilt-prawn","owner":"fengb","description":null,"archived":false,"fork":false,"pushed_at":"2015-06-01T05:32:41.000Z","size":162,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T17:21:44.110Z","etag":null,"topics":[],"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/fengb.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":"2014-07-08T05:54:23.000Z","updated_at":"2015-12-05T00:20:24.000Z","dependencies_parsed_at":"2022-09-02T06:54:18.619Z","dependency_job_id":null,"html_url":"https://github.com/fengb/tilt-prawn","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengb%2Ftilt-prawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengb%2Ftilt-prawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengb%2Ftilt-prawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengb%2Ftilt-prawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengb","download_url":"https://codeload.github.com/fengb/tilt-prawn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968756,"owners_count":21191158,"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-10-14T02:43:20.096Z","updated_at":"2026-03-17T14:54:34.634Z","avatar_url":"https://github.com/fengb.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tilt-prawn [![Build Status](https://travis-ci.org/fengb/tilt-prawn.png?branch=master)](https://travis-ci.org/fengb/tilt-prawn)\n\nAdds support for rendering [Prawn](http://prawn.majesticseacreature.com/) templates using [Tilt](https://github.com/rtomayko/tilt).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'tilt-prawn'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tilt-prawn\n\n## Usage\n\nCreate a Prawn template file with a `.prawn` extension\n\nExample, in `hello.prawn`:\n\n```ruby\npdf.text \"Hello #{name}\"\n```\n\nThen, render the template with Ruby:\n\n```ruby\nrequire 'tilt/prawn'\n\ntemplate = Tilt.new('hello.prawn')\nputs template.render(nil, name: 'Bob')\n```\n\n## Customization\n\nAdditional convenience methods may be added to the rendering engine:\n\n```ruby\nTilt::PrawnTemplate.extend_engine do\n  def date_text(date)\n    text date.strftime('%b %d, %Y')\n  end\nend\n```\n\n`date_text` is now available as an instance method on the renderer:\n\n```ruby\npdf.date_text(Date.today)\n```\n\nIf you defined an external class as a base template, you may use it instead of\nthe default class:\n\n```ruby\nclass CustomEngine \u003c Prawn::Document\nend\n\nTilt::PrawnTemplate.engine = CustomEngine\n```\n\nAlternatively, may be passed in as an argument to the template constructor:\n\n```ruby\ntemplate = Tilt.new('hello.prawn', engine: CustomEngine)\nputs template.render\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengb%2Ftilt-prawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengb%2Ftilt-prawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengb%2Ftilt-prawn/lists"}