logstash/docs/plugin-doc.asciidoc.erb
Suyog Rao 683302e26d Rename bin/plugin to bin/logstash-plugin
This adds support for packs and fixes the problem where bin/plugin
pollutes the PATH namespace

Fixes #4871

Fixes #4874
2016-03-24 00:23:15 +00:00

68 lines
1.8 KiB
Text

<%- plugin_name = name -%>
[[plugins-<%= section %>s-<%= name %>]]
=== <%= name %>
<% unless default_plugin %>
NOTE: This is a community-maintained plugin! It does not ship with Logstash by default, but it is easy to install by running `bin/logstash-plugin install logstash-<%= section %>-<%= plugin_name %>`.
<% end %>
<%= description %>
&nbsp;
==== Synopsis
<% if sorted_attributes.count > 0 -%>
This plugin supports the following configuration options:
<% else -%>
This plugin has no configuration options.
<% end -%>
<%= synopsis -%>
<% if sorted_attributes.count > 0 -%>
==== Details
&nbsp;
<% sorted_attributes.each do |name, config| -%>
<%
next if config[:obsolete]
if name.is_a?(Regexp)
name = "/" + name.to_s.gsub(/^\(\?-mix:/, "").gsub(/\)$/, "") + "/"
is_regexp = true
else
is_regexp = false
end
-%>
[[plugins-<%= section%>s-<%= plugin_name%>-<%= name%>]]
===== `<%= name %>` <%= " (DEPRECATED)" if config[:deprecated] %>
<% if config[:required] -%>
* This is a required setting.
<% end -%>
<% if config[:deprecated] -%>
* DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
<% end -%>
<% if is_regexp -%>
* The configuration attribute name here is anything that matches the above regular expression.
<% end -%>
<% if config[:validate].is_a?(Symbol) -%>
* Value type is <<<%= config[:validate] %>,<%= config[:validate] %>>>
<% elsif config[:validate].nil? -%>
<li> Value type is <<string,string>>
<% elsif config[:validate].is_a?(Array) -%>
* Value can be any of: `<%= config[:validate].join('`, `') %>`
<% end -%>
<% if config.include?(:default) -%>
* Default value is `<%= config[:default].inspect %>`
<% else -%>
* There is no default value for this setting.
<% end -%>
<%= config[:description] %>
<% end -%>
<% end -%>