Tag Archives: WordPress plugin

MacFUSE and sshfs on Snow Leopard

While in the process of working on the WordPress plugin mentioned in my last post, I found myself having to do a edit/save/upload cycle annoyingly often, as this WordPress install doesn’t run on my local machine and I didn’t feel like dealing with getting httpd up and running here again. More than once I caught myself trying to figure out why my changes weren’t having an effect until I realized I was forgetting the upload step. And entering a passphrase for scp every time I hit Save is tedious at best. But this blog is hosted on DreamHost, and TextMate doesn’t have SFTP support, so I couldn’t just mount a network drive in the Finder.

But I’d heard of this magical, wonderful thing called sshfs that would let me mount an sftp server as a volume on my machine. That would solve a lot of problems! At first I did the obvious: I went to Terminal and entered sudo port install macfuse sshfs. It didn’t work. Small wonder; the last version of MacFUSE in MacPorts is 2.0.3, which is a considerable distance behind the most recent release, 2.1.5). So I used the MacFUSE prefpane to update to 2.1.5, but then the sshfs install wanted nothing to do with me because it was built against the older version. I went to download a prebuilt binary, since that was just easier, but there wasn’t one for Snow Leopard. I tried to build sshfs from source, but the prefpane hadn’t installed sufficient libraries to do that with. So I went to build MacFUSE itself from source.

Continue reading

Highlighting source code in WordPress with Pygments

So I was playing around with the rather nice SyntaxHighlighter WordPress plugin. It worked pretty nicely. But it had some issues, IMO:

  1. It repurposes the class attribute to act like a pseudo-CSS ruleset with custom rules. To me that’s just ugly.
  2. It does all its work client-side. For some things that’s a nice touch, but for a blog with mostly static content it’s wasted time.
  3. It does almost everything in JavaScript. I have a personal distaste of working with JavaScript for no especial reason whatosever.
  4. It’s LGPLv3. I prefer less restrictive licenses for OSS.

On the other hand, I know the Pygments syntax highlighter pretty well, and I already had a written style plugin for it to get the syntax coloring I like. But there’s no mature Pygments plugin for WordPress that I could find. So I did what any good programmer would do and set out to write my own. I have the working knowledge of PHP (I’m a core dev, for mercy’s sake) and Python to do it with, after all. Not so much WordPress’ plugin API, though, so I took the SyntaxHighlighter plugin as a starting point.

Continue reading