Pretty Docs for Rubygems

| Comments

Tip I got through my colleague Bart Duchesne: to have nicer templates for the rubygem documentation, you can use templates.
Mislav’s Hanna templates are pretty decent (way better than the default ones anyway) – there are other options if you look around.

Howto (updated from this site):

* gem install hanna

* follow the instructions given [here](http://github.com/mislav/hanna) - best to put following line in your .gemrc
rdoc: --inline-source --line-numbers --format=html --template=hanna

* to regenerate all rdoc    sudo gem rdoc --all --no-ri

* install the sinatra-rubygems (after having installed sinatra - gem install sinatra - if you haven't got it already)    git clone git://github.com/jseifer/sinatra-rubygems.git

It’s a web application (duh) so keep this in mind in choosing where you want to clone it

  1. point your apache+passenger (replace by suitable web server) to directory/sinatra-rubygems/public

    (and give it its own port, of course)

  2. bookmark the link in the toolbar of your favourite browser

    1. Update: rather than using apache and sinatra, you could also install bdoc sudo gem install bdoc

    2. no extra web servers needed ! and build the necessary index typing bdoc

    this will start up the index in the default browser, and the UI is even nicer (thanks to Josh Kim for the tip) doesn’t seem to work under ubuntu, I’ll see if I can fix it

You can add a cherry on top by also doing the same for your ruby, by fooling your system into thinking it’s also a gem.

They say laziness is a virtue in programmers: voila, you have your ruby documentation just a click away, and offline too.