Use CodeRay for syntax highlighting
Reported by Matias Korhonen | July 5th, 2009 @ 10:15 PM | in 0.5
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.
Comments and changes to this ticket
-
Matias Korhonen July 8th, 2009 @ 06:05 PM
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.
-
Matias Korhonen July 8th, 2009 @ 06:07 PM
- 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
-
Matias Korhonen July 8th, 2009 @ 06:19 PM
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!
-
Joao Carlos July 8th, 2009 @ 06:37 PM
- Milestone changed from 1.0 (The Ultimate Stable Release) to 0.5
- Assigned user set to Joao Carlos
-
Matias Korhonen July 8th, 2009 @ 06:39 PM
- Title changed from RFC: Use CodeRay for the revision control diffs and/or source code highlighting to Use CodeRay for syntax highlighting
-
Joao Carlos July 9th, 2009 @ 04:11 AM
- 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?
-
Joao Carlos July 9th, 2009 @ 04:13 AM
And regarding your description "We could stop using SyntaxHighlighter in the admin section", I think we can get completely rid of it. Everywhere.
-
Matias Korhonen July 9th, 2009 @ 02:41 PM
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.
-
Joao Carlos July 9th, 2009 @ 07:42 PM
- State changed from open to resolved
Done! Forgot to append the ticket number to the commit messages.
-
Joao Carlos August 6th, 2009 @ 06:58 PM
(from [320a41ea44e3f96d4975c3171e7ef9140792fdeb]) Switched to Redcloth with CodeRay [#142] [#144 state:resolved] [#145 state:resolved] http://github.com/jcxplorer/hhlc/commit/320a41ea44e3f96d4975c3171e7...
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby on Rails web application for the HAAGA-HELIA Linux Club.
People watching this ticket
Referenced by
- 142 Use CodeRay for syntax highlighting (from [320a41ea44e3f96d4975c3171e7ef9140792fdeb]) Switche...
- 144 Code block should print line numbers (from [320a41ea44e3f96d4975c3171e7ef9140792fdeb]) Switche...
- 145 Code block should be clearly distinguished from other content (from [320a41ea44e3f96d4975c3171e7ef9140792fdeb]) Switche...