Rails API Documentation

Hi --

In my opinion there is no good online version of the Rails API Documentation.

So I have been considering creating one myself. With that in mind I thought it'd be wise to ask people two things:

a) Do you agree there is no good version?

No.

b) What are the things that would make a really good version?

Apparently I don't know :slight_smile: It's possible that there are things an online version could do that I've never thought of, and that I'd find useful if I saw them. I've always found api.rubyonrails.org pretty complete and easily navigable.

David

A smarter source browser would be nice, especially when trying to understand the internals of Rails, as would a smarter search. I've been running my own local Ferret app to do doc searching, so I rarely use the API searches on there unless I don't want to spend the time to open a terminal up. :wink:

--Jeremy

Hi,

it is quite difficult to define what is lacking in documentation, until the time comes when one is trying to get something to work and cant figure out how to do it. Having now been learning Rails (and Ruby) for several months, and not coming from a strong web programming background, I will try to say what I have found most difficult.

The whole subject of Rails, covers an enormous breadth, and to the newcomer, it is difficult to know how to drill into it. The various tutorials around the web cover the basics of creating a simple app, but when it comes to wanting to do specific things it is difficult to know how to get at the information you want. It is almost always out there somewhere, but it involves picking up bits and pieces from the forums, tutorials, manual, wiki and api.

I think that the problems I have faced have been 2 sided. On the one front, when I find a method that appears to do what I want (particularly with some of the helpers), it is not always clear how to use it. The explanation is just that bit lacking. It is fine when you know what it does, but getting there in the first place takes too long. Often just a few more words would clarify how they work, particularly with respect to the argument lists.

On the other front, is the difficult problem of "I know there is a method that does just what I want, but I cant remember what it is called - eg. was it pluralise, capitalise, humanise? just what was that method that changes to this_case to ThisCase. Some of these are difficult to put into meaningful phrases so even google does not always help. Perhaps it's not actually in Rails, but in Ruby I should be looking.

There are lots of cheat sheets around, but invariably what I am looking for is not in them.

There is no doubt the the Agile Rails book is incredibly useful, but sometimes even using that it has taken ages to find the specific thing I am looking for.

I really dont know if any of this helps, but perhaps it sumarises as:

1. Improved explanations 2. more simple/short examples 3. consolidation of all of the resources 4. Indexing/cross referencing/searchability

The php manual is pretty good it is quite well structured and indexed, functions/methods are described and the comments added by the community serve to provide examples and clarifications.

I appreciate that php is a language and Rails is a framework and that in itself is another problem.

BTW, wasn't there an initiative a while ago to take on a professional full time documentation person. If someone has been looking at this now for quite a few weeks, perhaps some ideas and approaches may be developing. One danger I can see is for various different versions of documentation to appear on different sites. It is already difficult enough to remember where I saw a particular bit of information, but if several sites pop up trying to document Rails in different ways, it could become a greater problem.

Tonypm

Wasn't there some fund raiser for documentation?

Yes, and you can read more about it here: http://blog.caboo.se/articles/2006/12/27/update-on-the-documentation-project#comments

Basically, no one up to their standards wants to do it/has time to do it. It's understandable that they want someone capable to do it, but I think maybe they need to take someone who's passionate about it, let them do it, and let them be overseen by a "published author" rather than expecting a published author to do it (especially since most of them are probably working on other books, teaching, or, like, working on software or something ;)).

Another option would be to open it up to the community, let them write it, and have that overseen by a panel of authors that proofread, edit, fill out, or otherwise mangle the text into a usable form. I'd be willing to contribute.

But, hey, they're the ones with the money. :slight_smile:

--Jeremy

It really sounds like they are expecting Dave Thomas or David Black to step up and take charge of the project. I think anyone who is as talented as guys of that caliiber already have more then their share of work. The caboose guys just need to hire someone who is passionate and smart but also new enough where he isn't overloaded with consulting/writing/etc. I think once they get an actual deliverable up and on the web, more help will come as it won't be a giant empty project with no results.

IOW, just get started with something crappy, then worry about making it really good =).

- Rob

I agree with a previous poster who stated that the lack of examples and further explanations on some methods is a roadblock. I often find myself experimenting with a method simply because the explanation in the Rails API is unclear or the examples are incomplete, or certain method parameters are not explained. Of course I don’t expect the Rails core team to spend their time writing docs. That is why I think that the approach taken by railsmanual.org and railsapi.org is the way to go - have it be a community-driven effort, with an editor approving content in order to make sure that it’s accurate (that could also be done by peer review if the website had that ability built-in; ie, 2 other registered users have to vet a comment or example before it is approved). It’s a pity though that efforts are being divided with some people adding comments/examples to railsmanual, others to railsapi, yet others to tho caboo.se effort. It would be helpful if the Rails community united behind a single site that became “the standard” that everyone contributed to. Not to put down the various efforts that have been made–they’re great, but it seems we need an “opinionated” approach to the documentation. Maybe if DHH or the Rails Core team, or a group of Ruby/Rails heavyweights like Dave Black, Dave Thomas and others, gave their blessing to a particular site and urged the community to contribute, we’d see faster progress.

