Getting the HTML Tidy External Command working on Bluefish for Windows

Written by James McDonald

March 6, 2009

Bluefish is a really cool “Web Development Studio” I find it’s side pane CSS and HTML reference invaluable when trying to code HTML.

It has recently been ported to Windows

As it installs, everything pretty much works out of the box, but it’s Linux heritage shows when trying to use the External ==> Commands menu. None of the supplied options work.
bluefish-commands

The “Tidy cleanup filter” commands fail because tidy doesn’t exist and because the command is constructed for a Linux environment.

Tidy for Windows to the rescue.

Download the tidy.zip and unpack tidy.exe to somewhere in your %PATH% e.g. C:\Windows\System32

In bluefish goto the Edit menu ==> Preferences ==> External Programs and under the Utilities and Filters area add new entry with a Label named “Tidy for Windows” or whatever you want and a Command of

tidy.exe -indent --tidy-mark 0 -q -wrap 0 -utf8 -output "%f" "%s"

Obviously you can experiment with the tidy command options until you get what you want.
I personally prefer my html to be unwrapped and indented. I also had to add --tidy-mark 0 so that tidy wouldn’t add a generator meta tag and then on save bluefish would add it’s own aswell.

Here is a picture of the added command. I have left the old Linux style commands to provide a comparison:
bluefish-tidy-for-windows

From the above picture you may note that I have also created a “Tidy for Cygwin” entry which works just as well as the Windows setup but this requires a serious amount of harddisk space for the installation of Cygwin.

To get it working from Cygwin you need to add the path to your Cygwin bin directory (usuall c:\cygwin\bin) to your Windows %PATH% environment variable.

6 Comments

  1. Aaron K

    I’m not sure what version you tested, but I just installed Bluefish 1.3.3 (unstable) on one of my 64 bit Ubuntu 8.04 machines, and I am very pleased. Absolutely love the “block synchronisation” feature that 1.0.7 lacks.

    Reply
  2. Phil Cooper

    Getting it to work on Ubuntu 10.04 (Linux) was ridiculously simple. Tidy wasn’t included in the default installation, but it was available from the Ubuntu software repositories. Download and installation took a couple of minutes, and It was running. The default command line parameters for Tidy in Bluefish 1.0.7 made everything left-justified and added the Tidy generator mark, but thanks to your pointers here I soon had that rectified. Unfortunately, at the current level of development, Tidy for Linux/x86 released on 25 March 2009 apparently only gives indent increments of two (2) spaces, with no option to vary the amount of indent or substitute tab characters for the spaces. Perhaps that will be fixed in future releases. Even so, it comes very close to the source formatting to which I’m accustomed as a long-time user of Macromedia (Adobe) Dreamweaver.

    Reply
    • admin

      Cool, Thanks for the comment Phil.

      Reply
  3. Bobby Z.

    1. Can you update the article for Bluefish 2.2,5?
    2. Specifically, the menu structure is apparently now: Edit > Preferences > User Interface > External Filters > Add entry
    3. Still, doing this, when I follow your instructions, putting tidy.exe in the path and with the given string, nothing happens. Am I supposed to put the string in quotes or use a piping symbol?
    tidy.exe -indent –tidy-mark 0 -q -wrap 0 -utf8 -output “%f” “%s”
    4. I know tidy.exe is properly installed because I can use it in Windows 7 from a command prompt window.
    5. The screenshot image is impossibly small to read.
    6. What exactly is Bluefish supposed to do? Correct the html in the designer window itself, or create an output file? Is there an output window? Does it act on the entire document, or a selected area? (nothing happens for me either way, selecting text or not)
    7. If the results are not desirable, can the fix be reversed?
    thank you.

    Reply
  4. Bobby Z.

    Putting libtidy.dll in the path doesn’t help.

    Reply
    • James

      A lot in this comment. I havent installed bluefish recently on W7 so cant update the post until I do. Ive been using aptana and eclipse more on windows. If I install again I will update.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...