require 'set' class ListPluginParametersTag < Tags::DefaultTag infos( :name => 'WebgenDocu/PluginParameterRefTag', :summary => "Lists all available plugin parameters" ) register_tag 'listPluginParameters' def initialize( plugin_manager ) super @process_output = false end def process_tag( tag, chain ) plugins = @plugin_manager.plugins.select {|k,v| k !~ /^WebgenDocu/ } mydata = {} plugins.each do |name, plugin| next if plugin.class.config.params.empty? (mydata[name[/^.*?(?=\/)/].gsub(/([A-Z][a-z])/, ' \1').strip] ||= []) << plugin end output = "
\n" mydata.sort.each do |cat, plugins| output << "
#{cat}
" plugins.sort {|a,b| a.class.plugin_name <=> b.class.plugin_name}.each do |data| output << "
#{data.class.plugin_name}
\n" output << "
#{@plugin_manager['WebgenDocu/DescribeTag'].format_params( data.class.config.params )}
\n" end output << "
" end output << "
\n" end end