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