Coda PHP & Web Toolkit: Keep single quotes with CSSTidy

My Coda plugin uses CSSTidy as a cleanup tool to (re)format CSS code. This works quite well, but it has a “feature” that isn’t always right: It removes single quotes from CSS. In this case the single quotes arond the url are removed:

background:#333 url('images/bg-stripes2.png') repeat 0 0;

In order to disable this behaviour here’s a quick workaround. Please note that updating the plugin removes this modification, so if I release the next version I hope I can add a configuration option for this but in the between time here’s how to quickly stop CSStidy from removing quotes:

  • Open the finder and go to (your user folder)/Library/Application Support/Coda 2/Plug-ins (Or “/Coda/” for Coda 1)
  • Right click on “PhpPlugin.codaplugin”, select “Show package contents”
  • Now navigate to “Contents” and then to “Resources”, you’ll see all the support files for the Coda PHP plugin
  • Find the file “csstidy.php” and open it with a Text Editor (I recommend TextMate or Coda itself)
  • Go to line 2958 which reads: $_cur_string = substr($_cur_string, 1, -1);
  • Add two slashes before this line, like this: // $_cur_string = substr($_cur_string, 1, -1);
  • Save the file, exit and restart Coda and you’re done

Of course making a backup of this file is recommended. If you totally screwed up something you can delete the plugin-file and reinstall it without problems :)

Personal recommendation: Adam Curtis

screenshot from "All Watched Over By Machines Of Loving Grace"

Usually blog posts here are about software development or are just update announcements for software I’ve written. This one’s different, because it doesn’t deal with software, development or the like.

screenshot from "All Watched Over By Machines Of Loving Grace"

What I recommend here are documentaries which I found to be absolutely outstanding and eye-opening. I’m talking about the British film maker Adam Curtis who made several films for the BBC.
For me his most impressive work is All Watched Over By Machines Of Loving Grace – a three part series about machines and power. The first part for example connects seemingly unrelated events and persons like Ayn Rand, Bill Clinton, the Asia crisis and the rise of Silicon Valley to a greater narrative about how ideas and structures evolved in modern society.

His movies are also filmed differently than most documentaries you know – more like an audiovisual mash-up without loosing the focus on the content.

Fortunately all of Adam Curtis’ works can be watched online on thoughtmaybe.com (which by the way is a great resource for documentaries):

http://thoughtmaybe.com/by/adam-curtis/ »

The films are in English, subtitles are available in Spanish and French.

Also don’t miss the other features, especially The Trap and The Power of Nightmares.

Coda PHP & Web Toolkit 3.9 beta

If you have problems with the current PHP & Web Toolkit, have a look at the current beta version. It should fix some errors when using “minify on publish” (for CSS and JS files).

New stuff

  • New CSS Minifier included, should greatly improve CSS output after minification and fix bugs with negative values.
  • Minify on publish should now work correctly.
  • New setting “laxcomma” added to JSHin.

Download and feedback here »