Closed 0xdevalias closed 4 years ago
I adopted your idea in https://github.com/k0kubun/hamlit/commit/8783cef8ad11a572c688430d5b7319721052bdcc.
Hamlit::Engine
implements haml's Haml::TempleEngine
which can just generate a compiled Ruby code. Hamlit::Template
implements tilt's Tilt::HamlTemplate
.
I think Tilt is a good standard of rendering interface, and you can use it for your Ruby module usage. So I'm not going to implement Haml's original interface Haml::Engine
in Hamlit.
That works for me :) Thanks!
I had to dig a bunch to actually find how to do this, but found my snippet in:
So a super minimal example would be:
Even including this in https://github.com/k0kubun/hamlit/blob/master/REFERENCE.md would be good.
It seemed a lot easier to find the documentation for the equivalent haml API (linked from the README):
It seems hamlit doesn't support the same sort of API (which was my initial assumption/attempt):