kevsmith/herml
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
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]).