Skip to content

digital-fabric/papercraft

Repository files navigation


Papercraft

Functional HTML templating for Ruby

Ruby gem Tests MIT License

require 'papercraft'

-> {
  h1 "Hello from Papercraft!"
}.render
#=> "<h1>Hello from Papercraft</h1>"

Papercraft is a templating engine for dynamically producing HTML in Ruby apps. Papercraft templates are expressed as Ruby procs, leading to easier debugging, better protection against HTML injection attacks, and better code reuse.

Papercraft templates can be composed in a variety of ways, facilitating the usage of layout templates, and enabling a component-oriented approach to building web interfaces of arbitrary complexity.

In Papercraft, dynamic data is passed explicitly to the template as block/lambda arguments, making the data flow easy to follow and understand. Papercraft also lets developers create derivative templates using full or partial parameter application.

Documentation

For more information, please consult the Papercraft website.

Sponsor this project

 

Contributors 7

Languages