Every repository with this icon (
Every repository with this icon (
tree b24a5597ccbb769a36cb09df41bea0bc827d9e0f
parent e418b822e0a51e2ee3db687d0a01b5151f91a011
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri Sep 11 12:21:51 -0700 2009 | |
| |
.gitmodules | Thu Sep 17 07:31:57 -0700 2009 | |
| |
README.md | Wed Nov 18 04:43:16 -0800 2009 | |
| |
bin/ | Thu Sep 17 13:03:42 -0700 2009 | |
| |
haml.lua | Thu Sep 17 12:26:39 -0700 2009 | |
| |
haml/ | Wed Nov 18 13:33:43 -0800 2009 | |
| |
luahaml-scm-1.rockspec | Wed Nov 18 13:32:43 -0800 2009 | |
| |
sample_apps/ | Mon Sep 07 20:46:22 -0700 2009 | |
| |
spec/ | Thu Sep 17 13:03:42 -0700 2009 |
Lua Haml
About
Lua Haml is an implementation of the Haml markup language for Lua. Though it is implemented in Lua, its design makes it easily adaptable to almost any language, and it includes an experimental renderer for Haml for Ruby. Lua Haml is "just Haml," with no extending of the original language.
A Haml language reference can be found here.
Lua Haml currently supports the main features of Ruby's Haml, and can be used for real work. However, many of the finer details of the language, some of them important, are still being implemented.
Working features
The following features of Ruby's Haml are working in Lua Haml:
- Options: format, autoclose, encoding
- Plain text
- Escapes
- HTML elements
- Ruby-style attributes
- HTML-style attributes
- Classes and id's (. and #)
- Implicit div elements
- Self-closing tags
- Doctypes and XML prologs
- Haml comments
- Code evaluation
- Ruby-style string interpolation ("#{var}")
- Running Lua
- Lua blocks
- Whitespace preservation (via filter)
- Filters: plain, javascript, preserve, escaped, lua, markdown, custom
- Partial templates. Lua Haml provides a simple default partial implementation, which can be overridden by frameworks as they see fit.
- HTML comments
- Conditional comments
To do
The following features of Ruby's Haml are not yet working in Lua Haml:
- Options: escape_html, suppress_eval, attr_wrapper, preserve
- Attribute methods
- Boolean attributes
- Whitespace removal
- Whitespace preservation (implicit)
- Escaping HTML
- Unescaping HTML
- Multiline content
- Helpers
The following features will likely not be implemented in Lua Haml:
- Object reference
To see an example of what you can do with the currently supported features, view the "currently supported language" template in the spec directory.
I probably won't implement Sass for a while yet, possibly never. However if I do implement it, it will definitely be as a separate project.
Getting it
Install using LuaRocks:
luarocks install luahaml --from=http://luarocks.org/repositories/rocks-cvs/
Don't be put off by the "CVS" in the URL, this will install the latest Lua Haml from the stable branch on Github.
Hacking it
The Github repository is located at:
git://github.com/norman/lua-haml.git
To run the specs, you should also install Telescope:
luarocks install telescope --from=http://luarocks.org/repositories/rocks-cvs/
You can then run them using the ./bin/spec script in the repository.
Bug reports
Please report them on the Github issue tracker.
Author
Attributions
Some of the sample files in test/samples were taken from Ruby's Haml.
Thanks
To Hampton Caitlin and Nathan Weizenbaum for their work on the original Haml.
License
The MIT License
Copyright (c) 2009 Norman Clarke
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.







