woodie55 — 2013-12-03T11:03:48-05:00 — #1
I'm wanting to minify all the html code on my website theme files but want to be able to un-minify them when I need to edit them.
Similar to how www.cleancss.com allows you to minify CSS code then make is easily readable (un-minify) the code as well. Is there a site or program that will do the same thing but for html code?
felgall — 2013-12-03T16:23:38-05:00 — #2
If you type 'HTML compress" into Google you'll get pages of sites that provide the facility for minifying your HTML.
If you type 'html tidy' into Google you'll get pages of sites that can un-minify your compressed HTML..
woodie55 — 2013-12-11T11:36:27-05:00 — #3
How about you be a good fella and post one of those "pages of sites" that offer the functionality I'm looking for.
Finding a site that will compress HTML is no issue, but one that will compress and un-compress seems to be an issue. Go ahead, be a good fella and post that link.
felgall — 2013-12-11T13:26:01-05:00 — #4
The first site listed for each in Google is:
Minify - http://htmlcompressor.com/
Unminify - http://infohound.net/tidy/
stomme_poes — 2013-12-17T09:16:29-05:00 — #5
but want to be able to un-minify them when I need to edit them.
Most of us keep un-minified files laying around our development area, and each time we make an edit, a new minified version (what the web site actually uses) is saved.
This means you're only ever going from normal-> minified, and not back again.
Why does it matter? Only matters if you're picky about spacing. I do try to keep required spacing inside tags, for example the space after label text before the input, so i don't get
(you can style in a space with CSS but for example in a screen reader you could get them all run together depending on settings, or when copy-pasting). If I can put the space inside the tag, that's easier.
Another place is when I use display: inline-block, where I'd like it decided on my end whether there's space between those elements or not, since that matters and cannot easily be CSS'd out. I know what'll happen if I normal->minify, but then un-minifying would likely depend on the un-minifyer.
pullo — 2013-12-17T09:43:54-05:00 — #6
As Poes says, you're probably better off having an unminified version on your PC that you work on, then when you have made some changes that you want to publish, minify the files in question and upload them.
That way you don't need an un-minifier.
As for compressing your HTML in the first place, this would be a great task for Grunt.