12

Maybe two days ago I expressed interest in creating a dynamic HTML templating system.

Here's what I came up with. template.js only 34 lines. Which is great because JS is ugly and I want the least amount of it as possible.

The idea is you can create hiddent templates, modify them using traditional means (HTML/ CSS), then generate an infinite amount of them in JS.

Btw: Screenshot is two different images stitched together. There isn't JS and HTML in the same place.

Comments
  • 14
    And so, a new js framework was born 👶

    Seems great tho!
  • 5
    I don't see why something like this would be better than vue or angularjs. If the goal was to prove something to yourself, I guess there is nothing wrong with it (been there personally, had chronic not-invented-here-syndrome).
  • 4
    @alexbrooklyn @LlamaMan

    It's better because it's 30 lines. And I'm not distributing it as a framework. This is mine.
  • 5
    @LlamaMan you do realize that vue and angular are not templating frameworks and they both depend on something like mustache, right?
  • 1
    Just as a totally unrelated BTW, this article highlights the "performance" of vue.js and then shows a graph where it really isn't performant:
  • 1
    @ganjaman not trying to be rude, but I do not see the core differences.
  • 4
    @LlamaMan between an extensible single page application framework and a templating engine? Are you mainly backend?
  • 1
    @ganjaman not really. Is it like the difference between something like ejs and spa framewoks? The screenshot from @AlgoRythm seemed like it was from a spa environment.
  • 3
    @ganjaman "Are you mainly backend" is the single most savage burn I have every read.
  • 1
    An html templating system? If you know python, jinja2 is literally exactly that.
  • 1
    @arcsector Muchos gracias, my backend isn't python and, again, this is completed in 30 lines.
  • 3
    How does this differ from the <template> element?
  • 0
  • 1
    Do you have like a GitHub link for it?
  • 1
    @pez-dispenser That's the first time I've heard of it. I'll implement that instead.
  • 3
    @pez-dispenser There we are. It's even simpler now!
  • 0
    @MacDev It's going into a larger project, if you want the link for that. Multiplayer Pokemon that I'm lazily developing and will probably abandon.
  • 0
    @AlgoRythm Id be interested in the Pokemon thing :D
  • 1
    HTML Supports HTML templates. No Need for another templating engine.

    PS, the smallest templating engine possible for js also already exists
Add Comment