Git Product home page Git Product logo

dancer-template-haml's Introduction

NAME
    Dancer::Template::Haml - Haml wrapper for Dancer

SYNOPSIS
     set template => 'haml';
     
 get '/bazinga', sub {
            template 'bazinga' => {
                    title => 'Bazinga!',
                    content => 'Bazinga?',
            };
     };

    Then, on "views/bazinga.haml":

     !!!
     %html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", "xml:lang" => "en"}
       %head
         %title= $title
       %body
         #content
           %strong= $content

    And... bazinga!

DESCRIPTION
    This class is an interface between Dancer's template engine abstraction
    layer and the Text::Haml module.

    In order to use this engine, set the following setting as the following:

        template: haml

    This can be done in your config.yml file or directly in your app code
    with the set keyword.

    Through configuration you may activate and define filters and helpers.
    For the list of predefined filters, and other details, check the
    documentation in the ./lib/Dancer/Template/Haml.pm module. The ./t
    directory provides examples.

    Activate two of the predefined filters:

        haml:
          filters_activate:
            markdown:
            textile:

    Provide options:

        haml:
          filters_activate:
            markdown:
              tab_width: 2
              trust_list_start_value: 1

    Define your own filter:

        haml:
          filters_activate:
            knuthreflow:
              maximum => 65,
              module => 'Text::Reflow'
              renderer => reflow_string

    One (token) Helper is provided:

        haml:
          helpers_activate:
            tictoc:

    Define you own helper:

        haml:
          helpers_activate:
            foo:
              helper: 'sub { shift; my $s = shift; $s =~ s/r/z/; $s;}'

    Invoke your helper:

        Haml                         Html
        ---------------              ----------------
        %p= foo("bar")               <p>baz</p>


SEE ALSO
    Dancer, Text::Haml

TODO
    The usage of helpers, filters and attributes. This will be expanded
    as Dancer expands its capabilities to take specific parameters for each
    templating engine it supports.

AUTHOR
    This module has been written by David Moreno, <http://stereonaut.net/>.

LICENSE
    This module is free software and is released under the same terms as
    Perl itself.

dancer-template-haml's People

Contributors

damog avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

enosis theathlete

dancer-template-haml's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.