Skip to content
Browse files

replace pygments.rb with rouge

  • Loading branch information...
1 parent c4667a2 commit 8e90bd117626992e7f74436dd0f896c7b6ef158e @zzak committed Mar 18, 2013
Showing with 8 additions and 11 deletions.
  1. +2 −2 README.md
  2. +2 −2 glorify.gemspec
  3. +3 −6 lib/glorify/renderer.rb
  4. +1 −1 lib/glorify/template.rb
View
4 README.md
@@ -5,7 +5,7 @@
Sinatra helper to parse markdown with syntax highlighting like the pros
Renders markdown via redcarpet with syntax highlighting thanks to
-[pygments.rb](https://github.com/tmm1/pygments.rb).
+[rouge](https://github.com/jayferd/rouge).
Able to use fenced code blocks like github, and includes a default pygments
stylesheet.
@@ -29,7 +29,7 @@ gem 'glorify'
Sinatra::Glorify comes with a tilt template for rendering markdown.
This allows you to override the default markdown renderer and use `redcarpet`
-with `pygments.rb` to highlight any code blocks within your view.
+with `rouge` to highlight any code blocks within your view.
In order to do this, you will need to prefer the template class.
View
4 glorify.gemspec
@@ -9,14 +9,14 @@ Gem::Specification.new do |s|
s.email = ["zachary@zacharyscott.net"]
s.homepage = "http://zacharyscott.net/glorify/"
s.summary = %q{Sinatra helper to parse markdown with syntax highlighting like the pros}
- s.description = %q{Renders markdown via redcarpet with syntax highlighting thanks to pygments.rb. Able to use fenced code blocks like github, and includes a default pygments stylesheet.}
+ s.description = %q{Renders markdown via redcarpet with syntax highlighting thanks to rouge. Able to use fenced code blocks like github, and includes a default pygments stylesheet.}
s.files = `git ls-files`.split("\n")
s.require_paths = ["lib"]
s.add_runtime_dependency "sinatra"
s.add_runtime_dependency "redcarpet", "~> 2.0"
- s.add_runtime_dependency "pygments.rb"
+ s.add_runtime_dependency "rouge", "~> 0.3.0"
s.add_runtime_dependency "nokogiri"
s.add_development_dependency "minitest"
View
9 lib/glorify/renderer.rb
@@ -1,14 +1,11 @@
require "redcarpet"
-require "pygments.rb"
+require "rouge"
+require "rouge/plugins/redcarpet"
module Sinatra
module Glorify
class Renderer < Redcarpet::Render::HTML # :nodoc:
-
- def block_code(code, lang) # :nodoc:
- Pygments.highlight(code, :lexer => lang, :options => {:encoding => "utf-8"})
- end
-
+ include Rouge::Plugins::Redcarpet
end
end
end
View
2 lib/glorify/template.rb
@@ -6,7 +6,7 @@ module Glorify
# Sinatra::Glorify comes with a tilt template for rendering markdown.
#
# This allows you to override the default markdown renderer and use
- # +redcarpet+ with +pygments.rb+ to highlight any code blocks within your
+ # +redcarpet+ with +rouge+ to highlight any code blocks within your
# view.
#
# In order to do this, you will need to prefer the template class.

0 comments on commit 8e90bd1

Please sign in to comment.
Something went wrong with that request. Please try again.