Patch #1651
Hack to make redmine use pygmentize instead of CodeRay
| Status: | New | Start: | 2008-07-15 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
Description
We're going to be using Redmine internally with lots of Python code involved. Thought I'd share this patch with you guys.
I never wrote in ruby before, and I used some of the code mentioned here: http://matt.tarbit.org/2008/02/05/extending-bluecloth-with-pygments
You need to test that pygmentize works on your system first, and if it does, this should work just fine. Unfortunately, syntax highlighting is not a plugin.
History
2008-07-25 05:19 - Calvin Cheng
Youssef Abou-Kewik wrote:
We're going to be using Redmine internally with lots of Python code involved. Thought I'd share this patch with you guys. I never wrote in ruby before, and I used some of the code mentioned here: http://matt.tarbit.org/2008/02/05/extending-bluecloth-with-pygments
You need to test that pygmentize works on your system first, and if it does, this should work just fine. Unfortunately, syntax highlighting is not a plugin.
Looks good. It's what I have been looking for!
Coderay has simply been just too limited. Pygments rock in comparison.
Will give this patch a shot. But it looks like I have to maintain this file thereafter since I track the trunk directly.
2008-07-25 22:17 - Youssef Abou-Kewik
- File scm_patch_pygmentize.diff added
I'm attaching another update. This one should count fully on pygmentize instead of CodeRay (the previous patch relied on CodeRay to determine file type). However, this one relies on writing a temp file to /tmp where pygmentize can read it and determine its file type on its own. Also, files with UTF8 encoding should work now.
2008-09-19 16:52 - Anatolii Kucheruck
- File scm_patch_pygmentize2.diff added
Youssef Abou-Kewik wrote:
I'm attaching another update. This one should count fully on pygmentize instead of CodeRay (the previous patch relied on CodeRay to determine file type). However, this one relies on writing a temp file to /tmp where pygmentize can read it and determine its file type on its own. Also, files with UTF8 encoding should work now.
There are one "bug" in this patch: if pygmentize can't recognize file type (e.g. file has no extension or pygmentize has no such type in lexer's list), the error was occurred and empty string was returned, and we have no content.
I'm attaching athother one path with fix this (file type compulsorily set to "text" in described case).