From e68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 1 May 2011 13:15:15 +0200 Subject: (temporary hack) generate a main file for RDoc escaping "Rails" RDoc autolinks the word "Rails" to the doc page for the Rails module. But README.rdoc is displayed in the home page at GitHub and the slashes are visible there, which is weird. We leave by now the slashes off in the file, and generate a second file for the API with them. --- Rakefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 607ce01fd0..92b2e77963 100755 --- a/Rakefile +++ b/Rakefile @@ -49,14 +49,24 @@ end desc "Generate documentation for the Rails framework" RDoc::Task.new do |rdoc| + RDOC_MAIN = 'RDOC_MAIN.rdoc' + + rdoc.before_running_rdoc do + rdoc_main = File.read('README.rdoc') + rdoc_main.gsub!(/\b(?=Rails)\b/) { '\\' } + File.open(RDOC_MAIN, 'w') do |f| + f.write(rdoc_main) + end + + rdoc.rdoc_files.include(RDOC_MAIN) + end + rdoc.rdoc_dir = 'doc/rdoc' rdoc.title = "Ruby on Rails Documentation" rdoc.options << '-f' << 'horo' rdoc.options << '-c' << 'utf-8' - rdoc.options << '-m' << 'README.rdoc' - - rdoc.rdoc_files.include('README.rdoc') + rdoc.options << '-m' << RDOC_MAIN rdoc.rdoc_files.include('railties/CHANGELOG') rdoc.rdoc_files.include('railties/MIT-LICENSE') -- cgit v1.2.3