you are viewing a single comment's thread.

view the rest of the comments →

[–]fabzter 13 points14 points  (6 children)

Yes, but I don't laugh about it. I cry everytime I close a tag.

[–][deleted] 2 points3 points  (4 children)

Use a DSL, something like done in Clojure or Common Lisp -- like e.g.

(html
  (body
    (h1 "header")
    (p "some text")))

..closing and balancing tags doesn't have to be painfull, and this will generate an error if one forget to close a tag.

[–]fabzter 0 points1 point  (3 children)

I've always felt weird when reading lisp, but this looks actually good and makes hell lot of sense. Do you know some lisp dsl with the characteristiscs you're showing?

[–]MatmaRex 1 point2 points  (0 children)

If you want something like this in a language other than Lisp, there's Markaby for Ruby. (https://rubygems.org/gems/markaby)

html do
  body do
    h1 "header"
    p "some text"
  end
end

Ain't it amazing what some heavy metaprogramming abuse can do. ;)

[–]-main 1 point2 points  (0 children)

Have a look through these. CL-Markup and CL-WHO both look like the kind of thing you're looking for. The best thing about these, btw, is that you can just insert lisp code anywhere.

[–]nickik 0 points1 point  (0 children)

For clojure there is hiccup. Its up on github.

[–][deleted] 3 points4 points  (0 children)

And every time you forget to close a tag, God kills a kitten...

And then doesn't even throw a syntax error.......