NHaml 2.0 Beta
Simone rightly pointed out that requiring NHaml users to pull the source from SVN was just downright lazy. So I finally got around to putting together an actual release: 2.0 Beta.
With 2.0 we’ve made some substantial changes and improvements and also greatly simplified the API. Here’s a sneak peak of what’s coming:
- The biggest change by far has been the introduction of pluggable back-end compilers. NHaml templates can now be authored in one of four languages: C# 2, C# 3, Boo and IronRuby.
- We have greatly simplified our ASP.NET MVC View Engine which now inherits from the framework provided VirtualPathProviderViewEngine.
- NHaml 2.0 implements the Haml rules for convenient handling of HTML encoding.
- We made some major API usability improvements for stand-alone template rendering.
We still have a bunch of stuff on our backlog, some of which we’ll try and squeeze into 2.0 RTM - Hopefully sometime within the next month.
Enjoy and death to angle brackets!
Trackbacks
Use this link to trackback from your own site.



I started using it for writing the samples in my book, and I’m really liking it :)
Too bad the 2 space tab when most of the people use 4 space ones.
“…when most of the people use 4 space one”
Can you prove that statement? :-)
Seriously, it comes from Ruby where it’s the standard. I’m a 2 guy myself too as it affords more horizontal real estate but is no less readable.
“Can you prove that statement? :-)”
I use 4 spaces :)
And most of the projects I worked with used 4 spaces (and if I’m not wrong the default in VS is 4 spaces tab).
But it’s just a matter of setting VS (or any other editor) to treat .haml files with that settings :)
[...] to VoteNHaml 2.0 Beta (11/16/2008)Sunday, November 16, 2008 from andrewpeters.netNHaml templates can now be authored in one of four [...]
I use 4 spaces too :)
I use 2 spaces despite I have never tried Ruby :-) I don’t like line breaks in the middle of expression. One line - one thought…
I’m going to make the indent configurable and even allow you to use tabs!
Configurable indentation for NHaml…
Configurable indentation for NHaml…
I am currently using C# 3 in my NHaml templates, and I would really like to see what I might be missing by not using Boo or IronRuby. The project SVN repository contains a sample app. using IronRuby, but how about Boo? Are there any public samples of Boo/NHaml templates around?
It would be particularly interesting to see some kind of comparison, bringing out the special cases where there is an advantage/disadvantage of using a specific language in an NHaml template. Does such comparison exist?
Jørn,
There are a bunch of example Boo templates in the unit tests. We’re working on adding a Boo MVC sample too.
Cheers,
Andrew.
“NHaml templates can now be authored in one of four languages: C# 2, C# 3, Boo and IronRuby”
Can someone direct me towards some instructions on how to setup NHaml for C# 2.0?
raine,
You can set it on TemplateEngine or from the config file:
Cheers,
Andrew.