Skip to content

Commit cd7cc52

Browse files
committed
Remove documentation tasks
This patch removes the tasks doc:app, doc:rails, and doc:guides. In our experience applications do not generate APIs using doc:app. Methods may be certainly documented for maintainers, annotated with YARD tags, etc. but that is intended to be read with the source code, not in a separate website. Then, teams also have typically selected topics written down in Markdown files, or in a GitHub wiki... that kind of thing. If a team absolutely needs to generate application documentation for internal purposes, they can still easily write their own task. Regarding doc:rails and doc:guides, we live in 2015. We are used to go to online docs all the time. If you really want access to the API offline RubyGems generates it for every Rails component unless you tell it not to, and you can checkout the Rails source code to read the guides as Markdown, or download them for a Kindle reader. All in all, maintaining this code does not seem to be worthwhile anymore. As a consequence of this, guides (+3 MB uncompressed) won't be distributed with the rails gem anymore. Of course, guides and API are going to be still part of releases, since documentation is maintained alongside code and tests. Also, time permitting, this will allow us to experiment with novel ways to generate documentation in the Rails docs server, since right now we were constrained by being able to generate them in the user's environment.
1 parent 8c752c7 commit cd7cc52

File tree

9 files changed

+5
-121
lines changed

9 files changed

+5
-121
lines changed

guides/source/command_line.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,6 @@ The most common tasks of the `db:` Rake namespace are `migrate` and `create`, an
419419
420420
More information about migrations can be found in the [Migrations](migrations.html) guide.
421421
422-
### `doc`
423-
424-
The `doc:` namespace has the tools to generate documentation for your app, API documentation, guides. Documentation can also be stripped which is mainly useful for slimming your codebase, like if you're writing a Rails application for an embedded platform.
425-
426-
* `rake doc:app` generates documentation for your application in `doc/app`.
427-
* `rake doc:guides` generates Rails guides in `doc/guides`.
428-
* `rake doc:rails` generates API documentation for Rails in `doc/api`.
429-
430422
### `notes`
431423
432424
`rake notes` will search through your code for comments beginning with FIXME, OPTIMIZE or TODO. The search is done in files with extension `.builder`, `.rb`, `.rake`, `.yml`, `.yaml`, `.ruby`, `.css`, `.js` and `.erb` for both default and custom annotations.

guides/source/getting_started.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,19 +2054,6 @@ resources:
20542054
* The [Ruby on Rails mailing list](http://groups.google.com/group/rubyonrails-talk)
20552055
* The [#rubyonrails](irc://irc.freenode.net/#rubyonrails) channel on irc.freenode.net
20562056

2057-
Rails also comes with built-in help that you can generate using the rake
2058-
command-line utility:
2059-
2060-
* Running `rake doc:guides` will put a full copy of the Rails Guides in the
2061-
`doc/guides` folder of your application. Open `doc/guides/index.html` in your
2062-
web browser to explore the Guides.
2063-
* Running `rake doc:rails` will put a full copy of the API documentation for
2064-
Rails in the `doc/api` folder of your application. Open `doc/api/index.html`
2065-
in your web browser to explore the API documentation.
2066-
2067-
TIP: To be able to generate the Rails Guides locally with the `doc:guides` rake
2068-
task you need to install the Redcarpet and Nokogiri gems. Add it to your `Gemfile` and run
2069-
`bundle install` and you're ready to go.
20702057

20712058
Configuration Gotchas
20722059
---------------------

rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
1616
s.email = 'david@loudthinking.com'
1717
s.homepage = 'http://www.rubyonrails.org'
1818

19-
s.files = ['README.md'] + Dir['guides/**/*'] - Dir['guides/output/**/*']
19+
s.files = ['README.md']
2020

2121
s.add_dependency 'activesupport', version
2222
s.add_dependency 'actionpack', version

railties/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove the documentation tasks `doc:app`, `doc:rails`, and `doc:guides`.
2+
3+
*Xavier Noria*
4+
15
* Force generated routes to be inserted into routes.rb
26

37
*Andrew White*

railties/lib/rails/api/task.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,5 @@ def rails_version
152152
File.read('RAILS_VERSION').strip
153153
end
154154
end
155-
156-
class AppTask < Task
157-
def component_root_dir(gem_name)
158-
$:.grep(%r{#{gem_name}[\w.-]*/lib\z}).first[0..-5]
159-
end
160-
161-
def api_dir
162-
'doc/api'
163-
end
164-
165-
def rails_version
166-
Rails::VERSION::STRING
167-
end
168-
end
169155
end
170156
end

railties/lib/rails/generators/app_base.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def gemfile_entries
113113
assets_gemfile_entry,
114114
javascript_gemfile_entry,
115115
jbuilder_gemfile_entry,
116-
sdoc_gemfile_entry,
117116
psych_gemfile_entry,
118117
@extra_entries].flatten.find_all(&@gem_filter)
119118
end
@@ -265,11 +264,6 @@ def jbuilder_gemfile_entry
265264
GemfileEntry.version('jbuilder', '~> 2.0', comment)
266265
end
267266

268-
def sdoc_gemfile_entry
269-
comment = 'bundle exec rake doc:rails generates the API under doc/api.'
270-
GemfileEntry.new('sdoc', '~> 0.4.0', comment, group: :doc)
271-
end
272-
273267
def coffee_gemfile_entry
274268
comment = 'Use CoffeeScript for .coffee assets and views'
275269
if options.dev? || options.edge?

railties/lib/rails/generators/rails/app/templates/README.rdoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ Things you may want to cover:
2222
* Deployment instructions
2323

2424
* ...
25-
26-
27-
Please feel free to use a different markup language if you do not plan to run
28-
<tt>rake doc:app</tt>.

railties/lib/rails/tasks/documentation.rake

Lines changed: 0 additions & 70 deletions
This file was deleted.

railties/test/generators/app_generator_test.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,6 @@ def test_inclusion_of_method_source
417417
end
418418
end
419419

420-
def test_inclusion_of_doc
421-
run_generator
422-
assert_file 'Gemfile', /gem 'sdoc',\s+'~> 0.4.0',\s+group: :doc/
423-
end
424-
425420
def test_template_from_dir_pwd
426421
FileUtils.cd(Rails.root)
427422
assert_match(/It works from file!/, run_generator([destination_root, "-m", "lib/template.rb"]))

0 commit comments

Comments
 (0)