github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

bingos / html-declare

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • 2.4
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

(perl) For When Template Systems Are Too Huge And Heredocs Too Messy — Read more

  cancel

http://search.cpan.org/dist/HTML-Declare/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Updates to Makefile.PL removed auto_install and added extra meta 
generation 
Chris Williams (author)
Mon Jun 01 07:29:27 -0700 2009
commit  0770e9c950d3566861601b61b9fac42b5e641666
tree    4514687a6ebaec8b1782bf4ad4676a221a1e2f62
parent  1e1341c54c6b1898bdcec76944f01156888e028e
html-declare /
name age
history
message
file Changes Loading commit data...
file LICENSE
file MANIFEST
file Makefile.PL
file README
directory lib/
directory t/
README
NAME
    HTML::Declare - For When Template Systems Are Too Huge And Heredocs Too
    Messy

SYNOPSIS
        # Import all constructors
        use HTML::Declare ':all';

        # A simple hello world
        print HTML { 
            _ => [
                HEAD { _ => TITLE { _ => 'Hello World!' } },
                BODY { _ => 'Hello World!' } 
            ]   
        };

        # Import specific constructors
        use HTML::Declare qw/DIV A/;

        # A simple anchor nested in a div
        my $tree = DIV {
            _ => [
                A {
                    href => 'http://127.0.0.1',
                    _    => '<< Home Sweet Home!'
                }
            ]
        };
        print "$tree";

DESCRIPTION
    A very simple micro language to generate HTML.

    This is not a real template system like Template or HTML::Mason, it's
    just a simple (and fun) way to avoid those messy heredocs. ;)

METHODS
    HTML::Declare instances have the following methods.

  new
  as_html
  attributes
  children
  tag
FUNCTIONS
    All exported functions work the same, they expect a hashref as first
    argument which contains attributes for the tag to generate.

    The special attribute _ contains the content for the tag. The content
    may be a single string (in this case entities are auto encoded), a
    arrayref containing strings that shouldn't be encoded or HTML::Declare
    instances.

        <TAG> { attribute => 'value' }
        DIV { id => 'foo', _ => 'lalala<<encode me>>' }
        DIV { id => 'link' _ => [ '<b>Don't encode me!</b>' ] }
        DIV { _ => [ A { href => 'http://127.0.0.1', _ => 'Home!' } ] }
        DIV { _ => [ A { href => 'http://host', _ => H1 { _ => 'Test' } } ] }

  A
  ABBR
  ACRONYM
  ADDRESS
  AREA
  B
  BASE
  BDO
  BIG
  BLOCKQUOTE
  BODY
  BR
  BUTTON
  CAPTION
  CITE
  CODE
  COL
  COLGROUP
  DD
  DEL
  DIV
  DFN
  DL
  DT
  EM
  FIELDSET
  FORM
  FRAME
  FRAMESET
  H1
  H2
  H3
  H4
  H5
  H6
  HEAD
  HR
  HTML
  I
  IFRAME
  IMG
  INPUT
  INS
  KBD
  LABEL
  LEGEND
  LI
  LINK
  MAP
  META
  NOFRAMES
  NOSCRIPT
  OBJECT
  OL
  OPTGROUP
  OPTION
  P
  PARAM
  PRE
  Q
  SAMP
  SCRIPT
  SELECT
  SMALL
  SPAN
  STRONG
  STYLE
  SUB
  SUP
  TABLE
  TAG
  TBODY
  TD
  TEXTAREA
  TFOOT
  TH
  THEAD
  TITLE
  TR
  TT
  UL
  VAR
AUTHOR
    Sebastian Riedel, "sri@oook.de"

THANK YOU
    Tatsuhiko Miyagawa

LICENSE
    This library is free software, you can redistribute it and/or modify it
    under the same terms as Perl itself.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server