views:

33

answers:

1

Im working on a Rails based application where I have the need to allow the user to format the text he enters and I would also like a way to highlight code snippets the way Stackoverflow does when I enter a code snippet.

Are there any plugins that do this.

And I would also like to know which is the RTE that is recommended and would be unobtrusive. I see a lot of recommendations for FCKEditor but how do I implement the code snippets

Thanks in advance.

+1  A: 

It seems like you might need something lighterweight than CKeditor. If you do choose to use CKeditor, I would use a rails plugin to install it. I use this one :

http://github.com/galetahub/rails-ckeditor

The directions are very straightforward on the git.

As for Syntax Highlighting , I recommend :

  • 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.

  • Syntax Highlighter, jQuery Library <-- The easiest to implement

    http://alexgorbatchev.com/SyntaxHighlighter/

  • Rails3 has these plugins :

    Ruby offers 3 code highlighting Gems: Ultraviolet, Syntax and CodeRay. AFAIK, the last one is the most adopted.

Trip
looks cool ill give it a try. Any idea how to go about managing code highlighting?
Sid
I updated my answer :)
Trip
If this answers your question, click the green checkmark. :D
Trip