elrzn / duplo

HTML from Perl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

duplo

Duplo generates html.

Examples

Whirlwind

html_(
  head_(
    title_('This is an example')),
  body_(
    h1_('Hello, World!'),
    div_({class => 'container', style => 'border: 1px black solid;'},
      ul_({style => 'list-style-type: circle;'},
        map { li_ 'Number is: ', $_ } 1 .. 5),
      img_({src => 'image.jpg', alt => 'An image'}),
      p_("That's all folks!"))));

Templates

sub template {
  my $title = shift;
  html_(
    head_(
      title_($title_)),
    body_(
      @_,
      div_({class => 'footer'},
        p_("That's all folks!"))))
}

template('Template example',
  h1_('Hello, World!'),
  div_(
    h2_('Oh hai!')));

About

HTML from Perl

License:Artistic License 2.0


Languages

Language:Perl 100.0%