Skip to content

Commit

Permalink
add code highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Mar 10, 2013
1 parent 25624d0 commit a15c1ed
Show file tree
Hide file tree
Showing 12 changed files with 6,865 additions and 9,609 deletions.
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ require 'rake/clean'
require 'rdoc/encoding'
require 'rdoc/markup/to_html'
require 'redcarpet'
require 'rouge'
require 'rouge/plugins/redcarpet'
require 'uri'

class HTML < Redcarpet::Render::HTML
include Rouge::Plugins::Redcarpet # yep, that's it.
end

def readme(pattern = "%s", &block)
return readme(pattern).each(&block) if block_given?
%w[en de es fr hu jp zh ru ko pt-br pt-pt].map do |lang|
Expand Down Expand Up @@ -84,7 +90,7 @@ desc 'Convert Sinatra READMEs to HTML'
task 'convert:sinatra' do
readme do |fn|
file "_includes/#{fn}.html" => ["_sinatra/#{fn}", "Rakefile"] do |f|
rndr = Redcarpet::Render::HTML.new(:safe_links_only => true)
rndr = HTML.new(:safe_links_only => true)
markdown = Redcarpet::Markdown.new(rndr, :lax_spacing => true, :fenced_code_blocks => true)
markdown_string = File.read("_sinatra/#{fn}.md").encode('UTF-16le', :invalid => :replace, :replace => "").encode("UTF-8")
markdown_string.sub!(/##[^#]*\[Sinatra\]((?!\n#).)+/m, '') # remove ToC
Expand Down
2,002 changes: 858 additions & 1,144 deletions _includes/README.de.html

Large diffs are not rendered by default.

1,914 changes: 822 additions & 1,092 deletions _includes/README.es.html

Large diffs are not rendered by default.

1,904 changes: 819 additions & 1,085 deletions _includes/README.fr.html

Large diffs are not rendered by default.

2,026 changes: 871 additions & 1,155 deletions _includes/README.html

Large diffs are not rendered by default.

588 changes: 252 additions & 336 deletions _includes/README.hu.html

Large diffs are not rendered by default.

Loading

0 comments on commit a15c1ed

Please sign in to comment.