We have/had a wiki for Rails, but it was so overrun with spam and junk that it's (mostly) useless now.

I was thinking more along the lines of a panel of authors construct a TOC or structure the APIs in such a way that is logical, then users sign up for or submit pieces of text and the authors finesse that data into a very fine manual.

But I'm not sure how the caboose folks are planning on doing it.

--Jeremy

One step ahead of ya:

http://en.wikibooks.org/wiki/Ruby_on_Rails

Feel free to contribute.

V/r Anthony

A concept I just came up with which may work really well is to have a user/member only wiki with open comments.

So anyone can create an account for the wiki (with email verified) and once they have, they can create new pages. Once the page has been created, users can submit comments to the page similar to the PHP.net.

It would be a combo of a wiki with comments.

I really like the setup railsmanual.org has which I maintain that is based on the Rannotate RDOC enhancements, but it's still nowhere near as slick and user friendly as the PHP.net system.

One other thing I seen on the PHP.net docs is it's got alot of introduction pages, in addition to the functional reference.

Jeremy, you up for working together to join forces and architect the best doc system in the universe? :slight_smile:

Nathaniel.

I've been in correspondence with Courtenay about the caboo.se project. I'm happy to sign up and spend some time on this because it will be of so much benefit to so many people. My reluctance (and possibly a concern of others) relates to working on Yet Another Rails Documentation project. As has been noted in this thread, a great deal of good information *exists*, but it is not coalesced in one single location.

If we were able to settle on a single project and put all the community's weight behind that, it would be more likely to succeed. Because of the support the caboo.se project has received thus far, they might be a logical choice.

So, here's my vote: Let's nominate the caboo.se project as the "official" Rails documentation project!

Anyone care to second that?

Steve

A concept I just came up with which may work really well is to have a user/member only wiki with open comments.

So anyone can create an account for the wiki (with email verified) and once they have, they can create new pages. Once the page has been created, users can submit comments to the page similar to the PHP.net.

It would be a combo of a wiki with comments.

I really like the setup railsmanual.org has which I maintain that is based on the Rannotate RDOC enhancements, but it's still nowhere near as slick and user friendly as the PHP.net system.

One other thing I seen on the PHP.net docs is it's got alot of introduction pages, in addition to the functional reference.

Jeremy, you up for working together to join forces and architect the best doc system in the universe? :slight_smile:

Nathaniel.

s.ross wrote:

I've been in correspondence with Courtenay about the caboo.se project. I'm happy to sign up and spend some time on this because it will be of so much benefit to so many people. My reluctance (and possibly a concern of others) relates to working on Yet Another Rails Documentation project. As has been noted in this thread, a great deal of good information *exists*, but it is not coalesced in one single location.

If we were able to settle on a single project and put all the community's weight behind that, it would be more likely to succeed. Because of the support the caboo.se project has received thus far, they might be a logical choice.

So, here's my vote: Let's nominate the caboo.se project as the "official" Rails documentation project!

Anyone care to second that?

I agree that it would be nice if there was just one API/documentation project everybody was contributing too. However caboo.se isn't working for me. E.g. type in "paginator" or "pagination" as a search in caboo.se and compare that with what you get back in railsmanual.org.

I think searchability and presentation are issues, but I don't agree that the *current* state of any of these implementations is how they will stabilize. If you go to railsmanual.org, you will get stray hits and no characterization of the information you will find when you receive your list of links to "paginator" or "pagination".

My belief is that if the Rails community throws its support behind one option, people will do what it takes to make that option reflective of the overall quality of the framework. At least, that's my hope. So, in my mind, the real challenge to the community is to make a decision (among a significant number of people) and then support it.

Steve

Michael Wang-5 wrote:

Hi guys, I'd like to clarify a few things, and ask for help.

Firstly, the railsmanual site just draws from the rdoc source code, which is to say, the comments embedded within the Rails source. So the interface or searching thereof is open to much interpretation.

That being said, the "caboose documentation" is not about the presentation of the API, or its searchability, but rather, the raw information within. The documentation hosted on caboo.se is actually not part of this; it's a special version of the docs with a lot of exposed private methods, for advanced developers to use as a reference.

The "caboose documentation project" is a fund that has been set up to provide cash for well-written Rails documentation, as an incentive. There are a few steps to this project, and we've been gathering ideas on a wiki http://caboose.stikipad.com/documentation. Basically, it can be summarized like

- better API docs, in-code comments - more examples - recipes, or task-oriented guides with links into the API

Currently, we are working on an application that makes it easy to modify and annotate as you browse the API, thereby making it easier for everyone to contribute to improving the docs. We're aiming to have it automatically post to the official Trac, so that rails-core can integrate documentation fixes easily. If you can help with this let me know, we're unable to get it working right now.

I've created a google-group for the doc project, so you can take your ideas there. http://groups-beta.google.com/group/rubyonrails-documentation

Ideally, as you find documentation that is lacking, or have an idea where more examples or fixup is required, post to that group, and we can assign it to someone to write.

We would greatly appreciate everyone's input!

Courtenay caboo.se