diff --git a/config/environment.rb b/config/environment.rb index a2332a008..d0e8be900 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -55,7 +55,7 @@ Rails::Initializer.run do |config| config.action_mailer.perform_deliveries = false config.gem 'rubytree', :lib => 'tree' - config.gem 'coderay', :version => '~>0.9.7' + config.gem 'coderay', :version => '~>1.0.0' # Load any local configuration that is kept out of source control # (e.g. gems, patches). diff --git a/lib/redmine/syntax_highlighting.rb b/lib/redmine/syntax_highlighting.rb index 14d08de15..72a46ece5 100644 --- a/lib/redmine/syntax_highlighting.rb +++ b/lib/redmine/syntax_highlighting.rb @@ -46,7 +46,7 @@ module Redmine # Highlights +text+ using +language+ syntax # Should not return outer pre tag def highlight_by_language(text, language) - ::CodeRay.scan(text, language).html(:line_numbers => :inline, :wrap => :span) + ::CodeRay.scan(text, language).html(:line_numbers => :inline, :line_number_anchors => false, :wrap => :span) end end end diff --git a/public/help/wiki_syntax_detailed.html b/public/help/wiki_syntax_detailed.html index 6eaaf33ac..048edbd3a 100644 --- a/public/help/wiki_syntax_detailed.html +++ b/public/help/wiki_syntax_detailed.html @@ -18,20 +18,22 @@ } a.new { color: #b73535; } - .CodeRay .c { color:#666; } - - .CodeRay .cl { color:#B06; font-weight:bold } - .CodeRay .dl { color:black } - .CodeRay .fu { color:#06B; font-weight:bold } - - .CodeRay .il { background: #eee } - .CodeRay .il .idl { font-weight: bold; color: #888 } - - .CodeRay .iv { color:#33B } - .CodeRay .r { color:#080; font-weight:bold } - - .CodeRay .s { background-color:#fff0f0 } - .CodeRay .s .dl { color:#710 } + .syntaxhl .line-numbers { padding: 2px 4px 2px 4px; background-color: #eee; margin:0 } + .syntaxhl .comment { color:#666; } + + .syntaxhl .class { color:#B06; font-weight:bold } + .syntaxhl .delimiter { color:black } + .syntaxhl .function { color:#06B; font-weight:bold } + + .syntaxhl .inline { background: #eee } + .syntaxhl .inline .inline-delimiter { font-weight: bold; color: #888 } + + .syntaxhl .instance-variable { color:#33B } + .syntaxhl .reserved { color:#080; font-weight:bold } + + .syntaxhl .string { background-color:#fff0f0; color: #D20; } + .syntaxhl .string .delimiter { color:#710 } + @@ -242,7 +244,7 @@ To go live, all you need to add is a database and a web server.
Code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, cpp, css, delphi, groovy, html, java, javascript, json, php, python, rhtml, ruby, scheme, sql, xml and yaml languages.
+Default code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, cpp, css, delphi, groovy, html, java, javascript, json, php, python, rhtml, ruby, scheme, sql, xml and yaml languages.
You can highlight code in your wiki page using this syntax:
@@ -254,17 +256,16 @@ To go live, all you need to add is a database and a web server.Example:
-1 # The Greeter class - 2 class Greeter - 3 def initialize(name) - 4 @name = name.capitalize - 5 end - 6 - 7 def salute - 8 puts "Hello #{@name}!" - 9 end -10 end -
+1 # The Greeter class + 2 class Greeter + 3 def initialize(name) + 4 @name = name.capitalize + 5 end + 6 + 7 def salute + 8 puts "Hello #{@name}!" + 9 end +10 end