README.org

Path: README.org
Last Update: Wed Nov 02 17:10:24 JST 2005

RDOC - Ruby Documentation System

Annotation

This is copy from RDOC original README

See README.ja (Sorry, JAPANESE only)

Overview

This package contains Rdoc and SimpleMarkup. Rdoc is an application that produces documentation for one or more Ruby source files. We work similarly to JavaDoc, parsing the source, and extracting the definition for classes, modules, and methods (along with includes and requires). We associate with these optional documentation contained in the immediately preceding comment block, and then render the result using a pluggable output formatter. (Currently, HTML is the only supported format. Markup is a library that converts plain text into various output formats. The Markup library is used to interpret the comment blocks that Rdoc uses to document methods, classes, and so on.

This library contains two packages, rdoc itself and a text markup library, ‘markup’.

Roadmap

  • If you want to use Rdoc to create documentation for your Ruby source files, read on.
  • If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
  • For information on the various markups available in comment blocks, see markup/simple_markup.rb.
  • If you want to drive Rdoc programatically, see RDoc::RDoc.
  • If you want to use the library to format text blocks into HTML, have a look at SM::SimpleMarkup.
  • If you want to try writing your own HTML output template, see RDoc::Page.

Summary

Once installed, you can create documentation using the ‘rdoc’ command (the command is ‘rdoc.bat’ under Windows)

  % rdoc [options]  [names...]

Type "rdoc —help" for an up-to-date option summary.

A typical use might be to generate documentation for a package of Ruby source (such as rdoc itself).

  % rdoc

This command generates documentation for all the Ruby and C source files in and below the current directory. These will be stored in a documentation tree starting in the subdirectory ‘doc’.

You can make this slightly more useful for your readers by having the index page contain the documentation for the primary file. In our case, we could type

  % rdoc --main rdoc/rdoc.rb

You‘ll find information on the various formatting tricks you can use in comment blocks in the documentation this generates.

RDoc uses file extensions to determine how to process each file. File names ending .rb and .rbw are assumed to be Ruby source. Files ending .c are parsed as C files. All other files are assumed to contain just SimpleMarkup-style markup (with or without leading ’#’ comment markers). If directory names are passed to RDoc, they are scanned recursively for C and Ruby source files only.

Credits

  • The Ruby parser in rdoc/parse.rb is based heavily on the outstanding work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby parser for irb and the rtags package.
  • Code to diagram classes and modules was written by Sergey A Yanovitsky (Jah) of Enticla.
  • Charset patch from MoonWolf.
  • Rich Kilmer wrote the kilmer.rb output template.
  • Dan Brickley led the design of the RDF format.

License

RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It is free software, and may be redistributed under the terms specified in the README file of the Ruby distribution.

[Validate]