January 2024
Intermediate to advanced
718 pages
20h 15m
English
RDoc does two jobs. Its first job is to analyze source files. Ruby files, of course, but it will also analyze C files and Markdown files. Within those files, RDoc looks for information to document. Its second job is to take this information and convert it into something readable—usually HTML or Ruby’s ri documentation format.
Let’s look at an example.
| | class Counter |
| | attr_reader :counter |
| | |
| | def initialize(initial_value = 0) |
| | @counter = initial_value |
| | end |
| | |
| | def inc |
| | @counter += 1 |
| | end |
| | end |
Going into that directory and running rdoc will create an entire doc directory with HTML files.
Here’s what one of the files looks like:
Even though the source contains no internal documentation, ...
Read now
Unlock full access