Adopt Pygments for syntax highlighting
|Reported by:||Christopher Lenz||Owned by:||Christopher Lenz|
Pygments provides very nice—and pure Python—syntax highlighting. We should strongly consider adopting it as the default highlighter for future Trac releases, probably starting with 0.11, seeing how the current Enscript/Silvercity/PHP methods all suck.
Matt has already cooked up a Trac plugin for Pygments here.
I'm attaching some patches for both the Trac Mimeview component and the TracPygments plugin, accomplishing the following:
- the Pygments highlighter generates a Genshi event stream instead of a big string,
- the Mimeview component handles Genshi streams correctly, and supports putting individual lines in table rows,
- the Pygments support comes with a preference panel that allows the user to choose the highlighting theme, including live preview.
Some of this requires recent Genshi trunk.
The patches are more of a preview of what I'd like to see integrated for 0.11, not really a patch ready to be integrated. For example, the TracPygments patch is intended to be applied to the plugin. Also, a lot of details need to be refined.
Change History (19)
follow-up: 2 comment:1 by , 13 years ago
|Keywords:||mimeview highlighting added|
|Severity:||normal → major|