[Nitro] Questions to help me evaluate Nitro

Ashley Moran work at ashleymoran.me.uk
Mon Sep 3 06:28:35 EDT 2007

On 3 Sep 2007, at 10:53, Arne Brasseur wrote:

> One of the things that impressed me was the Nitro 'compiler pipeline'.
> Basically a page in Nitro is rendered in two steps, in the first
> 'compilation' step the template is converted into code which is then
> evaluated every time the template is rendered. This compilation  
> happens
> through a configurable pipeline of transformation steps. The
> transformations could be XML based or just working on the plain text.

I noticed something clever was going on in the views :)  I have to  
say, I won't miss ERb.  Am I right that Nitro templates are all valid  

> One of the IMHO coolest available out of the box is the 'Morpher',  
> e.g.
> <div if="@user.is_admin?"> ... </div>
> <li for="item in @list">#{item}</li>

Snazzy!  This clearly needs more investigation.  It reminds me of  
Yurii Rashkovski's Lilu (<http://www.rashkovskii.com/tags/lilu>)  
which I'm pretty sure he is using for his new issuesdone.com  
project.  Lilu is cool because you can preview the templates in a  
browser.  Looks like the "Morpher" has a similar idea but embeds the  
code as XML attributes.

> The nice thing is that everything that can be done at compilation is a
> one time overhead, so afterwards pages render ultra-fast.

I saw the example "hello" app has compiled and dynamic includes, but  
my Webrick started going weird when I was running it last night, and  
stopped responding to requests, so I gave up.

> You could for instance turn the CSSDryer plugin from Rails into a
> compiler step, so you can write 'nested' CSS like this:
> #content {
>   p {
>     a {...}
>     a:hover {}
>     ...
>   }
> }
> #sidebar {
>   a {...}
> }

Now I'm getting excited :)  For my current Rails project at work I  
built a dynamic CSS renderer, so can I write things like

html, body {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 12px;
   background: <%= @colours[:background] %> url(../images/bg.gif)  
repeat-y top center;

I'll have to see how I can do this in Nitro, I may well need it for  
my own work.


More information about the Nitro-general mailing list