January 3, 2008
filed mid-afternoon by DrScofield in: hacking, research
QR code for this entry · average time to read 0:32 minutes

SyntaxHighlighter is quite a nice wordpress plugin that provides syntax highlighting for a range of programming languages (among them my favorites python & C#). the problem is, in its original unadulterated form it doesn’t play with my favorite markup plugin php markdown extra at all :-(

after quite a bit of hacking, it transpires that one can make them play nicely with one another. the idea that i pursued was to change the [source:XXX] tag to < source lang=XXX> and have php markdown treat it the same as the < pre> tag.1

getting markdown extra to recognize the < source> tag is fairly easy2, i needed to change to read

next, in the syntax plugin, all occurrences of [source: are replaced by < source lang=.

i’ve created ZIP files of the modified SyntaxHighlighter and Markdown Extra plugins, share and enjoy.


  1. to prevent any of the parsers from jumping on the tags, i’ve inserted a space between ‘<’ and the tag name. 

  2. …once you figure it out, that is. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
filed in the early afternoon by DrScofield in: from the grid, hacking
technorati tags:
QR code for this entry · average time to read 0:49 minutes

yesterday i updated the wordpress plugins on our d2h.net and xyzzyxyzzy.net blogs. once done, both blogs would not work anymore…duh! the updated geopress plugin was borked :-( — or so it seemed…

…it turned out that i had added code to the earlier version of geopress to do pretty printing of coordinates, and, of course, the update flushed that code down the drain. thanks to a regular backup running on our web server, however, that code was not gone forever. here are the functions that i added:

the_geo_coord() gets the coordinates via geopress’s the_coord() function and simply substitutes commas for spaces.

likewise,

takes geopress’s the_coord() and pretty-prints it as human readable “old-style” latitute–longitude coordinates. the_geo_coord_esc() finally, produces a URL escaped longitude–latitude coordinate for use inside a, well, URL:

just add those PHP functions to geopress/geopress.php, shake, stir, and save.

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.