views:

59

answers:

4

Is there a Windows application that I could use to simply paste the HTML source of a page, and have it parsed so that I can see where each section starts and ends?

When lines are wrongly indented, it's a pain to figure out the logic of a page.

I'd rather a stand-alone utility rather than an add-on to a browser.

Thank you.


Edit: If possible, I'd like a light utility (ie. not a full-fledged IDE like Eclipse or VS) that displays blocks as a tree, so I can fold/unfold blocks and concentrate on those I'm interested in.

+1  A: 

If you develop your HTML in Eclipse or IntelliJ you can use the format code shortcut

Molske
A: 

Sounds like HTML tidy will fit the bill.

Many programmer editors already have this in place - notepad++ has a HTML tidy feature, visual studio can also be used (Ctrl + k + d).

Oded
Thanks for the tip. Notepad++: TextFX > TextFX HTML Tidy. After trying it out, it does the job, but I think I'd rather a tree-like editor so I can (un)fold blocks and concentrate on the areas I'm interested in. Is there a light solution for this (I don't use Eclipse, VS, etc.)?
@overtherainbow - Notepad++ does that, if you make sure the language is set to HTML.
Oded
Thanks for the tip: Language > H > HTML followed by View > Fold All (ALT + 0). I was looking for some kind of non-WYSIWYG HTML editor that would do this in one go, but if there's no such thing, Notepad is good enough. Thank you.
A: 

Install freeware Opera Browser, navigate to the page, right click on something, press "Inspect element".

Soonts
A: 

The built-in DOM inspectors in most modern browsers would be a good start. I know you said stand-alone rather than a browser add-on, but the advantage with these is that they will highlight the element on the page which is extremely handy. They're also good for playing with CSS and quick Javascript experiments.

For IE8, go to Tools > Developer Tools (or F12). There are a couple of extentions available for IE6 & IE7: IE Developer Toolbar and Web Development Helper

For Opera and Chrome, simply right click anywhere > Inspect Element. Safari also has this it just has to be enabled.

For Firefox you need to download Firebug

Of all of these I prefer Firebug. In my experience it tends to be most stable and easiest to make HTML and CSS changes to the page for experimenting, although the WebKit inspector is also very good.

Always remember that these tools show you the parsed DOM tree, which may be different from the original HTML.

roryf
Thanks. It looks like a good solution too.