| |||
Previous < | Contents ^ |
Next > |
Figure not available... |
Figure not available... |
rdtool
, a Ruby utility suite that converts this documentation into a variety of output formats.
rdtool
scans a file for =begin
and =end
{=begin...=end@
{=begin pairs, and extracts the text between them all. This text is assumed to be documentation in RD format. The text is then processed according to a simple set of rules:
= Top Level Heading == Second Level Heading ... |
This is normal text * start of a multiline bullet item * and another * nested item * second nested * third item at top level |
(1) A numbered item * subitem in a bulleted list * subitem (2) Second numbered item (9) This will actually be labeled '3.' |
: red when the light is red, you must stop : amber the amber light means that things are about to change. Either: * step on the gas, or * slam on the brakes : green green means GO |
Sequence | Example | Intended Use | ||||||
((*emphasis*)) | emphasis | Emphasis (normally italic) | ||||||
(({code stuff})) | code stuff |
Code | ||||||
((|variable|)) | variable | Variable name | ||||||
((%type me%)) | type me |
Keyboard input | ||||||
((:index term:)) | index term | Something to be indexed | ||||||
((<reference>)) | reference | Hyperlink reference | ||||||
((-footnote-)) | text.4 | Footnote text. A reference is placed inline, and the text of the footnote appears at the bottom of the page. | ||||||
(('verb')) | verb | Verbatim text | ||||||
((<...>))
construct.
= Synopsis ... See ((<Return Codes>)) for details. .. == Instance Methods --- Tempfile.open( filename ) Opens the file... == Return Codes .. The method ((<Tempfile.open>)) raises an (({IOException}))... |
rdtool
attempts to format it as an external hyperlink.
The reference ((<display part|label>))
generates a link to label
but places the text ``display part'' in the output document. This is used in the description section of the example in Figure A.1 on page 512 to generate references to the method names:
perspective, apart from the unusual ((<(({new}))|Tempfile.new>)), ... |
Tempfile.new
.
rdtool
makes certain assumptions about the format of method names. Class or module methods should appear as Class.method
, instance methods as Class#method
, and class or module constants as Class::Const
.
--- Tempfile::IOWRITE Open the file write-only. ... --- Tempfile.new( filename ) Constructs a temporary file in the given directory. The file ... --- Tempfile#open Reopens ((|aTempfile|)) using mode ``r+'', which allows reading .. |
<<< filename |
.rd
or .rb
extension, it will be interpreted as RD documentation.
If the filename has no extension, rdtool
will look for a file with an extension that matches the type of output being produced (.html
for HTML files, .man
for man files, and so on) and interpolate that file's contents in the output
stream. Thus, a line such as:
<<< header |
.rd
). These files are processed using the rd2
command to produce appropriately formatted output.
rd2 [ options ] inputfile [ >outputfile ] |
-r format |
Select an output format. -rrd/rd2html-lib.rb produces HTML output (the default). -rrd/rd2man-lib.rb produces Unix man page output. |
-o name |
Set the base part of the output filename. |
--help |
List the full set of options. |
rdtool
are undergoing continuous development. It is likely that some of the details we give here will be out of date (or just plain wrong) by the time you read this.
Included with the rdtool
distribution is the file README.rd
. We suggest you do so, as it will give you the current scoop on producing Ruby documentation.
Previous < | Contents ^ |
Next > |