1-06

The Papercraft DSL Implementation

DSL:

->(foo, bar) {
  div {
    h1 foo
    p bar
  }
}
  

Compiled:

->(__buffer__, foo, bar) {
  __buffer__ << '<div><h1>'
  __buffer__ << ERB::Escape.html_escape(foo)
  __buffer__ << '</h1><p>'
  __buffer__ << ERB::Escape.html_escape(bar)
  __buffer__ << '</p></div>'
  __buffer__
}