Rails Browser Syntax Highlight Plugin?

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

+4
source share
3 answers

I have seen many different ways to highlight code in the Rails community.

  • The GitHub team loves Pygments . They use it in many different places, including Jekyll and GitHub. The downside is that it is a python library, so you will need to install python and execute it as a shell task.
  • SyntaxHighlighter is another popular JavaScript solution. This is the one that has been adopted by WordPress and Yahoo! There are many different Rails plugins for this, even if the integration does not really require a plugin.
  • Ruby offers 3 Gems code highlighting: Ultraviolet , Syntax, and CodeRay . AFAIK, the last one is most in demand.

I have tried all these solutions in the past. I actually use Pyigs for several Jekyll blogs and JavaScript-based solutions in all other cases.

+6
source

I used CodeMirror . Not really a plugin, but still very direct to integrate with Rails.

+4
source

We use highlight.js at http://giantrobots.thoughtbot.com (this is not a Rails application, but anyway) and it is awesome.

http://softwaremaniacs.org/soft/highlight/en/

+2
source

Source: https://habr.com/ru/post/1300697/


All Articles