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

kevsmith / herml

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

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • HERML-0.80
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.

Erlang port of Haml — Read more

  cancel

http://weblog.hypotheticalabs.com

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

This URL has Read+Write access

A few more README edits. 
seancribbs (author)
Fri Jun 19 12:12:47 -0700 2009
commit  2942bd1d1b3a9811f3194da237b9b922f6ab7cb8
tree    2e4eb6cd6a85d7f447ac8225ef229ec3ebd8bfa3
parent  e9620091bdc746a3ec23906f695d28a4511ea423
herml /
name age
history
message
file .gitignore Tue Dec 16 09:07:17 -0800 2008 * Removing generated directories from source co... [kevsmith]
file CONTRIBUTORS Sat Mar 07 14:37:13 -0800 2009 * Committers doesn't make much sense when you'r... [kevsmith]
file Makefile Fri Jun 19 12:02:31 -0700 2009 Makefile change for leex included in R13B01. [seancribbs]
file README Fri Jun 19 12:12:47 -0700 2009 A few more README edits. [seancribbs]
file TODO Tue Feb 17 12:38:35 -0800 2009 Use new leex and judo our string problem. [seancribbs]
directory src/ Fri Jun 12 07:38:03 -0700 2009 fixed issue with formatting atoms Signed-off-b... [averyj]
directory tests/ Fri Jun 12 07:38:03 -0700 2009 fixed issue with formatting atoms Signed-off-b... [averyj]
README
Welcome to herml, the Haml-like templating language!

Building:
1) Install leex 0.3 or greater. Putting it in your $ERLANG_HOME/lib is best.
   leex is included with R13B01.
2) Clone the herml repo from Github.
3) Run make
4) Put the herml/ebin directory somewhere on your code path:
  4a) Symlink the top-level herml directory into your $ERLANG_HOME/lib directory
                                -or-
  4b) Use the -pz or -pa switches on erl to place herml/ebin onto your code path

Using in Sinan:
1) Clone the herml repo from Github
2) Run `make special` in the herml directory
3) Make sure your sinan project can find the herml repo
   3a) Clone inside your projects lib directory
                  -or-
   3b) Symlink the herml directory to your projects lib directory

4) Keep it up to date:
  a) Pull down latest changes
  b) `make clean`
  c) `make special`

Running tests:
1) Run make clean tests


Using herml:

1) Start up a herml_manager process for your template directory:

1> herml_manager:start_link(my_web_app,"/path/to/templates").

Note: herml_manager can cache the compiled template and use it over and over.

2) Execute the template by calling the herml_manager process:

2> Result = herml_manager:execute_template("file.herml", Env).

Note: Env is a proplist containing the execution environment for the
template. herml expects all variable names to be Erlang strings. For
example, here's a valid environment proplists: [{"UserName", "herml"}].

The UserName variable would be referenced from herml as @UserName.

Another note: For efficiency reasons, herml_manager:execute_template/2,3,4 
returns iolists when it executes templates. If you want to view the 
template output as a standard string, you can use the io module 
to flatten the iolist: 

3> io:format("~s", [Result]). 
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