Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A formatter for RDoc

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .autotest
Octocat-spinner-32 .gitignore
Octocat-spinner-32 HISTORY.rdoc
Octocat-spinner-32 Manifest.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
README.rdoc

Babel

Description

Babel is an RDoc formatter producing HTML documentation. The default template is ruby-lang.

You are welcome to propose changes or enhancements, and to contribute alternate templates or style sheets.

Features of the “ruby-lang” template

  • Look and feel inspired from ruby-lang.org.

  • Dual-frame output, with indexes on the left.

  • Search boxes for classes and methods.

  • Links to undocumented classes/methods are grayed.

  • Highlights target methods, attributes and constants.

  • Adds links to ancestor methods/attributes.

  • Borrows some ideas (and one icon) from Darkfish.

  • Tested on Firefox 3.5 & 5, Chrome 9 & 12, Safari 4 & 5.

Synopsis

To output documentation formatted by Babel, use the --format/-f RDoc switch. For instance, to generate the documentation for Ruby core:

$ gem install rdoc-babel
$ cd ~/.rvm/src/ruby-1.8.7-p302
$ rdoc -f babel -a -t "Ruby 1.8.7 Core" -o ~/docs/ruby_core_187 *.c

Using rake:

require 'rdoc/task'

RDoc::Task.new do |t|
  Dir.chdir '~/.rvm/src/ruby-1.9.2-p0'
  rdoc.options <<
    '--format' << 'babel' <<
    '--all'
  t.title = "Ruby 1.9.2 Core"
  t.rdoc_dir = '~/docs/ruby_core_192'
  t.rdoc_files.concat Dir['*.c']
end

To make Babel the default format when generating RDoc documentation, define the RDOCOPT environment variable in the appropriate file (e.g., ~/.bashrc):

export RDOCOPT="--format babel"

Specific options

Babel supports specific options in addition to the standard RDoc options:

--style url, -s

Specifies the URL of a stylesheet that the template should use. The default is “rdoc.css”.

--see-standard-ancestors

Add links to Kernel/Object ancestor methods.

When a method or attribute is defined in a class/module, and is also present in an ancestor, Babel adds a link to the ancestor method/attribute in the description (“See also …”). Unless this option is specified, this annotation is not generated for Object and Kernel ancestor methods.

Requirements

  • Ruby >= 1.8.7

  • RDoc >= 3.0

Installation

[sudo] gem install rdoc-babel

License

(The MIT License)

Copyright © 2010 Thierry Lambert

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.