From: trans Date: 2009-10-02T03:01:08+09:00 Subject: Re: Making an RDoc Template Gem On Oct 1, 1:32 pm, Gordon Thiesfeld wrote: > 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 Ha! You must have wrote your response the same time I was writing mine! Go figure! :) > Hope that makes sense. It does make sense. Thank You! > [1]https://github.com/vertiginous/rdoc_chm Ah, that makes all the difference. I got pretty close figuring it out my own. This will help me tweak my code to get it exact. Big thanks again.