aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--.gitignore1
-rw-r--r--README.rdoc16
-rwxr-xr-xRakefile16
3 files changed, 22 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 8daa1e4dcd..be764143aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,4 @@ railties/doc
railties/guides/output
railties/tmp
.rvmrc
+RDOC_MAIN.rdoc \ No newline at end of file
diff --git a/README.rdoc b/README.rdoc
index 216a122c66..143fdfeb75 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -1,6 +1,6 @@
-== Welcome to \Rails
+== Welcome to Rails
-\Rails is a web-application framework that includes everything needed to create
+Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb"
@@ -11,7 +11,7 @@ persist themselves to a database. The controller handles the incoming requests
(such as Save New Account, Update Product, Show Post) by manipulating the model
and directing data to the view.
-In \Rails, the model is handled by what's called an object-relational mapping
+In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in its
@@ -22,17 +22,17 @@ layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
-\Rails. You can read more about Action Pack in its
+Rails. You can read more about Action Pack in its
{README}[link:files/actionpack/README_rdoc.html].
== Getting Started
-1. Install \Rails at the command prompt if you haven't yet:
+1. Install Rails at the command prompt if you haven't yet:
gem install rails
-2. At the command prompt, create a new \Rails application:
+2. At the command prompt, create a new Rails application:
rails new myapp
@@ -59,10 +59,10 @@ more separate. Each of these packages can be used independently outside of
== Contributing
-We encourage you to contribute to Ruby on \Rails! Please check out the {Contributing to Rails
+We encourage you to contribute to Ruby on Rails! Please check out the {Contributing to Rails
guide}[http://edgeguides.rubyonrails.org/contributing_to_rails.html] for guidelines about how
to proceed. {Join us}[http://contributors.rubyonrails.org]!
== License
-Ruby on \Rails is released under the MIT license.
+Ruby on Rails is released under the MIT license.
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')