I’ve been enjoying LiveView for an internal toy-project, but I’m looking to see if there are any alternative HTML rendering/templating engines.
I’ve found https://github.com/rstacruz/expug which would be ideal as pug is my go-to, but it hasn’t been updated in 2 years and has no LiveView support.
Slime looks ideal but the LiveView is mentioned but not really documented anywhere, and the current implementation (which I couldn’t get to work) apparently doesn’t do incremental updates.
As great as the eex/leex implementations are, I just can’t bear writing raw html!
I forgot about Temple when I posted this but Temple was my first choice when I started looking. There is currently an issue by the maintainer about implementing Live View, but it looks like they’ve not had the resources. I’d love o use Temple as the implementation as that’s keeping it even closer to raw Elixir.
I’ve looked at the current LiveView engine source code and it’s way above my Elixir skill level
Hey, if you’re still interested in using Expug, you can take a look at my forked repos (expug, phoenix_expug).
Nothing major done so far, but I fixed this simple bug and added support for LiveView (but I’m honestly not sure if it’s the right way to do it).
I haven’t updated the docs or anything and I don’t really have many plans for it besides fixing future bugs, but I’ll gladly help if I can. Anyway, I’ve been using it for a while (admittedly for pretty simple stuff) and I’ve had no problems except for that one minor bug.
So how’s the current state of the alternative templating languages? Any new info? I wouldn’t want to drop slim(e) unless its something HAML-like in the worst case. Therefore Temple doesn’t really cut it, even if I do appreciate its elegance.
I had a look at expug and was a bit happy, because pug itself has “extends” and “block”, which would make sense for a plugin development for a CMS or Ecommerce system (like Twig for PHP and Django for Python).
Unfortunately this is not implemented in expug, too bad.
I’m still looking for a good solution for this, I like Temple very much, but at the moment I don’t know how to use it or also heex for a good plugin development.
Thanks for the advice. I haven’t used Liquid until now, but I don’t see in the docs of Liquid that you can overwrite a small part of a template in a plugin like you can in Twig or Django.
It’s always about the whole theme, which is of course strange. As I said, I may be mistaken.
Having a real “extends & block” implementation is the holy grail of templating for me with Phoenix. Currently feel stuck ten years back with the current way of doing thing.
I’d really be curios what’s missing today with function components being a thing. Before those I would’ve been on your side, but today I’m not really sure what’s left not being supported.
Hi,
sorry, at the moment I’m too busy with my normal work, i.e. Shopware and PHP.
and Elixir for some jobs in the background. I’m sure it will take another 4 weeks like this.
Just wanted to document here that Sneeze is an extremely simple and just awesome html templating library for elixir. It is just function and lists. So you can have components, slots, etc all in an extremely simple syntax (just lists and maps). Highly recommended.