inem / hamdown

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

Implementation idea suggestion (from email) #6

Open inem opened 6 years ago

inem commented 6 years ago

You may want to reuse Haml's parser at first if #-starting line (or any other non-Haml syntax) can be considered as just a special case of plain text lines. In that case, you may want to use haml_parser.gem or the parser in haml.gem.

For code generation and rendering, you can use temple.gem, a framework of template engines, to generate HTML from S-expression-like Ruby objects. But the main benefit of it is that it has some middlewares to optimize the performance of generated code by taking more time to compile it. So you can skip this part as well if the main usage isn't rendering the same template multiple times.

inem commented 5 years ago