|
Next: Ping Grey - ok - review and slay!
|
| Author |
Message |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 1) Posted: Fri Aug 13, 2004 8:05 pm
Post subject: Pretty print with PHP? Archived from groups: alt>www>webmaster (more info?)
|
|
|
Hey folks,
I figured I'd try and get a few more semi-on-topic threads going
Okay. I have a couple of sites where the entire contents of most pages are
dynamically generated from a database using PHP. Now although they are
syntactically correct in their markup, it looks bloody ugly should one
ever have to look at the outputted HTML for debugging purposes
I know that you can use a buffer in PHP and not have any of the code
output until you are ready, but is there any way of applying some sort of
pretty printing to the code so it's not so ugly perhaps using a buffer or
a simpler process?
--
Dylan Parry
http://webpageworkshop.co.uk - FREE Web tutorials and references
Listening to: Mike Oldfield - Islands >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: May 08, 2004 Posts: 952
|
(Msg. 2) Posted: Fri Aug 13, 2004 8:05 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 13 Aug 2004 17:05:48 +0100, Dylan Parry <usenet DeleteThis @dylanparry.com>
wrote:
> Hey folks,
>
> I figured I'd try and get a few more semi-on-topic threads going
Be careful. Soon that type of thing is going to be considered "spam"
around these parts.
> Okay. I have a couple of sites where the entire contents of most pages
> are
> dynamically generated from a database using PHP. Now although they are
> syntactically correct in their markup, it looks bloody ugly should one
> ever have to look at the outputted HTML for debugging purposes
>
> I know that you can use a buffer in PHP and not have any of the code
> output until you are ready, but is there any way of applying some sort of
> pretty printing to the code so it's not so ugly perhaps using a buffer or
> a simpler process?
Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy" target="_blank">http://www.php.net/tidy</a>
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: May 25, 2004 Posts: 20
|
(Msg. 3) Posted: Fri Aug 13, 2004 8:19 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Dylan Parry" <usenet.RemoveThis@dylanparry.com> wrote in message
news:pan.2004.08.13.16.05.47.236128@dylanparry.com...
> Hey folks,
>
> I figured I'd try and get a few more semi-on-topic threads going
>
> Okay. I have a couple of sites where the entire contents of most pages are
> dynamically generated from a database using PHP. Now although they are
> syntactically correct in their markup, it looks bloody ugly should one
> ever have to look at the outputted HTML for debugging purposes
>
> I know that you can use a buffer in PHP and not have any of the code
> output until you are ready, but is there any way of applying some sort of
> pretty printing to the code so it's not so ugly perhaps using a buffer or
> a simpler process?
This might be helpful
<a style='text-decoration: underline;' href="http://www.zend.com/php5/articles/php5-tidy.php" target="_blank">http://www.zend.com/php5/articles/php5-tidy.php</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 4) Posted: Fri Aug 13, 2004 8:23 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Engaging mouth before brain, oeb -=- bleh bleh bleh wrote:
> This might be helpful
<font color=purple> > <a style='text-decoration: underline;' href="http://www.zend.com/php5/articles/php5-tidy.php</font" target="_blank">http://www.zend.com/php5/articles/php5-tidy.php</font</a>>
Unfortunately, that relies upon an extension that I cannot guarantee will
be present on the server. I'm also not using PHP5, so it isn't really an
option without having to install the extension.
Thanks anyway,
--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references
Listening to: Mike Oldfield - When The Night's On Fire<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 5) Posted: Fri Aug 13, 2004 8:28 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Engaging mouth before brain, GreyWyvern wrote:
<font color=purple> > Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>
Unfortunately not. Shared hosting etc. I could ask the host if they would
be willing to, but it's probably more hassle than it's worth
--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references
'I am a Bear of Very Little Brain, and long words bother me.' -- A A Milne<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1625
|
(Msg. 6) Posted: Fri Aug 13, 2004 9:15 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 13 Aug 2004 17:05:48 +0100 Dylan Parry
<usenet.RemoveThis@dylanparry.com> broke off from drinking a cup of tea at to
write:
>Hey folks,
>
>I figured I'd try and get a few more semi-on-topic threads going
>
>Okay. I have a couple of sites where the entire contents of most pages are
>dynamically generated from a database using PHP. Now although they are
>syntactically correct in their markup, it looks bloody ugly should one
>ever have to look at the outputted HTML for debugging purposes
>
>I know that you can use a buffer in PHP and not have any of the code
>output until you are ready, but is there any way of applying some sort of
>pretty printing to the code so it's not so ugly perhaps using a buffer or
>a simpler process?
>
Aaaaaaaaaaaaagh!
Don't they teach English at school anymore? "outputted" what sort of
word is that supposed to be?
Matt<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: May 08, 2004 Posts: 952
|
(Msg. 7) Posted: Fri Aug 13, 2004 9:15 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 13 Aug 2004 18:15:43 GMT, Matt Probert
<comments RemoveThis @probertencyclopaedia.com> wrote:
> On Fri, 13 Aug 2004 17:05:48 +0100 Dylan Parry
> <usenet RemoveThis @dylanparry.com> broke off from drinking a cup of tea at to
> write:
>
>> it looks bloody ugly should one
>> ever have to look at the outputted HTML for debugging purposes
>
> Aaaaaaaaaaaaagh!
>
> Don't they teach English at school anymore?
Of course not. Dylan's Welsh, remember?
Grey<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 26, 2003 Posts: 261
|
(Msg. 8) Posted: Fri Aug 13, 2004 9:16 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Dylan Parry wrote:
> Hey folks,
>
> I figured I'd try and get a few more semi-on-topic threads going
Damn you! Just when we had them all but eliminated!
> is there any way of applying some sort of pretty printing
> to the code so it's not so ugly?
I usually just use \n to make sure every line of 'generated' HTML is on
its own line.
Matthias<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 9) Posted: Fri Aug 13, 2004 9:16 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Engaging mouth before brain, Matthias Gutfeldt wrote:
>> I figured I'd try and get a few more semi-on-topic threads going
>
> Damn you! Just when we had them all but eliminated!
Sorry
>> is there any way of applying some sort of pretty printing
>> to the code so it's not so ugly?
>
> I usually just use \n to make sure every line of 'generated' HTML is on
> its own line.
That's what I use at the moment, but it kinda breaks all the nice
indentation that the rest of the code follow.
--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references
Listening to: Mike Oldfield - The Time Has Come<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Aug 02, 2004 Posts: 145
|
(Msg. 10) Posted: Fri Aug 13, 2004 9:17 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Dylan Parry wrote:
> Engaging mouth before brain, GreyWyvern wrote:
>
<font color=green> >> Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>
>
> Unfortunately not. Shared hosting etc. I could ask the host if they would
> be willing to, but it's probably more hassle than it's worth
What about piping your buffered HTML through ~/bin/tidy?
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1625
|
(Msg. 11) Posted: Fri Aug 13, 2004 9:18 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 13 Aug 2004 17:28:06 +0100 Dylan Parry
<usenet.TakeThisOut@dylanparry.com> broke off from drinking a cup of tea at to
write:
>Engaging mouth before brain, GreyWyvern wrote:
>
<font color=green> >> Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>
>
>Unfortunately not. Shared hosting etc. I could ask the host if they would
>be willing to, but it's probably more hassle than it's worth
>
So what you're saying is that you need something so standard its
already installed on the shared hosting, and which will allow
PRACTICAL EXTRACTION of data and REPORTING of it in hypertext markup
LANGUAGE?
The clues are there, as we go through the keyhole....
<BG>
Matt<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 12) Posted: Fri Aug 13, 2004 9:22 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Engaging mouth before brain, Matt Probert wrote:
> Don't they teach English at school anymore? "outputted" what sort of
> word is that supposed to be?
<a style='text-decoration: underline;' href="http://dictionary.reference.com/search?q=outputted" target="_blank">http://dictionary.reference.com/search?q=outputted</a>
Also when I was typing the OP my spell checker didn't flag the word and
thus I cared not. So nah to you
--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references
Listening to: Steve Howe's Remedy - Sand Devil<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 26, 2003 Posts: 261
|
(Msg. 13) Posted: Fri Aug 13, 2004 9:23 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Dylan Parry wrote:
> Engaging mouth before brain, Matthias Gutfeldt wrote:
>
>
>>>I figured I'd try and get a few more semi-on-topic threads going
>>
>>Damn you! Just when we had them all but eliminated!
>
>
> Sorry
OK, all is forgiven. You can come home now.
>>>is there any way of applying some sort of pretty printing
>>>to the code so it's not so ugly?
>>
>>I usually just use \n to make sure every line of 'generated' HTML is on
>>its own line.
>
>
> That's what I use at the moment, but it kinda breaks all the nice
> indentation that the rest of the code follow.
Well, how about \t ? Or use Tidy like "oeb" mentioned.
Matthias<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 1119
|
(Msg. 14) Posted: Fri Aug 13, 2004 9:24 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Engaging mouth before brain, Matt Probert wrote:
> So what you're saying is that you need something so standard its
> already installed on the shared hosting
No, what I was asking was is there a way that one can do this using PHP. I
should have added that I didn't want to use anything but PHP, ie. only any
functions that are already part of PHP.
--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references
Listening to: Steve Howe's Remedy - Sand Devil<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |
External

Since: Sep 14, 2004 Posts: 588
|
(Msg. 15) Posted: Fri Aug 13, 2004 9:27 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Dylan Parry wrote:
> Hey folks,
>
> I figured I'd try and get a few more semi-on-topic threads going
You're just sick.
> Okay. I have a couple of sites where the entire contents of most pages
> are dynamically generated from a database using PHP. Now although they
> are syntactically correct in their markup, it looks bloody ugly should
> one ever have to look at the outputted HTML for debugging purposes
Why would you ever need that in production code?
> I know that you can use a buffer in PHP and not have any of the code
> output until you are ready, but is there any way of applying some sort
> of pretty printing to the code so it's not so ugly perhaps using a
> buffer or a simpler process?
>
It's a waste of valuable resources.
--
William Tasso
Recommended reading ...
<a style='text-decoration: underline;' href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>
<a style='text-decoration: underline;' href="http://www.aww-faq.org/" target="_blank">http://www.aww-faq.org/</a><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Pretty print with PHP? |
|
| Back to top |
|
 |  |