tags:

views:

1108

answers:

2

What's the best solution for authoring HTML5 in Emacs? Is there a mode that will do conformance checking?

+9  A: 

My best suggestion is to use nxml-mode (available as packages in several linux distributions if you're on that platform) and load the html5 RelaxNG compact format specifications from HTML5 specification page (or any other source if you have one).

Nxml-mode validates xml files on the fly according to relaxNG specifications and give you nice customization features and handy functions for writing documents faster like inserting end-tags and such. Written by James Clark, so you now the author knows his XML.

If you load it like a system package you can probably just add it to your auto-mode-alist and be good to go. I have just set the following two variables for auto-completion and more docs is available at the first link.

(nxml-bind-meta-tab-to-complete-flag t)
(nxml-slash-auto-complete-flag t)

When it is loaded, just load the file you want and specify the location of the schema for html5, save its location through the menu and you should be on your way. There are also more links to documentation on nxml-mode in the link I provided.

Knut Haugen
+6  A: 

I've just seen this project, which apparently takes care of the necessary work to teach nxml-mode about HTML5:

http://github.com/hober/html5-el/tree/master

npad