Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Use CodeRay for syntax highlighting

#142

We could stop using SyntaxHighlighter in the admin section if we render the diffs using the CodeRay gem.

the use of CodeRay is also demonstrated in the Create a simple code snippet app with Rails article in the third issue of Rails Magazine.

Reported by Matias Korhonen · July 5th, 2009 @ 10:15 PM

State: resolved
Milestone: 0.5
Assigned to: Joao Carlos Joao Carlos

Activity

  1. Matias Korhonen
    Matias Korhonen

    I just found out that there's a gem that can integrate the CodeRay functionality in RedCloth, imaginatively named Redcloth with CodeRay.

    This could be a way of reducing the amount of JS that we employ even further.

    July 8th, 2009 @ 06:05 PM

  2. Matias Korhonen
    Matias Korhonen
    • Title changed from RFC: Use CodeRay for the revision control diffs to RFC: Use CodeRay for the revision control diffs and/or source code highlighting

    July 8th, 2009 @ 06:07 PM

  3. Matias Korhonen
    Matias Korhonen

    I have just discovered that CodeRay itself has a ForRedCloth "hack":

    A little hack to enable CodeRay highlighting in RedCloth.

    http://coderay.rubychan.de/doc/

    Based on a quick test I did in irb, it seems to work!

    July 8th, 2009 @ 06:19 PM

  4. Joao Carlos
    Joao Carlos
    • Milestone changed from 1.0 (The Ultimate Stable Release) to 0.5
    • Assigned user set to Joao Carlos

    July 8th, 2009 @ 06:37 PM

  5. Matias Korhonen
    Matias Korhonen
    • Title changed from RFC: Use CodeRay for the revision control diffs and/or source code highlighting to Use CodeRay for syntax highlighting

    July 8th, 2009 @ 06:39 PM

  6. Joao Carlos
    Joao Carlos
    • State changed from new to open

    I'm already working on this.

    RedCloth 4.2 doesn't work with the stable version of CodeRay. I had to get the SVN version, build the gem and install it. Worked fine.

    One more problem tho: how do you get code on more than one line?

    July 9th, 2009 @ 04:11 AM

  7. Joao Carlos
    Joao Carlos

    And regarding your description "We could stop using SyntaxHighlighter in the admin section", I think we can get completely rid of it. Everywhere.

    July 9th, 2009 @ 04:13 AM

  8. Matias Korhonen
    Matias Korhonen

    One more problem tho: how do you get code on more than one line?

    Do we have to use the Redcloth with CodeRay gem?

    That allows multi-line code samples with a special <source> tag.

    July 9th, 2009 @ 02:41 PM

  9. Joao Carlos
    Joao Carlos
    • State changed from open to resolved

    Done! Forgot to append the ticket number to the commit messages.

    July 9th, 2009 @ 07:42 PM

  10. Joao Carlos

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.