What's the best solution for authoring HTML5 in Emacs? Is there a mode that will do conformance checking?
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 know 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.
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
An easier to install solution may be web-mode. It definitely plays well with HTML5 and doesn't require you to jump through the XHTML hoops.
JavaScript and CSS blocks work as you would hope.
It also includes the ability to handle common templating languages like php, erb, handlebars, etc.
Check out http://web-mode.org for more details. It's available as a package, at least on MELPA.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With