Monday, October 24, 2011

tidy/reformat/beautify/pretty-print html by tidy.sourceforge.net

HTML syntax checker and reformatter

Corrects markup in a way compliant with the latest standards, and optimal for the popular browsers.
It has a comprehensive knowledge of the attributes defined in the HTML 4.0 recommendation from W3C, and understands the US ASCII, ISO Latin-1, UTF-8 and the ISO 2022 family of 7-bit encodings.

In the output:
 * HTML entity names for characters are used when appropriate.
 * Missing attribute quotes are added, and mismatched quotes found.
 * Tags lacking a terminating '>' are spotted.
 * Proprietary elements are recognized and reported as such.
 * The page is reformatted, from a choice of indentation styles.


Installation
=======
sudo apt-get install tidy


tidy.conf
======
// tidy version 25 March 2009


//markup: yes
//break-before-br: no
indent: yes
//indent-attributes: no
// add indent-spaces to avoid bug
indent-spaces: 2
vertical-space: yes
wrap: 0
wrap-php: yes
//char-encoding: utf8
input-encoding: utf8
output-encoding: utf8
tidy-mark: no
// output-xhtml to avoid error of save same buffer many times
output-xhtml: yes
// w/o quiet: yes option, error might show
quiet: yes
doctype: strict



Useful options
================
-indent, -i
= indent element content

-utf8
= use UTF-8 for both input and output

-asxml, -asxhtml
= convert HTML to well formed XHTML (output-xhtml: yes)

-wrap , -w
= wrap text at the specified .
Set wrap to zero if you want to disable line wrapping.
0 is assumed if is missing.

--tidy-mark no
= if Tidy should add a meta element to the document head to indicate that the document has been tidied.
(Default: yes)



More info
==========
http://tidy.sourceforge.net
http://tidy.sourceforge.net/docs/quickref.html
man tidy
http://www.w3.org/People/Raggett/tidy/

Subproject:
http://us3.php.net/manual/en/intro.tidy.php

No comments:

Post a Comment