PyHAML

Pythonic HAML
Download

PyHAML Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Mike Boers
  • Publisher web site:
  • http://mikeboers.com

PyHAML Tags


PyHAML Description

Pythonic HAML PyHAML is an implementation of HAML for Python.Developer commentsI have kept as much of the same syntax as I could, but there are some Rubyisms built into HAML that I simply cannot replicate. I have tried to stay true to the original features while adapting them to be Pythonic.This package essentially cross-compiles PyHAML code into a Mako template. Ergo, all of your standard Mako syntax also applies to content which does not match any of the HAML syntax.API Exampleimport hamlimport mako.template# 1. Write your HAML.haml_source = '.content Hello, World!'# 2. Parse your HAML source into a node tree.haml_nodes = haml.parse_string(haml_source)# 3. Generate Mako template source from the node tree.mako_source = haml.generate_mako(haml_nodes)# 4. Render the template.print mako.template.Template(mako_source).render_unicode()Output:< div class="content" >Hello, World!< /div > Requirements: · Python


PyHAML Related Software