Skip to content

Commit

Permalink
(temporary hack) generate a main file for RDoc escaping "Rails"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fxn committed May 1, 2011
1 parent 2fbf302 commit e68b7a0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ railties/doc
railties/guides/output
railties/tmp
.rvmrc
RDOC_MAIN.rdoc
16 changes: 8 additions & 8 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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.
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e68b7a0

Please sign in to comment.