Project

rdoc-babel

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Babel is an RDoc formatter producing HTML documentation. The default template is +ruby-lang+: - Look and feel inspired from https://www.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.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.14
~> 1.10

Runtime

~> 6.3
 Project Readme

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 (in 2010).

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

  • Search boxes for classes and methods.

  • Links to undocumented classes/methods are grayed.

  • Highlights the current file/class/method in the left frame.

  • Highlights the target method, attribute or constant in the main frame.

  • Adds links to ancestor methods/attributes.

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

  • Tested on Firefox 125.
    If using the file:// protocol, the “same origin policy” for local files must be turned off:
    about:config > security.fileuri.strict_origin_policy = false

Synopsis¶ ↑

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

> gem install rdoc-babel
> cd /ruby/src
> rdoc -f babel -a -t "Ruby Core + Stdlib" -o /docs/ruby-core

Using rake:

require 'rdoc/task'

RDoc::Task.new do |t|
  Dir.chdir '/ruby/src'
  rdoc.options <<
    '--format' << 'babel' <<
    '--all'
  t.title = "Ruby Core + Stdlib"
  t.rdoc_dir = '/docs/ruby-core'
end

To make Babel the default format when generating RDoc documentation, define the RDOCOPT environment variable:

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 >= 3.1.0 (may work with >= 2.5.0, but untested)

  • RDoc >= 6.5.0 (may work with >= 5.0, but untested)

Installation¶ ↑

[sudo] gem install rdoc-babel

License¶ ↑

(The MIT License)

Copyright © 2010-2024 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.