Hacker News new | ask | show | jobs
by athenot 3071 days ago
I guess it would be useful for programmatically building the DOM tree. But for writing DOM fragments, pug[1] is also an option. I happen to like the clean-looking syntax. Transposing their example:

    body
      h1 Hello World
      input(type='range')
      input(onclick='console.log') Log event
      ul
        li 1
        li 2
        li 3
      unless false
        span Hidden

[1] https://pugjs.org/api/getting-started.html
1 comments

Looks a lot like slim [1] or even it's grand-daddy HAML [2]

[1] http://slim-lang.com/ [2] http://haml.info/

PUG used to be called 'Jade', and was basically HAML-for-nodejs.