A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

IDE: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
No edit summary
(added Emacs section.)
Line 2: Line 2:


= Making your editor suck less for editing Web content =
= Making your editor suck less for editing Web content =
== Emacs ==
=== XHTML5 or polyglot documents ===
Emacs ships with [http://www.thaiopensource.com/nxml-mode/ nxml-mode], a major mode for editing XML which does on-the-fly validation with RELAX NG schema. You can plug [http://wiki.whatwg.org/wiki/HTML5_Conformance_Checker#The_Schemas  fantasai and hsivonen's schema] into nxml-mode. The necessary shim code is included in the [http://github.com/hober/html5-el/tree/master hober/html5-el project on github].
=== HTML5 text/html syntax ===
As of July 2009, none of the several major modes for editing HTML have special support for HTML5 elements, attributes, or syntax.
== vim ==


See the [http://blog.whatwg.org/vim-checker HTML5 conformance checking in Vim blog entry] for an introduction.
See the [http://blog.whatwg.org/vim-checker HTML5 conformance checking in Vim blog entry] for an introduction.
Line 11: Line 23:
* CSS validation is [http://lists.w3.org/Archives/Public/www-validator-css/2008Jul/thread.html being worked on]
* CSS validation is [http://lists.w3.org/Archives/Public/www-validator-css/2008Jul/thread.html being worked on]


== Quick setup ==
=== Quick setup ===


  nox:~/.vim/ftplugin% svn co http://svn.natalian.org/projects/html5/ .
  nox:~/.vim/ftplugin% svn co http://svn.natalian.org/projects/html5/ .
Line 17: Line 29:
  nox:~/.vim/ftplugin% sudo ln -s `pwd`/validate-js.sh /usr/bin/validate-js.sh
  nox:~/.vim/ftplugin% sudo ln -s `pwd`/validate-js.sh /usr/bin/validate-js.sh


== Improving the scripts ==
=== Improving the scripts ===


Any suggestions? Please get in contact with [http://hendry.iki.fi/ hendry]
Any suggestions? Please get in contact with [http://hendry.iki.fi/ hendry]

Revision as of 17:40, 6 July 2009

Inspired by the OpenAjax IDE task force.

Making your editor suck less for editing Web content

Emacs

XHTML5 or polyglot documents

Emacs ships with nxml-mode, a major mode for editing XML which does on-the-fly validation with RELAX NG schema. You can plug fantasai and hsivonen's schema into nxml-mode. The necessary shim code is included in the hober/html5-el project on github.

HTML5 text/html syntax

As of July 2009, none of the several major modes for editing HTML have special support for HTML5 elements, attributes, or syntax.

vim

See the HTML5 conformance checking in Vim blog entry for an introduction.

Idea is to integrate Web services via curl with your editor that supports Validator.nu_GNU_Output, e.g. vim:

Quick setup

nox:~/.vim/ftplugin% svn co http://svn.natalian.org/projects/html5/ .
nox:~/.vim/ftplugin% sudo ln -s `pwd`/validate-html.sh /usr/bin/validate-html.sh
nox:~/.vim/ftplugin% sudo ln -s `pwd`/validate-js.sh /usr/bin/validate-js.sh

Improving the scripts

Any suggestions? Please get in contact with hendry

Caveats:

  • Vim's makeprg syntax requires some horrible escaping, hence the need for an external script
  • Vim's errorformat has issues parsing anything too complex, so best edit the stream for the errorformat (not the other way around)
  • Vim's quickfix list (:cope) seems to require a filename (%f) in the error format