Skip to content

thyresias/rdoc-babel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 113 and Chrome 113.

    • If using the file:// protocol, the “same origin policy” for local files must be turned off:

    • Firefox: about:config -> security.fileuri.strict_origin_policy = false

    • Chrome: launch it with chrome --allow-file-access-from-files

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-2023 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.

About

A formatter for RDoc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published