wfsp has asked for the wisdom of the Perl Monks concerning the following question:

HTML::Tidy readme.txt explains that: You need libtidy to build HTML::Tidy. and later:
You can get a distribution for libtidy at: http://tidy.sourceforge.net/src/tidy_src.tgz
Can libtidy only be installed by downloading the source and compiling it?

What I'm trying to do...

I have over 2k html files (25MB). The oldest written in 1998. Many hands have been involved using many incarnations of MS FrontPage.

My aim is xhtml compliance. I have been using html tidy...

system( 'c:/tidy/tidy.exe', '-asxml', '-config', 'c:/tidy/tidy.cnf', '-f', $error_file, '-m', $html_file );
In conjunction with File::Find, this produces err files which I then parse to extract particular warnings/errors. HTML::Tokeparser::Simple is used to fix anything tidy can't (badly nested divs have been a headache). After many passes and quite a bit of hand editing we're nearly there.

I'm keen to use HTML::Tidy as it looks to be a more elegant and efficient solution. Is there an alternative?

Thanks in advance.

Activestate 5.8 and winXP, there doesn't appear to be a ppm

Replies are listed 'Best First'.
Re: Install libtidy on windows
by BrowserUk (Patriarch) on Aug 07, 2004 at 10:45 UTC

    Did you see this?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      Thanks for your reply.

      I had seen it but the line

      C/C++ Programmers
      had me scurrying away!

      With your encouragement I looked again. I downloaded tidy-dll.zip and I now have libtidy.dll and libtidy.lib

      Sorry about this, but where's the best place to put them (apart from the obvious!).

      Again, many thanks

      Fixed typo (I think)

      Update: Closer inspection reveals I had in fact downloaded tidylib.dll and tidylib.lib. I don't think it would have made any difference though. Apologies for any confusion.

        I can't work how to build it out either. The makefile generated seems terminally broken and is so full of pointless, redundant and over-engineered crap that my brain recurses up it's own hypothalymus trying to mentally unwind it all--life's to short for that kind of crap.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: Install libtidy on windows
by adrianh (Chancellor) on Aug 07, 2004 at 10:52 UTC
    Can libtidy only be installed by downloading the source and compiling it?

    There are some unsupported XP binaries available for download. It may work with them, but I don't have any windows boxes to hand to check.

      Thanks for that.

      I now have libtidy.dll and libtidy.lib. Where would you suggest I move them so that makefile can see them?

      Thanks again.

        Where would you suggest I move them so that makefile can see them?

        I think \windows\system would be the appropriate location for Win 95, not sure about XP - Windows isn't my OS of choice so I could well be wrong.

Re: Install libtidy on windows
by chanio (Priest) on Aug 08, 2004 at 03:56 UTC
    HTML-Kit is a multi-purpose development environment that has it as plugin and does some batch file updating ruled by REGEX.

    .{\('v')/}
    _`(___)' __________________________