Tidy command that only fixes indent











up vote
1
down vote

favorite












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?










share|improve this question






















  • Have you tried adjusting Tidy's Options?
    – Ƭᴇcʜιᴇ007
    Feb 20 '14 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 '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?
    – Ƭᴇ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















up vote
1
down vote

favorite












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?










share|improve this question






















  • Have you tried adjusting Tidy's Options?
    – Ƭᴇcʜιᴇ007
    Feb 20 '14 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 '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?
    – Ƭᴇ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













up vote
1
down vote

favorite









up vote
1
down vote

favorite











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?










share|improve this question













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?







html indent






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 20 '14 at 18:02









Herms

4,12982835




4,12982835












  • Have you tried adjusting Tidy's Options?
    – Ƭᴇcʜιᴇ007
    Feb 20 '14 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 '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?
    – Ƭᴇ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


















  • Have you tried adjusting Tidy's Options?
    – Ƭᴇcʜιᴇ007
    Feb 20 '14 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 '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?
    – Ƭᴇ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
















Have you tried adjusting Tidy's Options?
– Ƭᴇcʜιᴇ007
Feb 20 '14 at 18:23






Have you tried adjusting Tidy's Options?
– Ƭᴇcʜιᴇ007
Feb 20 '14 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 '14 at 19:16






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




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?
– Ƭᴇcʜιᴇ007
Feb 20 '14 at 19:22






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?
– Ƭᴇ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




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 Answer
1






active

oldest

votes

















up vote
0
down vote













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






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f719519%2ftidy-command-that-only-fixes-indent%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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






    share|improve this answer

























      up vote
      0
      down vote













      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






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        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






        share|improve this answer












        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 at 16:12









        Weston C

        1166




        1166






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f719519%2ftidy-command-that-only-fixes-indent%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”