[![Build Status](https://travis-ci.org/allsopp/p6-html-boredom.svg?branch=master)](https://travis-ci.org/allsopp/p6-html-boredom) # HTML::BoreDOM Write HTML programmatically: > use HTML::BoreDOM; > put > h("html", > h("body", > h("h1", "Hello, World!"), > h("p", "Lorem ipsum...")));

Hello, World!

Lorem ipsum...

The `h()` subroutine is imported automatically and returns an object (that stringifies to escaped HTML): > h("span", "foo"); HTML::BoreDOM::Element.new(tag => "span", attrs => ${}, children => $["foo"]) > ~h("span", "foo"); foo HTML attributes are optionally declared using named arguments: > ~h("a", :href, :target<_blank>, "Click Here!") Click Here! Looping is easy: > my @items = ; > ~h("ul", > @items.map({ h("li", $_) })); Templates are just functions: > sub foo ($title, $subtitle, $content) { > ~ h("h1", $title) > ~ h("h2", $subtitle) > ~ h("p", $content) > } > foo("My Website", "Using templates", "Lorem ipsum ...");

My Website

Using templates

Lorem ipsum ...

## Caveats Inline `