Project

General

Profile

Actions

Feature #1313

closed

Optionally use ultraviolet for syntax highlighting

Added by Philip Hofstetter over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
UI
Target version:
-
Start date:
2008-05-27
Due date:
% Done:

100%

Estimated time:
Resolution:
Wont fix

Description

ultraviolet (http://ultraviolet.rubyforge.org), by using TextMate's syntax files, is able to support many more languages than what the current syntax highlighting engine does. And it seems to remain in active development.

On the downside though, it comes with quite the heap of dependencies of which one, Oniguruma, requires native compiling.

So I guess the goal would be to keep both the current syntax highlighting engine intact, while optionally using ultraviolet if it's available.

This would bring redmine PHP syntax highlighting, for example.

I'll try and have a look into this - no promises though (/me is a rails noob).


Related issues

Related to Redmine - Feature #2985: Make syntax highlighting pluggableClosed2009-03-16

Actions
Related to Redmine - Feature #24681: Syntax highlighter: replace CodeRay with RougeClosedJean-Philippe Lang

Actions
Actions #1

Updated by Thomas Lecavelier over 16 years ago

Could be interesting for the high number of matching language. It should be integrated as an option, as rmagick, since it has a dependency.

Thank you for pointing it out.

Actions #2

Updated by Philip Hofstetter over 16 years ago

agreed. It must be an option and I'm currently looking into making this happen.

Thanks for providing me with a pointer to the rmagick stuff as I was a bit puzzled about how to optionally require gems (ruby noob here, as stated in the original report). Now I know where to look :-)

Actions #3

Updated by Youssef Abou-Kewik over 16 years ago

For the helpless who are in need, I have an ugly hack here: http://www.redmine.org/issues/show/1651 that uses pygments since I never wrote ruby before.

Actions #4

Updated by David Bronke almost 16 years ago

Any progress on this? I just recently made some modifications to Larry Baltz's Markdown Formatter (our version can be found at http://new.development.g33xnexus.com/projects/show/redmine-markdown) to allow it to use a different Markdown parser library, but one of the big missing features of this formatter is code highlighting, and I'd love to be able to use something other than CodeRay. I'd be willing to hack at this, if anyone has some starting code I can look at.

Actions #5

Updated by Philip Hofstetter almost 16 years ago

I've had a definite look at this just last week. There are some issues associated with the UV stuff:

  • The generated HTML uses CSS files which obviously must be available to the public. I'm not quite clear on how to cleanly integrate this into redmine
  • Uv insists on having read access to the file in question to determine the hightlighter to use. Redmine's highlight-function doesn't have access to the actual file, but only the file name and the contents. So it would be needed to patch Uv to work with that (which obviously is enough).

I'm not fluent enough in ruby to make this work in a clean fashion that doesn't require patching Uv, so please, anybody else, go and do this :-)

Actions #6

Updated by Chris Gahan about 15 years ago

  • % Done changed from 0 to 100

I just whipped up an Ultraviolet plugin for Redmine: http://github.com/epitron/redmine_ultraviolet

It works great so far!

If anyone wants to add a configuration screen that lets you pick the colour theme, I'd be very happy. :D

Actions #7

Updated by Go MAEDA almost 8 years ago

  • Related to Feature #24681: Syntax highlighter: replace CodeRay with Rouge added
Actions #8

Updated by Go MAEDA about 6 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

The syntax highlighter has been replaced with Rouge in #24681 and it supports most popular languages.
https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers

Actions

Also available in: Atom PDF