Re: HTML Tidy Options



On Tue, 2004-07-20 at 22:21 +1200, Jack Stewart wrote:
> I'm interested to know whether it would be worthwhile standardising on a
> set of tidy options for use with the gnome site.  This would bring some
> more consistency to the formating, semantics and error checking.  For
> instance I use a standard config across all my projects like this:
> 
> tidy-for-file.cfg
> indent:			no
> wrap:			0
> quiet:			yes
> drop-font-tags:		yes
> logical-emphasis:	yes
> numeric-entities:	yes
> output-xhtml:		yes
> show-errors:		no
> char-encoding:		utf8
> tidy-mark:		no
> 
> Often to make it a little easier to edit the file I use a different
> config to dsiplay the html in the editor.  Typically this will turn on
> indenting and word wrap which aids readability, like this for example:
> 
> tidy-for-screen.cfg
> indent:			auto
> wrap:			80
> quiet:			yes
> drop-font-tags:		yes
> logical-emphasis:	yes
> numeric-entities:	yes
> output-xhtml:		yes
> show-errors:		no
> char-encoding:		utf8
> tidy-mark:		no
> 
> Thoughts?

A standard would be nice.  

I use these in addition to the settings above:

fix-bad-comments: yes
alt-text: ][

I've come across some bad comments.  The alt-text is there because I can
then easily grep for a list of all images that need fixing.

I disagree on this:
numeric-entities: no

My general feeling is that we use UTF-8 to use the native character set.
It is difficult to edit entities, and page will in all probability be
edited by someone other than the author.

I caution on this
clean: yes

Most of *.g.o was created by developers with a poor understanding of
HTML.  The markup can be so bad that clean will actually make things
worse.  In my efforts to move our sites to UTF-8 and XHTML a few months
ago, I had to make a dozen passes with sed to massage the pages into
enough sanity for Tidy to correct the documents.

I do not trust Tidy's character set conversion.  I used iconv a few
months ago to do the mass conversion.

I also use 'xmllint --noout --dtdvalid' to double check that the pages
are sane.

-- 
__C U R T I S  C.  H O V E Y____________________
sinzui cox net
Guilty of stealing everything I am.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]