Ruby and Ruby on Rails offline API documentation [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this questionIn the past I used railsbrain.com to have a nice and handy offline api documentation.
But they stop at version 2.3.2
Is there any other solution with latest version.
Browser-based Solution – Updated Oct 19, 2017
DevDocs (https://devdocs.io/) uses your browser's IndexedDB to store the documentation you want. Make sure you follow the instructions on how to install the docs before you go offline.
For macOS try Dash
For Windows/Linux try Zeal
For packaged HTML try RubyDocs
Manual Download:
I used this commands on my server so I could get the files faster (they were cached, go figure).
wget -r -k -p http://api.rubyonrails.org/
- r - recursive
- k - convert links to point to local files
- p - get all images, etc needed to display the html pages
Then I compress the folder so I can download it without overhead.
rar a -r rails_api.rar api.rubyonrails.org/
- a - add files
- r - recursive
https://gist.github.com/2149669
YARD Server
I prefer the yard format over rdoc.
- Install the gem
gem install yard
, - Regenerate all the documentation
gem rdoc --all --overwrite
, and - Run the server for the gems
yard server --gems
.
railsapi.com. You can build and download a custom package of docs for ruby versions to 1.9, rails to 2.3.5 and a number of gems.
I realize this question is quite old but since it still comes up high in Google when searching for "ruby on rails docs" and several people suggest railsapi.com, which has been down for almost a year.
So I wanted to mention http://rubydocs.org, which has the same functionalities that railsapi.com had and more (generate combined docs of Ruby and Rails with any version you need).
Disclaimer: I built http://rubydocs.org. :)
Within your rails project:
API:
rake doc:rails
Guides:
Add the RedCloth gem to your Gemfile
gem 'RedCloth'
Then
rake doc:guides
Edit (Feb 2016): http://devdocs.io/ looks okay
Just not to pass unmentioned, you can also start local gem rdoc server:
$ gem server
Starting gem server on http://localhost:8808/
localhost - - [13/Mar/2010:18:34:44 CET] "GET / HTTP/1.1" 200 22403
- -> /
But it lacks info on core Ruby library.
I recommend bdoc
. It is a replacement for gem server
that does not require to have a server running and looks much nicer. Just do gem install bdoc; bdoc
or check out more details here. You can find bdoc here.
If you're on a Mac, i've put together a dictionary with Rails 3.0 documentation http://prii.it/blog/rails-3-dictionary-update. I haven't had time to do it for Rails 3 but will do that once i'm in the mood.
Other Rails versions are available too.
I found Aslam's post on this topic to be the most useful, easy to implement answer to this question, and it works for current version of the Rails API and Rails Guides. Thanks to Aslam for putting it together.
Basically, you clone the current Rails git repo to your computer and then run
bundle exec rake rdoc
from within the rails directory.
From there, you can copy the documentation folder to somewhere else on your computer and run locally from a browser.
Aslam's post also shows you how to generate a copy of the Rails Guides.
What about http://railsapi.com/?
If you are on Windows Build your own Ruby and Rails Searchable API Doc post is a good way to generate it.
You can use apidoco
gem. Its easy and simple to use. Got so many flexible features too.
Gem: https://rubygems.org/gems/apidoco/versions/0.1.0
Docs: https://github.com/72pulses/apidoco
Some years ago I used to use FXRI, which was quite cool: http://rubyforge.org/projects/fxri/
Though, I have no idea if it still works or if it plays nice with rvm. I guess it has been abandoned. It is a pity though, it was a very nice tool.
I found this question in a Google search while looking for offline documentation. It did the job but I'm posting this link that currently contains (and makes it easier) all the docs for offline usage for other people who find themselves here. DOCS
精彩评论