When I started using haml, I had bunch of rhtml to convert to haml.
So, I saved rhtml file as haml and started working.
But I was new to haml and most of the files were too long to be
converted all at once. Also, I didn't like the idea, of making one
more backup file and move piece by piece to haml file.
And sometimes, when I needed things working quickly, I didn't want to
convert everything, just some pieces I needed.
Then, I read about filters and decided to implement my own.
It's called nothing filter, because it renders nothing, really handy
to convert from old rhtml, html or even php. For example:
---------------------------------------------------
%p already converted
:nothing
<table>
<tr>
<td>this is old stuff not yet converted</td></td>
---------------------------------------------------
In this way, I can easily test piece by piece for haml errors and
proper rendering. This is especially usefull for people who are new to
haml (like me at that time).
So, if you like the idea, you can include it in next version. Change
is trivial:
engine.rb:
----------------------------------------------------
'nothing' => Haml::Filters::Nothing,
----------------------------------------------------
And filters.rb:
----------------------------------------------------
class Nothing
def initialize(text)
@text = text
end
def render
""
end
end
----------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---