logstash/docs/plugin-synopsis.html.erb
2013-08-27 02:14:52 +00:00

24 lines
713 B
Text

<%= name %> {
<% sorted_attributes.each do |name, config|
next if config[:deprecated]
if config[:validate].is_a?(Array)
annotation = "string, one of #{config[:validate].inspect}"
elsif config[:validate] == :path
annotation = "a valid filesystem path"
else
annotation = "#{config[:validate]}"
end
if name.is_a?(Regexp)
name = "/" + name.to_s.gsub(/^\(\?-mix:/, "").gsub(/\)$/, "") + "/"
end
if config[:required]
annotation += " (required)"
else
annotation += " (optional)"
end
annotation += ", default: #{config[:default].inspect}" if config.include?(:default)
-%>
<a href="#<%= name %>"><%= name %></a> => ... # <%= annotation %>
<% end -%>
}