### <a name="<%= link %>"></a>`<%= name %>`

<% if text -%>
<%= text %>
<% elsif summary -%>
<%= summary %>
<% else -%>
<%= "The #{name} type." %>
<% end -%>

<% if todo -%>
* **TODO** <%= todo %>

<% end -%>
<% if note -%>
* **Note** <%= note %>

<% end -%>
<% if since -%>
* **Since** <%= since %>

<% end -%>
<% if see -%>
* **See also**
<% see.each do |sa| -%>
<% if sa[:name] -%>
<%= "  * #{sa[:name]}" %>
<% end -%>
<% if sa[:text] -%>
<%= "  * #{sa[:text]}" %>
<% end -%>
<% end -%>

<% end -%>
<% if examples -%>
#### Examples

<% examples.each do |eg| -%>
##### <%= eg[:name] %>

```puppet
<%= eg[:text] %>
```

<% end -%>
<% end -%>
<% if properties_and_checks -%>
#### Properties

The following properties are available in the `<%= name %>` <%= @type %>.

<% properties_and_checks.each do |prop| -%>
##### `<%= prop[:name] %>`

<% if prop[:values] -%>
Valid values: `<%= prop[:values].map { |value| value_string(value) }.join('`, `') %>`

<% end -%>
<% if prop[:isnamevar] -%>
namevar

<% end -%>
<% if prop[:aliases] -%>
Aliases: `<%= prop[:aliases].to_s.delete('{').delete('}') %>`

<% end -%>
<% if prop[:data_type] -%>
Data type: `<%= prop[:data_type] %>`<%= "\n_\*this data type contains a regex that may not be accurately reflected in generated documentation_" if regex_in_data_type?(prop[:data_type]) %>

<% end -%>
<%= prop[:description] %>

<% if options_for_param(prop[:name]) -%>
Options:

<% options_for_param(prop[:name]).each do |o| -%>
* **<%= o[:opt_name] %>** `<%= o[:opt_types][0] %>`: <%= o[:opt_text] %>
<% end -%>

<% end -%>
<% if enums_for_param(prop[:name]) -%>
Options:

<% enums_for_param(prop[:name]).each do |e| -%>
* **<%= e[:opt_name] %>**: <%= e[:opt_text] %>
<% end -%>

<% end -%>
<% if prop[:default] -%>
Default value: `<%= prop[:default] %>`

<% end -%>
<% end -%>
<% end -%>
<% if parameters -%>
#### Parameters

The following parameters are available in the `<%= name %>` <%= @type %>.

<% parameters.each do |param| -%>
* [`<%= param[:name] %>`](#<%= param[:name] %>)
<% end -%>

<% parameters.each do |param| -%>
##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`

<% if param[:values] -%>
Valid values: `<%= param[:values].map { |value| value_string(value) }.join('`, `') %>`

<% end -%>
<% if param[:isnamevar] -%>
namevar

<% end -%>
<% if param[:aliases] -%>
Aliases: `<%= param[:aliases].to_s.delete('{').delete('}') %>`

<% end -%>
<% if param[:data_type] -%>
Data type: `<%= param[:data_type] %>`<%= "\n_\*this data type contains a regex that may not be accurately reflected in generated documentation_" if regex_in_data_type?(param[:data_type]) %>

<% end -%>
<% if param[:description] -%>
<%= word_wrap(param[:description]) %>
<% end -%>

<% if options_for_param(param[:name]) -%>
Options:

<% options_for_param(param[:name]).each do |o| -%>
* **<%= o[:opt_name] %>** `<%= o[:opt_types][0] %>`: <%= o[:opt_text] %>
<% end -%>

<% end -%>
<% if enums_for_param(param[:name]) -%>
Options:

<% enums_for_param(param[:name]).each do |e| -%>
* **<%= e[:opt_name] %>**: <%= e[:opt_text] %>
<% end -%>

<% end -%>
<% if param[:default] -%>
Default value: `<%= value_string(param[:default]) %>`

<% end -%>
<% if param[:required_features] -%>
Required features: <%= param[:required_features] %>.

<% end -%>
<% end -%>
<% end -%>
