Log in

View Full Version : What is the best way to clean up html



dwhs
12-17-2010, 02:57 AM
My pages have a lot of junk from the years of changes. hand editing them all would take months.

Any ideas?

djr33
12-17-2010, 04:33 AM
Use a content management system-- you must 'hand edit' them to do this, but after that you can do it much more easily.

socialcharlotte
12-18-2010, 06:20 PM
Could you say a little more about how that works in the long run? What about a content management system would be helpful after the code is hand editted? I always thought of content management as being for sites where many people had some access to a site to make changes..how would it help with the editing process..

djr33
12-18-2010, 07:39 PM
A CMS, whether used by one or many users, is designed to edit content not code. The code is consistent throughout the site while the content is changed manually. This means everything is more efficient. Of course it's less efficient to setup, but if it is used on enough pages it makes up for the time quickly.

A CMS can be either a system like word press or joomla that you install on your site or something you build yourself using databases and a serverside language like PHP.


If you want more help, please ask more specific questions and give us details to work with. For general topics like this, there is also a lot of information available on google and wikipedia.

Based on the first question in this thread, I'm not sure exactly what is being 'cleaned up', but a content management system should help.

Another way to approach it would be to use templates, but CMS and templates are basically the same thing, at a technical level.

innovativeinfosln
12-20-2010, 04:32 AM
Dreamweaver has a "clean up word HTML" option. Granted, I know it isn't perfect, but it also the only thing I have worked with.

VijayKanta
01-04-2011, 06:07 AM
I think he means cleaning up "Syntaxically", if that is a word at all.
Try doing this. Be brave, do it once yourself, align them by using tabs for interior elements, breaks for block level elements etc.

Much better solution is, if you are a web programmer too, use Server Side Includes to modularize your sections of the website.

Example in PHP..



<body>
<?php require_once( 'includes/header.php' ); ?>
<?php require_once( 'includes/middle.php' ); ?>
<?php require_once( 'includes/footer.php' ); ?>
</body>


This is a general example. It is upto you to build on it and make it cleaner.

jscheuer1
01-04-2011, 06:30 AM
HTML Tidy:

http://tidy.sourceforge.net/

Be forewarned though. Back up your pages first. If they are very messy and/or not to standards, HTML Tidy will break them. But you should be able to go back and fix them.

Another approach would be to validate your HTML first:

http://validator.w3.org/

That way HTML Tidy will be less likely to break the page when it cleans it up. The validator also has an option:


Clean up Markup with HTML Tidy

Which you can choose after hitting the "More Options" link.

As I say though, before doing any of this - Back up your pages first.

nextdownload
01-06-2011, 09:58 AM
I hand't heard about HTML Tidy until now. And I am sure it can't work as weel as manul edit.

jscheuer1
01-06-2011, 02:34 PM
I hand't heard about HTML Tidy until now. And I am sure it can't work as weel as manul edit.

If you write your code to standards though, it should actually be much easier than manually editing each page.

robeid
03-13-2011, 03:31 PM
Try Cleanup HTML (http://www.cleanuphtml.com/cleanup.html) on-line tool to clean HTML code