Posted by zhangxiao on March 18, 2011 at 1:52pm
This module provides an input filter which does source code syntax highlighting by using Pygments.
Prerequisite
You need a working Pygments on your host.
See how to install Pygments.
Installation
- Enable this module.
- Go to admin/config/content/formats page, configure the text format in which you want to enable Pygmentizer.
- In the configuration page check Highlight inline codes with Pygments. It'd be better to give Pygmentizer a lower weight or say a higher priority.
- At bottom of configuration page switch to settings tab of Pygmentizer.
- Set your Pygments' binary path, choose the way you want to wrap your inline codes and pick a highlighting style for you web site.
- As mentioned at first in settings tab, don't forget to allow HTML tags required by Pygmentizer if you have HTML Filter enabled.
Usage
Depends on the codes wrapper you choose, you can put inline codes in either <pygmentize[ lang=php|html|...]>...</pygmentize> or <code>. The former way makes it possible to specify language. However Pygments will try to guess it if not explicitly specified. The latter way works with HTML <code> tag.
Todo
- Need to test under Windows environment.
Downloads
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Utility
- Reported installs: 5 sites currently report using this module. View usage statistics.
- Downloads: 99
- Last modified: May 11, 2012
