Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Browser Syntax Highlighting Plugin?

What is the standard Rails plugin for syntax highlighting (in a website admin panel for example, not for TextMate) that works right out of the box in a Rails project?

like image 358
Lance Avatar asked Dec 17 '22 03:12

Lance


1 Answers

I've seen many different ways for code highlighting in the Rails community.

  • The GitHub crew loves Pygments. They are using it on many different places, including Jekyll and GitHub itself. The downside is that it's a python library so you would need to install python and execute it as a shell task.
  • SyntaxHighlighter is an other popular, JavaScript based solutions. This is the one adopted by WordPress and Yahoo! There are many different Rails plugins for this even if the integration doesn't actually require a plugin.
  • Ruby offers 3 code highlighting Gems: Ultraviolet, Syntax and CodeRay. AFAIK, the last one is the most adopted.

I tried all those solutions in the past. I'm actually using Pygments for a couple of Jekyll blogs and JavaScript based solutions in all the other cases.

like image 88
Simone Carletti Avatar answered Dec 30 '22 04:12

Simone Carletti