Feature #1313

Optionally use ultraviolet for syntax highlighting

Added by Philip Hofstetter about 14 years ago. Updated almost 4 years ago.

Status:ClosedStart date:2008-05-27
Priority:LowDue date:
Assignee:-% Done:


Target version:-
Resolution:Wont fix


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 pluggable Closed 2009-03-16
Related to Redmine - Feature #24681: Syntax highlighter: replace CodeRay with Rouge Closed


#1 Updated by Thomas Lecavelier about 14 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.

#2 Updated by Philip Hofstetter about 14 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 :-)

#3 Updated by Youssef Abou-Kewik about 14 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.

#4 Updated by David Bronke over 13 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.

#5 Updated by Philip Hofstetter over 13 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 :-)

#6 Updated by Chris Gahan over 12 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

#7 Updated by Go MAEDA over 5 years ago

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

#8 Updated by Go MAEDA almost 4 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.

Also available in: Atom PDF