forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin-doc.html.erb
91 lines (75 loc) · 2.31 KB
/
plugin-doc.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
title: logstash docs for <%= section %>s/<%= name %>
layout: content_right
---
<h2><%= name %></h2>
<h3>Milestone: <a href="../plugin-milestones"><%= @milestone %></a></h3>
<%= description %>
<% if [email protected]? -%>
<!-- Flags are deprecated
<h3> Flags </h3>
This plugin provides the following flags:
<dl>
<% @flags.each do |flag, description| -%>
<%# Prefix flag with plugin name. %>
<dt> <%= flag.gsub(/^--/, "--#{name}-") %> </dt>
<dd> <%= description %> </dd>
<% end -%>
</dl>
... flags are deprecated -->
<% end -%>
<h3> Synopsis </h3>
This is what it might look like in your config file:
<pre><code><% if section == "codec" -%>
# with an input plugin:
# you can also use this codec with an output.
input {
file {
codec => <%= synopsis.split("\n").map { |l| " #{l}" }.join("\n") %>
}
}
<% else -%>
<%= section %> {
<%= synopsis %>
}
<% end -%></code></pre>
<h3> Details </h3>
<% sorted_attributes.each do |name, config| -%>
<%
if name.is_a?(Regexp)
name = "/" + name.to_s.gsub(/^\(\?-mix:/, "").gsub(/\)$/, "") + "/"
is_regexp = true
else
is_regexp = false
end
-%>
<h4>
<a name="<%= name %>">
<%= name %><%= " (required setting)" if config[:required] %>
<%= " <strong>DEPRECATED</strong>" if config[:deprecated] %>
</a>
</h4>
<ul>
<% if config[:deprecated] -%>
<li> DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version. </li>
<% end -%>
<% if is_regexp -%>
<li> The configuration attribute name here is anything that matches the above regular expression. </li>
<% end -%>
<% if config[:validate].is_a?(Symbol) -%>
<li> Value type is <a href="../configuration#<%= config[:validate] %>"><%= config[:validate] %></a> </li>
<% elsif config[:validate].nil? -%>
<li> Value type is <a href="../configuration#string">string</a> </li>
<% elsif config[:validate].is_a?(Array) -%>
<li> Value can be any of: <%= config[:validate].map(&:inspect).join(", ") %> </li>
<% end -%>
<% if config.include?(:default) -%>
<li> Default value is <%= config[:default].inspect %> </li>
<% else -%>
<li> There is no default value for this setting. </li>
<% end -%>
</ul>
<%= config[:description] %>
<% end -%>
<hr>
This is documentation from <a href="https://github.com/logstash/logstash/blob/v<%= LOGSTASH_VERSION %>/<%= file %>"><%= file %></a>