Topic: Xhtml or html code readability cleaner Pages that link to <a href="https://ozoneasylum.com/backlink?for=27772" title="Pages that link to Topic: Xhtml or html code readability cleaner" rel="nofollow" >Topic: Xhtml or html code readability cleaner\

 
Author Thread
jive
Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

IP logged posted posted 04-11-2006 21:55 Edit Quote

Hell all,

I'm looking for a good way to reformat or organize my code to be more readable. Perhaps
an online generator or a application of some sort.... All of my google searches seem to result
in some sort of html validator, which I am not looking to do at the moment. I simply want to organized,
indent the code etc...

any ideas?

HZR
Paranoid (IV) Inmate

From: Cold Sweden
Insane since: Jul 2002

IP logged posted posted 04-11-2006 22:19 Edit Quote

Check out tidy online (there are others too).

jive
Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

IP logged posted posted 04-11-2006 22:56 Edit Quote

yeah,

I checked those out. The all seem to the same and have the same limitations. I was looking for something
more on the lines of "indent all <p> tags 3 spaces, indent all <div> tags 1 space etc. I'm looking for this kind
of control - if it even exists..

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 04-11-2006 23:45 Edit Quote
quote:

jive said:

"indent all <p> tags 3 spaces, indent all &lt;div&gt; tags 1 space etc.


But why would you want to do that anyway?

Indentation should really indicate nesting and child/parent relationship, and not be generic based on what the element is.

IMO anyway...

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 04-12-2006 15:19 Edit Quote

I would agree with DL. Also do not fear comments.

code:
<!--+
    | This is the comment
    | This is the second line of comments
    +-->



The above type of comment seem to work well for me. It is a style that I picked up while working with Cocoon. It allows for some large blocks of comments and for the user to be able to easily see which lines are a part of the comment.

Dan @ Code Town

TwoD
Bipolar (III) Inmate

From: Sweden
Insane since: Aug 2004

IP logged posted posted 04-13-2006 16:08 Edit Quote

Lol, that comment style looks pretty cool.

I'm building a Javascript code formatter, as seen in some post around here..., but I was thinking about expanding it to include markup code too. But that would be later on, Javascript alone is tricky enough to format
If there was a way to exclude whole words and not just sets of characters in RegExps I could have been done with this thing long ago...

I tried "tidy online" on that page's source code and it gave a ton of warnings like this:

quote:

Warning: <div> Anchor "hide" already defined
<div id="hide" class="hide">


Is that even classified as an anchor?

/TwoD

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

IP logged posted posted 04-13-2006 16:55 Edit Quote

No, but you shouldn't really have an ID and a class named the same thing.

Also I would be very wary of using comments in XHTML, IE still has funky rendering issues when using floats.

Cheers,



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu