How to improve my "View Source" ??

#1
[eluser]seanloving[/eluser]
When I construct multiple view partials during page generation, I don't like the final HTML I see when I "view source"

for example:
Code:
<div class="section" >

            
                <div class="header">
                    Details<span>
&lt;input type="submit" name="buttons_details_add" value="add" class="button" id="buttons_details_add"  /&gt;
</span>
                </div>
      </div>

would look a lot nicer like this:
Code:
<div class="section" >
    <div class="header">
        Details<span>&lt;input type="submit" name="buttons_details_add" value="add" class="button" id="buttons_details_add"  /&gt;&lt;/span>
    </div>
</div>

Is there a post processor I can use? Or does this require me to painstakingly re-format each one of my countless view files ?? In case of the latter, is there an easy way?

Thanks for any advice

#2
[eluser]WanWizard[/eluser]
A browser doesn't care what the (visual) formatting is, so that's a waist of time.
From a performance point of view it's even better to strip all formatting, so you have to send less bytes to the client.

Having said that, you could use the PHP Tidy module, or the mod_tiny apache module. You might be able to utilise a PHP beautifier like this one.

But this means processsing, which brings me back to my initial point...

#3
[eluser]pickupman[/eluser]
I am with WanWizard, I used to really want the syntax to nicely indented, then I realized why bother. It's one of the great things about Firebug. Firebug will auto indent all of the source for your, so you can traverse the html elements.

#4
[eluser]siubie[/eluser]
yes use firebug it much better than just viewing the source but it also help with another stuff


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.