...

View Full Version : Formatting (indentation, etc) messy html code... a handy (free) tool?



WebKitty
01-21-2012, 11:54 PM
I was using http://valet.htmlhelp.com/tidy/ for this but lately it's returning blank pages for me. I would like to find a tool either online or downloadable that will format html code and do the proper indentations, etc... ideally the choice to either load a file or paste in a block of code would be ideal, but one or the other would suffice.

Does anyone know of any other tools besides the one mentioned above?

Thanks in advance. (I've googled this and that's how I found "tidy" but I didn't find anything else useful.)

I have Dreamweaver CS4 if there is anything that can add-on to that or is built in that I haven't found.

teedoff
01-22-2012, 12:22 AM
I was using http://valet.htmlhelp.com/tidy/ for this but lately it's returning blank pages for me. I would like to find a tool either online or downloadable that will format html code and do the proper indentations, etc... ideally the choice to either load a file or paste in a block of code would be ideal, but one or the other would suffice.

Does anyone know of any other tools besides the one mentioned above?

Thanks in advance. (I've googled this and that's how I found "tidy" but I didn't find anything else useful.)

I have Dreamweaver CS4 if there is anything that can add-on to that or is built in that I haven't found.

DW has a feature in the Commands menu..."Apply Source Fomatting" that indents code.

WebKitty
01-22-2012, 12:25 AM
Thanks! Unforutnately that means I have to rename about 100 templates from .txt to .html to get it to work...oy... but thanks!

teedoff
01-22-2012, 12:35 AM
Thanks! Unforutnately that means I have to rename about 100 templates from .txt to .html to get it to work...oy... but thanks!

You didn't specify you were working with .txt files. But I'm confused. Aren't these html files? or will be?

You said...


I would like to find a tool either online or downloadable that will format html code

So they should already be .html files correct??

WebKitty
01-22-2012, 12:35 AM
Long shot here... is there any way to edit HOW it formats the html code? It isn't indenting certain things I'd like indenting, etc... I'd like a little more control if possible.

WebKitty
01-22-2012, 12:36 AM
You didn't specify you were working with .txt files. But I'm confused. Aren't these html files? or will be?


They're template chunks from the backend of a CMS called textpattern. I have them backed up on my computer as .txt files because it's easiest to edit them in notepad, so I wanted something that opened them natively in notepad. In the CMS they are just "form templates" and "page templates" and have no file extensions.

The CMS compiles all of these various template pieces as chunks of code when you call them as includes (basically) in the pages. Each snippet of code is html code, but isn't a page or anything (with html and body tags, etc) and as I said, I wanted to easily be able to edit my backups in notepad.

teedoff
01-22-2012, 12:43 AM
You know notepad edits html files as well. I mean you dont have to store them as .txt files for the sole purpose of keeping back ups and editing them in notepad.

WebKitty
01-22-2012, 02:08 AM
I know but if I double click on an html file it opens in a browser, so txt seemed easier.

WebKitty
01-23-2012, 04:08 PM
(And I don't want to set notepad as the default for html files--I want a browser for that. So I wanted something I could easily double click on and have it open in Notepad... unless you know of a workaround that would make me able to quickly open an .html file in Notepad without changing the default program?)

Actually I suppose I could just open Dreamweaver every time I want to edit those files... it just seems like a big hammer for a little nail, if you know what I mean lol. These snips are things like this (or somtimes even shorter, though sometimes much longer as well):



<!-- begin form menu_searchbox -->
<div class="leftscroll">
<div class="topscroll">
<div class="bottomscroll">

<!-- search form -->
<p><!-- --></p>
<div id="searchform2"><txp:search_input /></div><!--searchform2-->

</div><!--bottomscroll-->
</div><!--topscroll-->
</div><!--leftscroll-->
<!-- end form menu_searchbox -->

(I put a comment begin/end tag in every form that I do, because otherwise if there is a problem on the page, and I view source, it's really, really hard to pinpoint what form I need to edit to fix the problem area.)

WebKitty
01-23-2012, 04:12 PM
If I decide to start editing them in Dreamweaver... I found this method for batch renaming file extensions: http://www.addictivetips.com/windows-tips/batch-change-rename-file-extensions-in-windows/ --super cool if I don't have to do it by hand.

The article is from 2008 so I don't know if it still works, but I can give it a try...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum