STRd6 / jadelet

Pure and simple clientside templates
https://jadelet.com
MIT License
378 stars 11 forks source link

enable templates using html #13

Closed barbalex closed 7 years ago

barbalex commented 10 years ago

I may be outing myself as the basic newbie I am.

I love hamlet for:

So I expected an easy and quick start using it.

This is frustrated by two facts though:

  1. the examples on http://hamlet.coffee/ are written in coffee script (idea: add a button to show them in plain javascript)
  2. the templates have to be written in what looks like 'coffee for html'

While 'coffee for html' may be as great an idea as coffee itself for people immersed in it: most people work (and debug) with javascript and html.

Did I get something wrong? (I haven't worked with templates yet so maybe templates using html is generally a bad idea or simply not possible)

If not you could make it MUCH easier to take up hamlet by offering to write templates in html.

barbalex commented 10 years ago

I do realize that you have created an extremly elegant and clutter-free system. Great job!

But I believe the biggest value lies in the simplicity of the architecture.

Less so in the code itself.

And that last part comes (for many people) with a big drawback.

STRd6 commented 10 years ago

Hi @barbalex, thanks for the feedback.

You might be interested in ConstraintJS. I haven't used it, but it looks quite similar to Hamlet, but with a focus on JS and HTML.

Our core focus is on the Haml/CoffeeScript style DSL for templating. That said, if someone wanted to add an additional parser for an HTML based language I would entertain pull requests.

barbalex commented 10 years ago

@STRd6 thanks a lot for pointing out ConstraintJS.

Though it is probably the right tool for me it also illustrates the beauty of your solution...

jarinudom commented 9 years ago

@barbalex There's also Ractive.js, which uses handlebars-like syntax for its templates and can be used with Backbone models. It can be used with haml if you're on Rails, but it's not quite as simple as Hamlet (and the haml plugin is a little buggy, but it works well enough).