开发者

How can I use Haml with Catalyst?

开发者 https://www.devze.com 2022-12-12 23:53 出处:网络
Is it possible to use Haml instead of a templating engine with the Cata开发者_如何学JAVAlyst web framework?Text::Haml exists now. I\'m looking at maybe using it instead of HTML.HAML seems to lack some

Is it possible to use Haml instead of a templating engine with the Cata开发者_如何学JAVAlyst web framework?


Text::Haml exists now. I'm looking at maybe using it instead of HTML.HAML seems to lack some complex templating constructs such as conditionals and loops, so I'm considering writing a Template::Plugin::HAML to integrate for those extra constructs.

UPDATE

I implemented Template::Plugin::Haml using Text::Haml so now you and use Haml in your Template-Toolkit templates, which of course are easy to make on Catalyst. (note: if it says it's not there give it 24 hours and check again I just uploaded it)


A Perl version of Haml is in the works here:

http://github.com/vti/text-haml


As far as I know (as the author of Haml), there's no Perl implementation yet.


Maybe Template::Declare could be an alternative?


From what I could see, HAML is a ruby-only thing. Like most Ruby "DSLs" it's really just using Ruby syntax as an API and can't really be done outside of Ruby without implementing all of it.

0

精彩评论

暂无评论...
验证码 换一张
取 消