(x)html, css, wiki/cms

vimcolor plugin for wordpress

I recently downloaded the vimcolor plugin for wordpress so my code samples could look nice and spiffy, with the syntax highlighting I am accustomed to seeing.

There were of course a few problems. The most notable was some path problems. It was trying to use these values:


< ?php $in_file = tempnam($GLOBALS['conf']['file_directory_temp'], 'pl'); $out_file = tempnam($GLOBALS['conf']['file_directory_temp'], 'htm'); >

I never saw any of these set in any of the configuration files for wordpress, so I just hardcoded in some values that I wanted

There were two other things that I fixed

  1. In order to highlight code, one merely has to put the code in a code block, and set the style, something like this:

    < code type="php">some code here< /code >;

    The problem was that the plugin was specifically looking for type=“[a-z]+“, with the quotation marks as part of the regular expression. I like to use single quotes (don’t have to press the shift key), and this is legal html. So I changed that to allow both single and double quotes, using type=(\’|“)[a-z]+(\’|“)
  2. The other thing I changed was actually just css. The author, whom I tried to track down, but could not, mentioned that he would like a horizonatal scroll bar to appear automatically. This is simply down with the CSS rule overflow:auto;

I hope you enjoy the syntax highlighting as much as I do.