Kogui: generate HTML using Crystal

@straight-shoota Oh I see!! That makes sense. Yeah probably not useful for Kilt

This just made my whole day — I created Clearwater and a whole bunch of related tools. I literally cheered out loud here in my house!

Thank goodness for social distancing so nobody heard me. It was very undignified. :joy:

8 Likes

Heeeeey! Nice to meet you! I liked the lib and I wanted to learn new things

1 Like

Yes, and HTML and JS are tied together beautifully when used without a “template engine”. What’s next, a template system for JS as well?

This exact logic applies to any syntax. Why have a layering engine to structure the syntax when you can just write it? It’s unnecessary complexity, and it’s a huge issue in web development today. You’ve been a web dev for 12 years and you don’t realize this? We must have very different views, that’s for sure.

edit: Brb, going to use Crystal Template System 5000, instead of… writing out Crystal directly. :man_facepalming:

Those are some interesting points. Maybe make a separate thread to discuss that so this thread can stay focused. That way you have a dedicated there’d people can find and comment on

1 Like

Hi, @straight-shoota
Took a quick-look. Correct me if I’m wrong, but it looks similar / related / somewhat-inspired by Liquid?

Thanks

Yes, Crinja implements Jinja2, an original Python template engine. Jinja2 is based on Django Template Engine (DTE), also a Python library. Liquid is closely modeled after Django Template Engine, but in Ruby. So it’s all in the same family.

Since Liquid is very prominent in the closely related Ruby community I originally considered doing a Liquid implementation, but Jinja2 is way more powerful and and most importantly it’s syntax is well-defined and more sane. When you know Jinja2, you really don’t want to go back to Liquid :laughing:

But the syntax is still pretty similar. Simple templates will just work the same in both Liquid and Jinja2. It’s kind of like Ruby and Crystal.
And Crinja even offers a compatibility mode which makes it understand Liquid/DTE syntax as well.

1 Like