Monday, October 24, 2011

tidy reformat beautify html xml emacs

sudo apt-get install emacs

nxhtml-mode
==========
nxhtml-mode is derived from nxml-mode (NxmlMode).
It adds a lot of things useful for XHTML.
Among other things it adds some way of handling multiple modes, folding, an improved interface to Tidy etc.
http://www.emacswiki.org/emacs/NxmlModeForXHTML
http://ourcomments.org/Emacs/nXhtml/doc/nxhtml-changes.html


Installation instruction
=================
http://www.emacswiki.org/emacs/download/tidy.el


tidy html
=======
Go to nXhtml -> tools -> Tidy XHTML -> Tidy Buffer


Tips
====
To Compile nxhtml.el goto
Menu nXhtml -> nXhtml help and Setup -> Byte compile nXhtml


Note
====
work well with inline php b/c no bug of 'always shift/indent php code'
(3rd of execution lead 6 spaces indent,4th lead 8 ,5th lead 10 ....)

More info
=======
HTML Editing With Emacs

http://stackoverflow.com/questions/137043/can-emacs-re-indent-a-big-blob-of-html-for-me


No comments:

Post a Comment