Sha256: b77e6c5e56729d69b4ddb7b7e1fc284dab898017ea36420d9fb8bf2c6155bea4

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

require 'rubygems'

require 'coderay'
require 'uv'
require 'syntax/convertors/html'
require 'rygments'
#require 'pygments'

str = "def hitch; end"

puts "---- Syntax ----"
puts Syntax::Convertors::HTML.for_syntax('ruby').convert(str)

puts "---- Coderay ----"
puts CodeRay.encoder(:html).encode(str, 'ruby')

puts "---- Ultraviolet ----"
puts Uv.parse(str, 'xhtml', 'ruby_experimental', false, 'dawn')

puts "---- Rygments ----"
puts Rygments.highlight_string(str, 'ruby', 'html')

#puts "---- Pygments ----"
#puts Pygments.highlight(str, :lexer => 'ruby', :formatter => 'html')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-codehighlighter-0.6.0 examples/check.rb
rack-codehighlighter-0.5.1 examples/check.rb
rack-codehighlighter-0.5.0 examples/check.rb