Project

papercraft

0.06
A long-lived project that still receives updates
Papercraft: functional HTML templating for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.6.1
~> 1.15.2
~> 2.14.0
~> 5.25.5

Runtime

~> 5.1.1
~> 1.0.1
~> 2.5.1
~> 4.6.1
 Project Readme


Papercraft

Functional HTML templating for Ruby

Ruby gem Tests MIT License

require 'papercraft'

Papercraft.html {
  div {
    h1 "Hello from Papercraft!"
  }
}
#=> "<div><h1>Hello from Papercraft</h1></div>"

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.