puppet-strings/lib/puppet-strings/markdown/templates/classes_and_defines.erb

64 lines
1.0 KiB
Plaintext

### <%= name %>
<% if text -%>
<%= text %>
<% elsif summary -%>
<%= summary %>
<% else -%>
<%= "The #{name} class." %>
<% end -%>
<% if since -%>
* **Since** <%= since %>
<% end -%>
<% if see -%>
* **See also**
<% see.each do |sa| -%>
<%= sa[:name] %>
<%= sa[:text] %>
<% end -%>
<% end -%>
<% if examples -%>
#### Examples
<% examples.each do |eg| -%>
##### <%= eg[:name] %>
```puppet
<%= eg[:text] %>
```
<% end -%>
<% end -%>
<% if params %>
#### Parameters
The following parameters are available in the `<%= name %>` <%= @type %>.
<% params.each do |param| -%>
##### `<%= param[:name] %>`
<% if param[:types] -%>
Data type: `<%= param[:types].join(', ') -%>`
<% end -%>
<%= param[:text] %>
<% 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 defaults && defaults[param[:name]] -%>
Default value: <%= value_string(defaults[param[:name]]) %>
<% end -%>
<% end -%>
<% end -%>