inem / hamdown

[WIP] Next generation template language for fans of Haml and Markdown
MIT License
111 stars 4 forks source link

Get rid of hardcoded haml conversion using hamlit #9

Closed inem closed 5 years ago

inem commented 5 years ago

I.e. it shouldn't rely on cli tool in order to convert haml to html. Instead it should do it using regular (which one?) programmatic interface.

Ideally for us it shouldn't even matter whether we have haml or hamlit gem installed.

inem commented 5 years ago

It looks like this is what we need:

template = File.read('templates/really_cool_template.haml')
haml_engine = Haml::Engine.new(template)
output = haml_engine.render
puts output

http://haml.info/docs/yardoc/Haml/Engine.html