3

I have a number of HTML files that contain snippets of HTML code (not full pages, so no body tags, etc). Unfortunately the HTML in those files is completely unindented.

I'd like to run tidy to re-indent the file, but tidy tries to do a lot of other things that I don't want it to do. The only modification I want made to the file in indent.

Is there any way to turn off all the other tidy behavior and just have it indent, or another tool (I'm on linux) that I could use to achieve this?

Herms
  • 9,404
  • 9
  • 35
  • 36
  • Have you tried adjusting [Tidy's Options](http://tidy.sourceforge.net/docs/quickref.html)? – Ƭᴇcʜιᴇ007 Feb 20 '14 at 18:23
  • 1
    Tidy has a TON of options, and I'm having trouble telling what I need to change. Thus my question. I'm looking for a way to turn everything off except indentation. – Herms Feb 20 '14 at 19:16
  • Or for another tool I can use that will accomplish this if tidy insists on doing too much. – Herms Feb 20 '14 at 19:17
  • So turn off all optined except indent. Tool requests are off-topic in general. Why not use one of MANY on-line HTML tidying sites? Like [Tabifier](http://tools.arantius.com/tabifier)? – Ƭᴇcʜιᴇ007 Feb 20 '14 at 19:22
  • Because it's generally frowned upon at my company to use tools that require sending code externally (in this case it shouldn't be an issue but I'm trying to follow the rules). – Herms Feb 20 '14 at 19:37

1 Answers1

1

There's a similar stackoverflow question that seems to have some decent answers here:

https://stackoverflow.com/questions/7151180/use-html-tidy-to-just-indent-html-code

Weston C
  • 131
  • 6