make HTML output more readable

Author Message

Philipp Groszmann

Tuesday 02 December 2008 8:07:09 am

Is there any configuration or something else to make the generated HTML code more readable? A code beautifier stripping whitespaces and so on... It would be very helpful to get rid of all the spaces and breaks.

cheers
Philipp

Felipe Jaramillo

Tuesday 02 December 2008 8:30:31 am

It's funny that you mention this Philipp. I too noticed the html whitespaces a while ago. While your template code may be pristine, the rendered html is not to be very proud of.

Actually, I brought it up at a North American partner meeting 2 years ago as a casual comment, but nobody seemed to be very concerned about it ;)

I guess the beautifier could be plugged into the template engine.

Good luck,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Heath

Tuesday 02 December 2008 8:55:01 am

Yes. Template tricks to reduce whitespace can be used. An operator could be used to clean the output html.

<i>http://pubsvn.ez.no/community/trunk/extension/eztidy/
http://ezpedia.org/wiki/en/ez/tidy#eztoc98287_2
http://ez.no/developer/forum/developer/tidy_output_extension/(offset)/40
</i>

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Damien Pobel

Sunday 07 December 2008 1:01:37 pm

Hi,

eZ Publish 4.1 will provide a new feature allowing to apply a filter on the generated output [1] that would help you to filter and modify the HTML.
Before this release, you can use some templates operators but it will be difficult to filter all the HTML.

Cheers

[1] http://pubsvn.ez.no/websvn2/filedetails.php?repname=nextgen&path=%2Ftrunk%2Fdoc%2Ffeatures%2F4.1%2Foutput_filter.txt

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

kracker (the)

Sunday 07 December 2008 7:08:50 pm

<i>Sweet Deal, eZ Rocks!</i>

<i>//kracker

Bram Van 3000 - Drinking In LA</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:33:46
Script start
Timing: Jan 18 2025 11:33:46
Module start 'layout'
Timing: Jan 18 2025 11:33:46
Module start 'content'
Timing: Jan 18 2025 11:33:47
Module end 'content'
Timing: Jan 18 2025 11:33:47
Script end

Main resources:

Total runtime0.6650 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.4609152.6406
Module start 'layout' 0.00470.0024 742.101639.4766
Module start 'content' 0.00710.6565 781.5781681.2578
Module end 'content' 0.66360.0014 1,462.835916.1484
Script end 0.6649  1,478.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4823160.0002
Check MTime0.00140.2122160.0001
Mysql Total
Database connection0.00070.107510.0007
Mysqli_queries0.604990.9666690.0088
Looping result0.00070.1124670.0000
Template Total0.638095.920.3190
Template load0.00200.304220.0010
Template processing0.636095.642020.3180
Template load and register function0.00020.028910.0002
states
state_id_array0.00070.108710.0007
state_identifier_array0.00120.173420.0006
Override
Cache load0.00170.2537330.0001
Sytem overhead
Fetch class attribute can translate value0.00070.101550.0001
Fetch class attribute name0.00110.164880.0001
XML
Image XML parsing0.00200.304450.0004
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00110.1723310.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs