Subject: | Feature request: specify inside a plugin module that it shouldn't be loaded |
This may seem perverse, but here's a use case for it:
I'm working on MojoMojo, a wiki with a pluggable syntax. It has content
formatters that parse the page content and output HTML from what they
recognize as their own tags. E.g. the CPAN plugin moduel will parse
{{cpan Some::Module}} into a <a
href="http://search.cpan.org/perldoc?Some::Module">Some::Module</a>.
We also have a Markdown plugin and a Textile plugin. The thing is that
only one of the should parse the content at a time (based on user
setting), but they should still have a the same ->parse method like all
other plugins.
A solution I thought of was to have a "Main" plugin which will dispatch
to either the Textile or the Markdown plugin based on the user setting,
and have the Markdown and Textile plugins not implement ->parse, but
->main_parse, and have Main call ->main_parse. However, it would be nice
to keep the same method name, but have these two plugins somehow
excluded from automatic loading.
Does this make sense?
For reference:
http://github.com/marcusramberg/mojomojo/blob/23f062d76eaf0378a20e854bcfe12a730f176140/lib/MojoMojo/Schema/ResultSet/Content.pm#L21
-- calls all plugins (uses Module::Pluggable::Ordered)
http://github.com/marcusramberg/mojomojo/blob/5b4d0d0411ef9099eac555f49c29170c13189c89/lib/MojoMojo/Formatter/Main.pm
-- dispatches to Markdown or Textile (below)
http://github.com/marcusramberg/mojomojo/blob/5b4d0d0411ef9099eac555f49c29170c13189c89/lib/MojoMojo/Formatter/Markdown.pm
http://github.com/marcusramberg/mojomojo/blob/5b4d0d0411ef9099eac555f49c29170c13189c89/lib/MojoMojo/Formatter/Textile.pm