PHP Manual Source Code

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

PHP Manual Source Code

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I have no idea. I wish there was a way to clean it easily. But that markup is utterly horrible.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post 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!
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

They don't use whitespace in between tags because sometimes it renders or something like that.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Where did you hear that?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 ;)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

d11wtq wrote:
Everah wrote:
nickvd wrote: 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 ;)
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) :).
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 :)
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

so i was right then?!?!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Daedalus- wrote:so i was right then?!?!
Right in thinking, but you missing a word in your post to convey just that.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Uh... What?

I just got home from a long night :D

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.
Post Reply