How to reformat the HTML output

Topics: Core, Customizing Orchard, General
Nov 28, 2012 at 8:23 AM

Hey guys,

The HTML output of Orchard site looks ugly (you can see in the image below), is there any way we can use to re-format the HTML with indents and remove empty rows so it looks cooler ?

 

Many thanks.

Justin

Nov 28, 2012 at 1:45 PM

If you're using visual studio, press

ctrl + k + d

to format the document / code

Nov 28, 2012 at 2:03 PM

Thanks for that information, julia_v but this is not what I expected. I'm a coder so of course I know that hot key. What I'm expecting is the output HTML of Orchard, not the code.

Developer
Nov 28, 2012 at 2:04 PM

Is this within the Browser?

Nov 28, 2012 at 2:05 PM

Yes that's what I'm expecting. There are too many empty rows

Developer
Nov 28, 2012 at 2:22 PM

You might be able to use a browser pluggin to do this.. http://www.searchenginejournal.com/7-firefox-extensions-to-explore-page-source-code/7375/

I don't think it would be possible to format the text coming out easily. If you wanted to try you would need to create a Filter... and maybe push it to a html markup tool to format and push out again.

Coordinator
Nov 28, 2012 at 3:33 PM

Open all the cshtml files in the solution and add spaces as needed. Have fun.

Developer
Nov 28, 2012 at 4:30 PM

http://gallery.orchardproject.net/List/Modules/Orchard.Module.OfficineK.HTMLToolkit 

You can try it : This module has a HTML Compression setting that minifies the ouptut.

Coordinator
Nov 28, 2012 at 4:36 PM
Edited Nov 28, 2012 at 4:37 PM

Implementing a very simple filter class should be easy, also using HTMLToolkit. Could make sense to also add it using the Cache module as it would not recompute the HTML for every requests.