rdoc-generator-mdoc
An experimental mdoc(7) generator for RDoc.
The generator outputs one man page per Ruby module, class and method in mdoc(7) format.
Installation
Install rdoc-generator-mdoc
using RubyGems:
$ gem install rdoc-generator-mdoc
You can also use Bundler to install rdoc-generator-mdoc
by adding
this line to your Gemfile
:
gem "rdoc-generator-mdoc"
Then run the bundle
command:
$ bundle
Usage
In your Ruby source code
Specify mdoc
as the formatter using the -f
option when calling
RDoc::RDoc#new
:
require "rdoc/generator/mdoc"
RDoc::RDoc.new.document "-f mdoc"
Since RDoc is often used to document Ruby libraries and section 3 of the Unix
manual generally contains library documentation, the mdoc generator will assign
the generated man pages to section 3-rdoc
by default. If you want the man
pages to be assigned to a different section, specify the section using the
--section
option:
RDoc::RDoc.new.document "-f mdoc --section 3-my-section"
For more information on using the RDoc::RDoc
class see the official RDoc
documentation. For more information on manual sections see
man(1).
Using the rdoc
executable
Specify mdoc
as the formatter using the -f
option:
$ rdoc -f mdoc
Since RDoc is often used to document Ruby libraries and section 3 of the Unix
manual generally contains library documentation, the mdoc generator will assign
the generated man pages to section 3-rdoc
by default. If you want the man
pages to be assigned to a different section, specify the section using the
--section
option:
$ rdoc -f mdoc --section 3-my-section
For more information on manual sections see man(1).
Reading generated man pages
The generated man pages are viewable directly using man -l FILE
or
using man [SECTION] PAGE
after putting them in a directory on the $MANPATH
(see man(1) for details).
Copyright
Copyright (c) 2014 Calle Erlandsson & thoughtbot, Inc.
Lead by Calle Erlandsson & thoughtbot, Inc.