aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-05-01 13:15:15 +0200
committerXavier Noria <fxn@hashref.com>2011-05-01 13:15:15 +0200
commite68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6 (patch)
tree673efed109f9fd63a54bb7a22bb09eda838fc0ff /Rakefile
parent2fbf302149cf40c791ca1207a5f984cf58903397 (diff)
downloadrails-e68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6.tar.gz
rails-e68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6.tar.bz2
rails-e68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6.zip
(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.
Diffstat (limited to 'Rakefile')
-rwxr-xr-xRakefile16
1 files changed, 13 insertions, 3 deletions
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')