Permalink
Browse files

Add all README translations to website.

  • Loading branch information...
rkh committed Oct 12, 2010
1 parent 4ca6788 commit 4b2600d9e6ec66758c80092144ad0b47e7e1ac8b
Showing with 4,019 additions and 29 deletions.
  1. +19 −21 Rakefile
  2. +1,092 −0 _includes/README.de.html
  3. +1,325 −0 _includes/README.es.html
  4. +1,292 −0 _includes/README.fr.html
  5. +223 −4 _includes/README.html
  6. +19 −3 _includes/README.jp.html
  7. +14 −0 intro-de.html
  8. +14 −0 intro-es.html
  9. +14 −0 intro-fr.html
  10. +4 −1 intro-jp.html
  11. +3 −0 intro.html
View
@@ -1,16 +1,20 @@
require 'rake/clean'
require 'rdoc/markup/to_html'
+def readme(pattern = "%s", &block)
+ return readme(pattern).each(&block) if block_given?
+ %w[en de es fr jp].map do |lang|
+ pattern % "README#{lang == "en" ? "" : ".#{lang}"}"
+ end
+end
+
task :default => ['_sinatra', :build]
desc "Build outdated static files and API docs"
task :build => ['build:static']
desc "Build outdated static files"
-task 'build:static' => [
- '_includes/README.html',
- '_includes/README.jp.html'
-]
+task 'build:static' => readme("_includes/%s.html")
desc "Build anything that's outdated and stage changes for next commit"
task :regen => [:build] do
@@ -36,25 +40,19 @@ end
file('_sinatra') { Rake::Task['pull:sinatra'].invoke }
CLOBBER.include '_sinatra'
-%w[README.rdoc README.jp.rdoc AUTHORS].each do |fn|
- file "_sinatra/#{fn}" => ['_sinatra']
-end
+readme("_sinatra/%s.rdoc") { |fn| file fn => '_sinatra' }
+file 'AUTHORS' => '_sinatra'
-# Build _includes/README.html from RDoc
-file '_includes/README.html' => ['_sinatra/README.rdoc', 'Rakefile'] do |f|
- html = RDoc::Markup::ToHtml.new.convert(File.read("_sinatra/README.rdoc")).
- sub("<h1>Sinatra</h1>", "")
- File.open(f.name, 'wb') { |io| io.write(html) }
-end
-CLEAN.include '_includes/README.html'
-
-# Build _includes/README.jp.html from RDoc
-file '_includes/README.jp.html' => ['_sinatra/README.jp.rdoc', 'Rakefile'] do |f|
- html = RDoc::Markup::ToHtml.new.convert(File.read("_sinatra/README.jp.rdoc")).
- sub("<h1>Sinatra</h1>", "")
- File.open(f.name, 'wb') { |io| io.write(html) }
+readme do |fn|
+ file "_includes/#{fn}.html" => ["_sinatra/#{fn}.rdoc", "Rakefile"] do |f|
+ html =
+ RDoc::Markup::ToHtml.new.
+ convert(File.read("_sinatra/#{fn}.rdoc")).
+ sub("<h1>Sinatra</h1>", "")
+ File.open(f.name, 'wb') { |io| io.write(html) }
+ end
+ CLEAN.include "_includes/#{fn}.html"
end
-CLEAN.include '_includes/README.jp.html'
desc 'Rebuild site under _site with Jekyll'
task :jekyll do
Oops, something went wrong.

0 comments on commit 4b2600d

Please sign in to comment.