From: Gordon Thiesfeld Date: 2009-10-02T02:32:14+09:00 Subject: Re: Making an RDoc Template Gem On Wed, Sep 30, 2009 at 11:53 PM, Intransition wrote: > I want to create a new RDoc template and I want to ship it as a gem. > But I cannot figure out how to set it up so RDoc will find it. For > that matter I'm not exactly sure what kind of file it's wants either. > Is there any documentation on this anywhere? > > Thanks. > > I think the best way to do it is as an rdoc plugin. RDoc_chm[1] is an RDoc plugin to. RDoc searches for lib/rdoc/discover.rb in gems, and loads them. You have to have a require in discover.rb. This will add your gem's lib and bin to $LOAD_PATH. I'm not totally sure how that works, if it's a feature of RubyGems, or RDoc. If you have no ruby code in your template, you can just use "require 'rdoc/discover'". The Darkfish generator searches for a template dir of the name provided on the command line. If no template is given, it defaults to the name of the generator. Say your template is called macguffin, you'd put your template code in lib/rdoc/generator/template/macguffin. When rdoc is run with --template=macguffin, it will search each dir in $LOAD_PATH for dir + /rdoc/generator/template/macguffin Hope that makes sense. [1] https://github.com/vertiginous/rdoc_chm