3 ms·
Semi-related question but... One of the thing that I love when developing under Emacs is that I can get real-time validation of my XML (eg XHTML) based on, say
by martinced 14y ago
Semi-related question but...
One of the thing that I love when developing under Emacs is that I can get real-time validation of my XML (eg XHTML) based on, say Relax NG. This even works nicely with multiple-major-mode (eg I can get realtime validation of the XML part, yet see JavaScript as JavaScript inside the same source file).
Now my question: with all these templating libraries like Jade, aren't you losing feature like real-time validation?
And when such a templating library comes out, it means every editor out there as to be modified so that it supports it?
Or is there some kind of a schema that can be used to perform real-time validation + auto-completion?
My point is: I definitely see the point as replacing Jade by Clojure because you can then manipulate your templates as data, which is gorgeous. But I don't see the point of using Jade in the first place...
- aria 14y agoThe nice thing about dommy (github.com/prismatic/dommy) is that emacs doesn't need to be changed at all to use it. It's just clojure and all the highlighting and the emacs major mode work. Also out of the box, you get a repl to live test and evaluate template functions and data structure. It would only take a few lines of emacs lisp to take a string from the repl and pipe it through XHTML validation.
- ibdknox 14y agoIn terms of performance, wouldn't it be far faster to use strings and turn those into document fragments or setting innerHTML? I've been looking at ways to make crate much faster and it seems that would be the fastest solution by far.
- zcam 14y agoThat's the approach Hiccups took, it goes as far as generating most of the html at compile time as well. I didn't run benchmarks but I would guess it is faster than crate in some situations (huge fragments, older browsers etc). Another plus is nodejs compatibilty (if you care about that, but I guess you might :)). https://github.com/teropa/hiccups https://github.com/teropa/hiccups
- deleted 14y ago[deleted]
- mark_l_watson 14y agoThe Community Edition (free) of IntellJ with the Clojure plugin will help you here: I get immediate error highlighting when editing Hiccup code in my Clojure view files - recommended! A little off topic, but I have been using Emacs to edit Lisp code since the early 1980s, but IMHO IntellJ with the Clojure plugin is a bit more efficient for writing and reading code.