Skip to content

docs(README): fix the example that doesn't work #1325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ To generate documentation programmatically:
gem 'rdoc'
require 'rdoc/rdoc'

options = RDoc::Options.new
# see RDoc::Options

rdoc = RDoc::RDoc.new
rdoc.document options
rdoc.document([]) # This generates documentation for all files in the current directory
Copy link
Member

@tompng tompng Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this?

options = RDoc::Options.new
options.files = ['./a.rb', './b.rb']
options.setup_generator 'darkfish'
# see RDoc::Options for more setups

rdoc = RDoc::RDoc.new
rdoc.document options

Some example of options setups are in TestRDocRDoc#test_document

# see RDoc::RDoc

You can specify the target files for document generation with +.document+ file in the project root directory.
Expand Down
Loading