News for hackers. Stuff that matters.
Re:Introducing Nemo: A Pythonic Haml by dmclain on Thursday January 06, 2011 @02:17PM (#2076707)
I've been contributing to another HAML derivitive for python called HamlPy (https://github.com/jessemiller/HamlPy). It compiles down to Django templates, which made it very easy for me to convert my existing project. It's under pretty active development right now.
Re:Introducing Nemo: A Pythonic Haml by raineri on Thursday January 06, 2011 @02:31PM (#2076775)
I forked that project and made it compile down to a Mako template (I use pylons). https://github.com/raineri/MakoHaml :)
Re:Introducing Nemo: A Pythonic Haml by true_religion on Thursday January 06, 2011 @02:58PM (#2076888)
You might want to update your readme file so everyone knows that it compiles down to Mako just at a glance.

Right now its confusing.

But if I'd known about this project a few days ago, you'd have definitely been added to my list of Muses.

Also, does your fork support the full range of Mako control structures? Looking at the nodes.py it seems that its still targeted towards a Django-templates backend.

Re:Introducing Nemo: A Pythonic Haml by raineri on Thursday January 06, 2011 @03:13PM (#2076949)
Yeah, I quickly hacked it together, I will update the readme soon. It does support the mako control structures. You see them rendered around line 200 in nodes.py.
Re:Introducing Nemo: A Pythonic Haml by true_religion on Thursday January 06, 2011 @03:35PM (#2077038)
You forgot to change the list of self-closing tags.

I'd suggest making 'while' self closing.

How do you handle Mako defs, and namespace tags?

Re:Introducing Nemo: A Pythonic Haml by true_religion on Thursday January 06, 2011 @03:14PM (#2076956)
You can actually use Nemo alongside Django-templates.

It registers a Mako template loader with Django, that by default points to your /templates directory in your folder.

However you can override it by modifying MAKO_TEMPLATE_DIRS in your settings.py. MAKO_TEMPLATE_DIRS is just a tuple containing the directories to look under for Mako/Nemo files.

My full project runs under Mako, but 3rd party apps, and the django admin run with django-templates.