imathis/octopress — Issue #354: Request: Add support for custom Pygments installations
Author: abevoelker
Created: 2012-01-02 23:47:01+00:00
State: open

I currently have a need for parsing an esoteric language and had to write a lexer for Pygments myself to get it supported. Unfortunately, Pygments seems rather slow at merging [pull requests](https://bitbucket.org/birkenfeld/pygments-main/pull-requests) so it still hasn't made its way into main yet.

In order to get syntax highlighting working for Octopress, I added the line

```ruby
Pygments.start("/path/to/my/pygments_fork")
```

to be the first line of the `HighlightCode::pygments` method in `plugins/pygments_code.rb`. I tried to find a way to make this be configurable by using a new value in the `_config.yml` file, but the other plugin code all seem to use the Jekyll module which already has access to config options through site.config. I assumed re-opening the .yml file for parsing would be a bit hackish.