Api.rubyonrails.org sidebar rendering

Just curious, is the code for the site open?

Yes, all is open.

Is it built from the Rails repo?

The content of the API comes from the RDoc documentation written in the source code of Rails itself.

The command to generate the Rails documentation is rake rdoc in the root folder, which is a one liner that delegates the RDoc configuration to these classes.

As @malomalo said, nowadays we use SDoc, and that is where the sidebar issue was fixed.

How do you actually generate edge docs every time there is a push to master? How do you generate docs if there’s a new release? How do you know if the command for Rails 4 was that one or something different (they evolve with time)? All that knowledge and automations is encoded in rails/rails-docs/server.

We have a pure Rack webhook that initiates all this when GitHub triggers it.

So, the process is. A push happens, the webhook is called, the docs server notices it has to build stuff, update the local checkout, generate edge, detect if there is a new stable release tag, in that case generate, and manage a tree of symlinks. All this is programmed in rails/rails-docs-server.

Who hosts it?

I do.

If you sponsor hosting, it is fair to acknowledge so putting a logo or something. I do not want to push a brand in the mind of Rails programmers. To resolve this personal conflict, I decided to pay for the server myself.

This server also runs Rails Contributors.

7 Likes