Page 1 of 2
PHP Manual Source Code
Posted: Fri Aug 25, 2006 10:47 pm
by Benjamin
Ok, I downloaded the HTML version of the PHP manual to do some research. Why does it look like this? There are absolutely no spaces between tags. Spaces within tags seem to be converted to line breaks.
Code: Select all
>18. <A
HREF="language.oop.html"
>Classes and Objects (PHP 4)</A
></DT
><DT
>19. <A
HREF="language.oop5.html"
>Classes and Objects (PHP 5)</A
></DT
><DT
>20. <A
HREF="language.exceptions.html"
>Exceptions</A
></DT
><DT
>21. <A
HREF="language.references.html"
>References Explained</A
></DT
></DL
></DD
Posted: Fri Aug 25, 2006 10:53 pm
by RobertGonzalez
I have no idea. I wish there was a way to clean it easily. But that markup is utterly horrible.
Posted: Sat Aug 26, 2006 1:36 am
by nickvd
Everah wrote:I have no idea. I wish there was a way to clean it easily. But that markup is utterly horrible.
Tidy Extension to the rescue!
Posted: Sat Aug 26, 2006 4:53 pm
by daedalus__
They don't use whitespace in between tags because sometimes it renders or something like that.
Posted: Sat Aug 26, 2006 5:03 pm
by Benjamin
Where did you hear that?
Posted: Sat Aug 26, 2006 6:24 pm
by Chris Corbyn
They do use whitespace.... newlines are considered whitespace.
I really have no idea why they keep breaking line though. I guess it's the way it's generated. I've parsed the PHP manual many times before to collect all function names/synopsis and the structure is a little confusing to follow.
The only time I often break lines between tags is when I'm using inle style, or when the tag has a lot of attributes:
Code: Select all
<div style="
font-size: 2.0em;
color: red;
font-weight: bold;
font-family: verdana,tahmo,sans-serif;
letter-sapcing: 1.4em;">
Foobar
</div>
Posted: Sat Aug 26, 2006 7:37 pm
by RobertGonzalez
nickvd wrote:Everah wrote:I have no idea. I wish there was a way to clean it easily. But that markup is utterly horrible.
Tidy Extension to the rescue!
That is all well and good for one page. But there are over 5,900 pages in the manual. How are we supposed to clean all of them using an extension?
Posted: Sat Aug 26, 2006 7:41 pm
by Chris Corbyn
Everah wrote:nickvd wrote:Everah wrote:I have no idea. I wish there was a way to clean it easily. But that markup is utterly horrible.
Tidy Extension to the rescue!
That is all well and good for one page. But there are over 5,900 pages in the manual. How are we supposed to clean all of them using an extension?
Piece of cake Mr. Everah!

I'm sure you could think of a way using PHP to scan all those files, tidy them and output them to another directory

Posted: Sat Aug 26, 2006 7:45 pm
by Chris Corbyn
astions wrote:Where did you hear that?
IE renders whitespace (newlines) between tags. It sucks. Try it, make a table like this one (use an image since it's fixed in dimension):
Code: Select all
<table cellpadding=0 cellspacing=0>
<tr>
<td>
<img src="some_visible_image" alt="" />
</td>
</tr>
</tr>
View it in IE then try this one:
Code: Select all
<table cellpadding=0 cellspacing=0>
<tr>
<td><img src="some_visible_image" alt="" /></td>
</tr>
</tr>
Posted: Sat Aug 26, 2006 7:48 pm
by RobertGonzalez
d11wtq wrote:Everah wrote:
That is all well and good for one page. But there are over 5,900 pages in the manual. How are we supposed to clean all of them using an extension?
Piece of cake Mr. Everah!

I'm sure you could think of a way using PHP to scan all those files, tidy them and output them to another directory

I could, but I'd be willing to bet someone else has already done that. I bet if I am slow to act on this that someone will come back with a link to their code that does it (or better yet, an already tidied version of it)

.
Posted: Sat Aug 26, 2006 9:08 pm
by Weirdan
I bet if I am slow to act on this that someone will come back with a link to their code that does it (or better yet, an already tidied version of it)
hmm... something along the lines of
Code: Select all
find ./ -name *.html -execdir tidy -o {} {}\;
might just work
Posted: Sun Aug 27, 2006 6:53 am
by Chris Corbyn
Weirdan wrote:I bet if I am slow to act on this that someone will come back with a link to their code that does it (or better yet, an already tidied version of it)
hmm... something along the lines of
Code: Select all
find ./ -name *.html -execdir tidy -o {} {}\;
might just work
Hehe... or that

Posted: Sun Aug 27, 2006 3:18 pm
by daedalus__
so i was right then?!?!
Posted: Sun Aug 27, 2006 3:20 pm
by feyd
Daedalus- wrote:so i was right then?!?!
Right in thinking, but you missing a word in your post to convey just that.
Posted: Sun Aug 27, 2006 3:32 pm
by daedalus__
Uh... What?
I just got home from a long night
The guy who makes the skidoo layouts uses the no whitespace thing in a few different places of his layouts to keep them from breaking in IE.