2

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?

5
  • Have you tried adjusting Tidy's Options? Feb 20, 2014 at 18:23
  • 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, 2014 at 19:16
  • Or for another tool I can use that will accomplish this if tidy insists on doing too much.
    – Herms
    Feb 20, 2014 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? Feb 20, 2014 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, 2014 at 19:37

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.