How to reformat the HTML output

Topics: Core, Customizing Orchard, General
Nov 28, 2012 at 9: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.


Nov 28, 2012 at 2:45 PM

If you're using visual studio, press

ctrl + k + d

to format the document / code

Nov 28, 2012 at 3: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.

Nov 28, 2012 at 3:04 PM

Is this within the Browser?

Nov 28, 2012 at 3:05 PM

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

Nov 28, 2012 at 3:22 PM

You might be able to use a browser pluggin to do this..

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.

Nov 28, 2012 at 4:33 PM

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

Nov 28, 2012 at 5:30 PM 

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

Nov 28, 2012 at 5:36 PM
Edited Nov 28, 2012 at 5: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.