Home Download Buy Blog Forum Support

How to Tidy HTML

How to Tidy HTML

Postby Forbin on Mon Nov 21, 2011 12:52 am

Is this possible in Sublime? Is there a package that will tidy html (and erb if possible) (no scripts please)? It is dead simple in Textmate and it is critical to productivity when doing tag wraps around selections.
Forbin
 
Posts: 9
Joined: Mon Nov 21, 2011 12:49 am

Re: How to Tidy HTML

Postby Jim1 on Mon Nov 21, 2011 11:22 am

You can setup a command to run to replace a selection of html with the tidy version. Press Ctl+R to bring up the command window and enter tidy -utf8 -asxhtml -i for the command which formats indented xhtml using utf8 encoding. Check the two boxes to "Pass selection as input" and "Insert output". You can also specify custom key bindings there.
Beautiful Anchor Necklaces
10 Beautiful Rose Gold Earrings
Jim1
 
Posts: 3
Joined: Fri Nov 18, 2011 6:22 am

Re: How to Tidy HTML

Postby Jay Levitt on Mon Nov 21, 2011 1:44 pm

What does CTRL-R bring up on Windows? On my Mac, CTRL-R does nothing, and Cmd-R brings up the "find anywhere" box, which I assume is not what you're talking about..
Jay Levitt
 
Posts: 52
Joined: Sun Sep 25, 2011 6:22 pm

Re: How to Tidy HTML

Postby C0D312 on Mon Nov 21, 2011 5:05 pm

Jim1 is referring to the Python Console (which is opened with ctrl+`) However, there is a much easier way to tidy HTML. Check out the Tag plugin https://github.com/SublimeText/Tag.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: How to Tidy HTML

Postby Forbin on Wed Nov 23, 2011 4:30 am

I have the Tag plugin and there is NO tidy function. So I take it this is beyond ST2 at this time. This is really surprising given the other capabilities. I need to have the ability to wrap a section in a new tag and then have it indented properly. The current command for wrapping a tag around a selection mangles the indentation so much as to be useless. It is more time effective to do it by hand. I have to assume that it was intended as a step in wrapping as the ST2 method of wrapping multiple lines with multiple tags is very nice. But even in that case it still needs to be tidied. If only after that I could then run a simple tidy to get the nesting and indention right it would be great.
Forbin
 
Posts: 9
Joined: Mon Nov 21, 2011 12:49 am

Re: How to Tidy HTML

Postby dhc02 on Tue Nov 29, 2011 8:31 pm

Forbin wrote:I have the Tag plugin and there is NO tidy function.

Once you have the Tag plugin installed, the applicable command is "Indent Tags on Document". Took me forever to figure that out, but it works great.

dc
dhc02
 
Posts: 4
Joined: Tue Nov 29, 2011 8:29 pm

Re: How to Tidy HTML

Postby Crosscut on Wed Nov 30, 2011 8:53 am

dhc02 wrote:Once you have the Tag plugin installed, the applicable command is "Indent Tags on Document". Took me forever to figure that out, but it works great.

dc

And why not name the fucntion o that it will be clear what it if for! Thanks, dhc02
Crosscut
 
Posts: 1
Joined: Wed Nov 30, 2011 8:40 am

Re: How to Tidy HTML

Postby ashima461 on Sat Jul 06, 2013 11:42 am

HTML tidy is the probably the most popular HTML tidying utility available.This is an online version of HTML Tidy.It can be used on all major operating systems.In this is the best time to consider using HTML Tidy.Please try it, it works great

website design chennai
ashima461
 
Posts: 1
Joined: Sat Jul 06, 2013 11:25 am


Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests