A while back I switched to GeSHi for source code highlighting in my posts, and recently I started writing PowerShell scripts in my posts, and calmly sticking it in <code lang=“posh”> tags, half expecting it to just work, like all the other languages … but of course it didn’t. So after a few searches on Google and Ask, I concluded that a PowerShell syntax file doesn’t yet exist. So, I made one, feel free to grab it (it’s GPL, and I’ve even left intact the “any later version” clause from GeSHi’s license).
EDIT: 6/10/2007
I should mention that the way I do highlighting doesn’t care about “Nouns” at all: it just uses a list of Verbs, and matches anything that starts with a “Verb-” ... that means that for the sake of the highlighting, you can’t just say “Content” for Get-Content or (even though that actually works in a script). Also, I changed the version I was using so that it uses regular expression patters for command parameters, instead of a list. Because you can abbreviate parameters to the shortest distinguishable form, a list doesn’t really work.
Let’s just see in action, shall we? (more…)
EDIT I’m inserting an extra paragraph
Just to test if the textile stuff is misbehaving
Because I had an error report.
I’m releasing a new version of the WordPress Textile 2 plugin, as well as my own plugin for doing syntax highlighting with GeSHi. But I feel like I need to explain what’s going on, rather than just posting the downloads.
There are two big changes to the Textile 2 plugin. I’ve changed the way I’m distributing the plugin: instead of a single file, there are two, which must go together into a folder in your WordPress plugins directory. To simplify that I’ve packaged them as a .7z .tgz .zip which you can just unpack in the plugins folder. The reason for this change is that this allows me to distribute the unmodified classTextile.php from Dean Allen’s last textpattern release, and allows you the option of just replacing that file with the latest from the svn repository in the future.
I’ve changed the name to “TextileWrapper” to be more in line with what’s really going on. I want to make perfectly clear that I am not editing Textile at all this time. Any bugs with the way Textile work are Textile’s bugs, and should be filed via the Textile Homepage. Any bugs with the way it integrates into WordPress should be filed here. As far as the version number … Dean Allen has left Textile as “2.0 Beta” for a very long time, despite the fact that he’s on version 4.3 of Textpattern (which has been using Textile since the beggining). The internal revision number for the file has been divorced from actual revisions to Textile, because Subversion revision’s the whole project, so there’s nothing to go on there, either. At any rate, based on all that, I’ve decided to just call this version 2.8 as it’s really the next version of my “Textile 2” plugin, even though I’ve renamed it … and it really should work with any version of Textile since the first 2.0 Beta.
I finally came to my senses with this release and realized that the problem with code blocks is really not a Textile problem, but rather, a problem of the various syntax highlighters I’ve been using.
(more…)