Actions
Feature #3032
closedUse google Prettify for syntax highlighting instead of CodeRay
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Start date:
2009-03-23
Due date:
% Done:
0%
Estimated time:
Resolution:
Wont fix
Description
I believe it would be preferrable to use the google prettify syntax highlighter rather than Coderay for syntax highlighting in Redmine.
It has support for a much larger set of languages, and highlights the code clientside via javascript rather than serverside (so the pre-formatted code stays readable when looking at the source).
I have hacked support for this into our redmine installation, and the necessary changes (if letting coderay stay active as well) are minimal.
1. Copy the prettify .js files to public/javascripts/ 2. Copy the prettify .css file to public/stylesheets/
Now, I'm not a rails coder, so the following step is probably not the cleanest solution. I'll describe it anyway for completeness:
3. Modify app/views/layouts/base.rhtml with the following changes: 3.1. add onload="prettyPrint()" to the body tag. 3.2. link to prettify.js and prettify.css in the header. 4. Put code in pre blocks with class "prettyprint".
That's all.
Related issues
Actions