Re: Tidy HTML source?
| From: | Richard Lynch | Date: | Mon, 27 Nov 2006 17:48:42 +0000 |
| Subject: | Re: Tidy HTML source? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245186@lists.php.net to get a copy of this message | ||
On Mon, November 27, 2006 11:10 am, Mark Kelly wrote:
> In the stuff I do almost all the HTML is generated with PHP as
> basically
> none of it is static (lots of tabular data, state-sensitive links,
> stuff
> like that).
>
> Am I crazy to make an extra effort in my code to make the generated
> HTML
> pretty? By this I mean linebreaks, indentation etc. - stuff that is
> aimed
> at readability rather than correctness. This is obviously above and
> beyond
> simply making sure it validates. It's not a huge burden by any means,
> but
> it *is* extra effort.
>
> What do you guys do?
If you are laying out your PHP and HTML correctly, decent readability
is not that difficult.
I don't sweat it when PHP "eats" a newline or tab for the first/last
element in a series (LI or TR or TD or...)
But I'd go *nuts* if "View Source" was all wonky.
Just because it validates doesn't mean you actually have the
layout/content that you want. :-)
And not being able to read your own HTML source will bite you in the
butt eventually.
I do wish that I had more control over the various "pretty" printing
tools for "View Source" so I could get the HTML to be indented the way
I want it...
A simple "diff" between actual HTML output and prettied up HTML from,
say, Tidy, would be pretty nifty -- I probably could have saved myself
10 hours a month, on average, in the past 10 years if I had that...
:-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?