From: Chi-BiN H. <chi...@gm...> - 2009-01-22 10:24:28
|
Hi Matt, Thanks for your help agagin! The filter works, Great!! Now another situation that get me troubled: I include some modules into a template, then I run "r3 generate ...". yes, the filter works. But the genfilter_OutputFilter::output() was been called to each module, that's not what I wanted. I wanted the filter be effectived on the main template but not the modules. If you can give me some advise it will be more helpful. Thanks and regards, -- Chi-BiN Hsiao On 1/22/09, Matt Zandstra <zan...@ya...> wrote: > Hi > > Yes, we don't have adequate documentation for either building plugins or > exploiting the r3 API. We will try to put that right soon. > > In the meantime, the attached archive contains what stickleback calls a > pluginset directory. > > The included plugin, OutputGenObserver.php, extends the > GenObserverManager host. It can be notified of all sorts of generation > events, but only implements a method invoked as targets are generated. > > The method checks for > > <user> > <filteroutput>yes</filteroutput> > </user> > > in the configuration file in order to operate. > > Also included in the pluginset is a class file: OutputFilter.php. This > wraps whatever output handler is nominated by the CLI or GUI. You can > amend genfilter_OutputFilter::output() in order to filter the generated > text -- at the moment it simply adds some characters. > > To try this out, unpack the archive and put the genfilter directory into > $R3HOME/plugins/ > > By default nothing will happen. Once you've amended your conf file, you > should see the placeholder transformation. > > Hope that's of some use. > > Matt > > > On Mon, 2009-01-19 at 14:17 +0800, Chi-BiN Hsiao wrote: > > First of all, thanks for everyone who works at r3. > > > > And I want to add a plugin to r3. I hope, with this plugin, we can > > strip html comments and unnecessary while-space when we run "r3 > > generate ..." to complile *.ros to *.html file. If we can add a config > > flag to control the filter to enabled/disabled is more perfect. > > > > But it seems, there was no document tell us how to crate plugin for > > r3? Can any one tell me how does this work? Thank you. > > > > Best Reguards. > > > > |