puppet-strings 2.4.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -5
  3. data/COMMITTERS.md +17 -17
  4. data/CONTRIBUTING.md +6 -6
  5. data/README.md +10 -10
  6. data/lib/puppet-strings.rb +4 -2
  7. data/lib/puppet-strings/describe.rb +2 -0
  8. data/lib/puppet-strings/json.rb +2 -0
  9. data/lib/puppet-strings/markdown.rb +12 -10
  10. data/lib/puppet-strings/markdown/base.rb +17 -3
  11. data/lib/puppet-strings/markdown/data_type.rb +18 -0
  12. data/lib/puppet-strings/markdown/data_types.rb +3 -1
  13. data/lib/puppet-strings/markdown/defined_type.rb +2 -0
  14. data/lib/puppet-strings/markdown/defined_types.rb +3 -1
  15. data/lib/puppet-strings/markdown/function.rb +9 -7
  16. data/lib/puppet-strings/markdown/functions.rb +3 -1
  17. data/lib/puppet-strings/markdown/puppet_class.rb +2 -0
  18. data/lib/puppet-strings/markdown/puppet_classes.rb +3 -1
  19. data/lib/puppet-strings/markdown/puppet_plan.rb +2 -0
  20. data/lib/puppet-strings/markdown/puppet_plans.rb +3 -1
  21. data/lib/puppet-strings/markdown/puppet_task.rb +2 -0
  22. data/lib/puppet-strings/markdown/puppet_tasks.rb +3 -1
  23. data/lib/puppet-strings/markdown/resource_type.rb +21 -2
  24. data/lib/puppet-strings/markdown/resource_types.rb +3 -1
  25. data/lib/puppet-strings/markdown/table_of_contents.rb +3 -1
  26. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +10 -6
  27. data/lib/puppet-strings/markdown/templates/data_type.erb +22 -7
  28. data/lib/puppet-strings/markdown/templates/data_type_function.erb +67 -0
  29. data/lib/puppet-strings/markdown/templates/function.erb +2 -1
  30. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  31. data/lib/puppet-strings/markdown/templates/resource_type.erb +19 -13
  32. data/lib/puppet-strings/markdown/templates/table_of_contents.erb +6 -6
  33. data/lib/puppet-strings/monkey_patches/display_object_command.rb +2 -0
  34. data/lib/puppet-strings/tasks.rb +2 -0
  35. data/lib/puppet-strings/tasks/generate.rb +2 -0
  36. data/lib/puppet-strings/tasks/gh_pages.rb +3 -0
  37. data/lib/puppet-strings/version.rb +3 -1
  38. data/lib/puppet-strings/yard.rb +3 -0
  39. data/lib/puppet-strings/yard/code_objects.rb +2 -0
  40. data/lib/puppet-strings/yard/code_objects/base.rb +2 -0
  41. data/lib/puppet-strings/yard/code_objects/class.rb +4 -2
  42. data/lib/puppet-strings/yard/code_objects/data_type.rb +30 -8
  43. data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +2 -0
  44. data/lib/puppet-strings/yard/code_objects/defined_type.rb +4 -2
  45. data/lib/puppet-strings/yard/code_objects/function.rb +6 -3
  46. data/lib/puppet-strings/yard/code_objects/group.rb +3 -0
  47. data/lib/puppet-strings/yard/code_objects/plan.rb +4 -2
  48. data/lib/puppet-strings/yard/code_objects/provider.rb +6 -0
  49. data/lib/puppet-strings/yard/code_objects/task.rb +2 -0
  50. data/lib/puppet-strings/yard/code_objects/type.rb +50 -5
  51. data/lib/puppet-strings/yard/handlers.rb +2 -0
  52. data/lib/puppet-strings/yard/handlers/helpers.rb +2 -0
  53. data/lib/puppet-strings/yard/handlers/json/base.rb +2 -0
  54. data/lib/puppet-strings/yard/handlers/json/task_handler.rb +2 -0
  55. data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -0
  56. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +2 -0
  57. data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +2 -0
  58. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +2 -0
  59. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +3 -1
  60. data/lib/puppet-strings/yard/handlers/puppet/plan_handler.rb +2 -0
  61. data/lib/puppet-strings/yard/handlers/ruby/base.rb +5 -0
  62. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +223 -60
  63. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +9 -7
  64. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +13 -0
  65. data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -1
  66. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +20 -6
  67. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +16 -6
  68. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +18 -1
  69. data/lib/puppet-strings/yard/parsers.rb +2 -0
  70. data/lib/puppet-strings/yard/parsers/json/parser.rb +2 -0
  71. data/lib/puppet-strings/yard/parsers/json/task_statement.rb +2 -0
  72. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +18 -14
  73. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
  74. data/lib/puppet-strings/yard/tags.rb +2 -0
  75. data/lib/puppet-strings/yard/tags/enum_tag.rb +2 -0
  76. data/lib/puppet-strings/yard/tags/factory.rb +2 -0
  77. data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -1
  78. data/lib/puppet-strings/yard/tags/parameter_directive.rb +5 -4
  79. data/lib/puppet-strings/yard/tags/property_directive.rb +5 -4
  80. data/lib/puppet-strings/yard/tags/summary_tag.rb +2 -0
  81. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb +6 -0
  82. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +9 -1
  83. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +1 -1
  84. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +3 -1
  85. data/lib/puppet-strings/yard/util.rb +4 -1
  86. data/lib/puppet/application/strings.rb +2 -0
  87. data/lib/puppet/face/strings.rb +4 -1
  88. data/lib/puppet/feature/rgen.rb +2 -0
  89. data/lib/puppet/feature/yard.rb +2 -0
  90. metadata +11 -52
  91. data/CODEOWNERS +0 -1
  92. data/Gemfile +0 -53
  93. data/HISTORY.md +0 -218
  94. data/JSON.md +0 -832
  95. data/Rakefile +0 -160
  96. data/codecov.yml +0 -3
  97. data/misc/ANNOUNCEMENT_TEMPLATE.md +0 -40
  98. data/spec/acceptance/emit_json_options_spec.rb +0 -69
  99. data/spec/acceptance/generate_markdown_spec.rb +0 -47
  100. data/spec/acceptance/running_strings_generate_spec.rb +0 -88
  101. data/spec/fixtures/acceptance/modules/test/functions/add.pp +0 -9
  102. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +0 -5
  103. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +0 -2
  104. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +0 -9
  105. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +0 -15
  106. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +0 -31
  107. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +0 -27
  108. data/spec/fixtures/acceptance/modules/test/metadata.json +0 -10
  109. data/spec/fixtures/acceptance/modules/test/types/elephant.pp +0 -2
  110. data/spec/fixtures/unit/markdown/output.md +0 -561
  111. data/spec/fixtures/unit/markdown/output_with_data_types.md +0 -606
  112. data/spec/fixtures/unit/markdown/output_with_plan.md +0 -595
  113. data/spec/spec_helper.rb +0 -49
  114. data/spec/spec_helper_acceptance.rb +0 -58
  115. data/spec/spec_helper_acceptance_local.rb +0 -10
  116. data/spec/unit/puppet-strings/describe_spec.rb +0 -141
  117. data/spec/unit/puppet-strings/json_spec.rb +0 -302
  118. data/spec/unit/puppet-strings/markdown/base_spec.rb +0 -146
  119. data/spec/unit/puppet-strings/markdown_spec.rb +0 -374
  120. data/spec/unit/puppet-strings/yard/code_objects/task_spec.rb +0 -92
  121. data/spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb +0 -116
  122. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +0 -217
  123. data/spec/unit/puppet-strings/yard/handlers/puppet/data_type_alias_handler_spec.rb +0 -65
  124. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +0 -231
  125. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +0 -315
  126. data/spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb +0 -309
  127. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +0 -746
  128. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +0 -158
  129. data/spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb +0 -235
  130. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +0 -311
  131. data/spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb +0 -72
  132. data/spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb +0 -56
  133. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +0 -251
  134. data/spec/unit/puppet-strings/yard/util_spec.rb +0 -48
@@ -1,18 +1,36 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
4
6
  # This class encapsualtes ruby data types and puppet type aliases
5
7
  class DataType < Base
6
8
  attr_reader :alias_of
9
+ attr_reader :functions
7
10
 
8
11
  def initialize(registry)
9
12
  @template = 'data_type.erb'
10
13
  super(registry, 'data type')
11
14
  @alias_of = registry[:alias_of] unless registry[:alias_of].nil?
15
+ @functions = @registry[:functions].nil? ? nil : @registry[:functions].map { |func| DataType::Function.new(func) }
12
16
  end
13
17
 
14
18
  def render
15
19
  super(@template)
16
20
  end
17
21
  end
22
+
23
+ class DataType::Function < Base
24
+ def initialize(registry)
25
+ super(registry, 'data_type_function')
26
+ end
27
+
28
+ def render
29
+ super('data_type_function.erb')
30
+ end
31
+
32
+ def signature
33
+ @registry[:signature]
34
+ end
35
+ end
18
36
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'data_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -22,7 +24,7 @@ module PuppetStrings::Markdown
22
24
  def self.render
23
25
  final = in_dtypes.length > 0 ? "## Data types\n\n" : ""
24
26
  in_dtypes.each do |type|
25
- final << type.render unless type.private?
27
+ final += type.render unless type.private?
26
28
  end
27
29
  final
28
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'defined_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_dtypes.length > 0 ? "## Defined types\n\n" : ""
21
23
  in_dtypes.each do |type|
22
- final << type.render unless type.private?
24
+ final += type.render unless type.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,23 +21,23 @@ module PuppetStrings::Markdown
19
21
 
20
22
  def type
21
23
  t = @registry[:type]
22
- if t =~ /ruby4x/
24
+ if /ruby4x/.match?(t)
23
25
  "Ruby 4.x API"
24
- elsif t =~ /ruby3/
26
+ elsif /ruby3/.match?(t)
25
27
  "Ruby 3.x API"
26
- elsif t =~ /ruby/
28
+ elsif /ruby/.match?(t)
27
29
  "Ruby"
28
30
  else
29
31
  "Puppet Language"
30
32
  end
31
33
  end
32
34
 
33
- def error_type(r) # rubocop:disable Naming/UncommunicativeMethodParamName
34
- "`#{r.split(' ')[0]}`"
35
+ def error_type(type)
36
+ "`#{type.split(' ')[0]}`"
35
37
  end
36
38
 
37
- def error_text(r) # rubocop:disable Naming/UncommunicativeMethodParamName
38
- "#{r.split(' ').drop(1).join(' ')}"
39
+ def error_text(text)
40
+ "#{text.split(' ').drop(1).join(' ')}"
39
41
  end
40
42
  end
41
43
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'function'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_functions.length > 0 ? "## Functions\n\n" : ""
21
23
  in_functions.each do |func|
22
- final << func.render unless func.private?
24
+ final += func.render unless func.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_class'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_classes.length > 0 ? "## Classes\n\n" : ""
21
23
  in_classes.each do |klass|
22
- final << klass.render unless klass.private?
24
+ final += klass.render unless klass.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_plan'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_plans.length > 0 ? "## Plans\n\n" : ""
21
23
  in_plans.each do |plan|
22
- final << plan.render unless plan.private?
24
+ final += plan.render unless plan.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_task'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -16,7 +18,7 @@ module PuppetStrings::Markdown
16
18
  def self.render
17
19
  final = in_tasks.length > 0 ? "## Tasks\n\n" : ""
18
20
  in_tasks.each do |task|
19
- final << task.render unless task.private?
21
+ final += task.render unless task.private?
20
22
  end
21
23
  final
22
24
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -12,11 +14,28 @@ module PuppetStrings::Markdown
12
14
  end
13
15
 
14
16
  def properties
15
- @registry[:properties]
17
+ return nil unless @registry[:properties]
18
+
19
+ @registry[:properties].sort_by { |p| p[:name] }
20
+ end
21
+
22
+ def checks
23
+ return nil unless @registry[:checks]
24
+
25
+ @registry[:checks].sort_by { |p| p[:name] }
26
+ end
27
+
28
+ # "checks" (such as "onlyif" or "creates") are another type of property
29
+ def properties_and_checks
30
+ return nil if properties.nil? && checks.nil?
31
+
32
+ ((properties || []) + (checks || [])).sort_by { |p| p[:name] }
16
33
  end
17
34
 
18
35
  def parameters
19
- @registry[:parameters]
36
+ return nil unless @registry[:parameters]
37
+
38
+ @registry[:parameters].sort_by { |p| p[:name] }
20
39
  end
21
40
 
22
41
  def regex_in_data_type?(data_type)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'resource_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_rtypes.length > 0 ? "## Resource types\n\n" : ""
21
23
  in_rtypes.each do |type|
22
- final << type.render unless type.private?
24
+ final += type.render unless type.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PuppetStrings::Markdown
2
4
  module TableOfContents
3
5
  def self.render
@@ -16,7 +18,7 @@ module PuppetStrings::Markdown
16
18
  priv = r.contains_private?
17
19
 
18
20
  template = File.join(File.dirname(__FILE__),"templates/table_of_contents.erb")
19
- final << ERB.new(File.read(template), nil, '-').result(binding)
21
+ final += ERB.new(File.read(template), nil, '-').result(binding)
20
22
  end
21
23
  final
22
24
  end
@@ -1,4 +1,4 @@
1
- ### <%= name %>
1
+ ### <a name="<%= link %>"></a>`<%= name %>`
2
2
 
3
3
  <% if text -%>
4
4
  <%= text %>
@@ -24,10 +24,10 @@
24
24
  * **See also**
25
25
  <% see.each do |sa| -%>
26
26
  <% if sa[:name] -%>
27
- <%= sa[:name] %>
27
+ <%= " * #{sa[:name]}" %>
28
28
  <% end -%>
29
29
  <% if sa[:text] -%>
30
- <%= sa[:text] %>
30
+ <%= " * #{sa[:text]}" %>
31
31
  <% end -%>
32
32
  <% end -%>
33
33
 
@@ -47,10 +47,14 @@
47
47
  <% if params -%>
48
48
  #### Parameters
49
49
 
50
- The following parameters are available in the `<%= name %>` <%= @type %>.
50
+ The following parameters are available in the `<%= name %>` <%= @type %>:
51
51
 
52
52
  <% params.each do |param| -%>
53
- ##### `<%= param[:name] %>`
53
+ * [`<%= param[:name] %>`](#<%= param[:name] %>)
54
+ <% end -%>
55
+
56
+ <% params.each do |param| -%>
57
+ ##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`
54
58
 
55
59
  <% if param[:types] -%>
56
60
  Data type: `<%= param[:types].join(', ') -%>`
@@ -75,7 +79,7 @@ Options:
75
79
 
76
80
  <% end -%>
77
81
  <% if defaults && defaults[param[:name]] -%>
78
- Default value: <%= value_string(defaults[param[:name]]) %>
82
+ Default value: `<%= value_string(defaults[param[:name]]) %>`
79
83
 
80
84
  <% end -%>
81
85
  <% end -%>
@@ -1,4 +1,4 @@
1
- ### <%= name %>
1
+ ### <a name="<%= link %>"></a>`<%= name %>`
2
2
 
3
3
  <% if text -%>
4
4
  <%= text %>
@@ -24,10 +24,10 @@
24
24
  * **See also**
25
25
  <% see.each do |sa| -%>
26
26
  <% if sa[:name] -%>
27
- <%= sa[:name] %>
27
+ <%= " * #{sa[:name]}" %>
28
28
  <% end -%>
29
29
  <% if sa[:text] -%>
30
- <%= sa[:text] %>
30
+ <%= " * #{sa[:text]}" %>
31
31
  <% end -%>
32
32
  <% end -%>
33
33
 
@@ -45,16 +45,24 @@
45
45
  <% end -%>
46
46
  <% end -%>
47
47
  <% if alias_of -%>
48
- Alias of `<%= alias_of %>`
48
+ Alias of
49
+
50
+ ```puppet
51
+ <%= alias_of %>
52
+ ```
49
53
 
50
54
  <% end -%>
51
55
  <% if params -%>
52
56
  #### Parameters
53
57
 
54
- The following parameters are available in the `<%= name %>` <%= @type %>.
58
+ The following parameters are available in the `<%= name %>` <%= @type %>:
55
59
 
56
60
  <% params.each do |param| -%>
57
- ##### `<%= param[:name] %>`
61
+ * [`<%= param[:name] %>`](#<%= param[:name] %>)
62
+ <% end -%>
63
+
64
+ <% params.each do |param| -%>
65
+ ##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`
58
66
 
59
67
  <% if param[:types] -%>
60
68
  Data type: `<%= param[:types].join(', ') -%>`
@@ -79,8 +87,15 @@ Options:
79
87
 
80
88
  <% end -%>
81
89
  <% if defaults && defaults[param[:name]] -%>
82
- Default value: <%= value_string(defaults[param[:name]]) %>
90
+ Default value: `<%= value_string(defaults[param[:name]]) %>`
83
91
 
84
92
  <% end -%>
85
93
  <% end -%>
86
94
  <% end -%>
95
+ <% if functions -%>
96
+ #### Functions
97
+
98
+ The following functions are available in the `<%= name %>` <%= @type %>.
99
+
100
+ <% functions.each do |func| -%><%= func.render -%><% end -%>
101
+ <% end -%>
@@ -0,0 +1,67 @@
1
+ ### <a name="<%= link %>"></a>`<%= name %>`
2
+
3
+ #### `<%= signature %>`
4
+
5
+ <% if text -%>
6
+ <%= text %>
7
+
8
+ <% elsif summary -%>
9
+ <%= summary %>
10
+
11
+ <% else -%>
12
+ <%= "The #{name} function." %>
13
+
14
+ <% end -%>
15
+ <% if note -%>
16
+ * **Note** <%= note %>
17
+
18
+ <% end -%>
19
+ <% if return_type -%>
20
+ Returns: `<%= return_type %>`<% if return_val %> <%= return_val %><% end %>
21
+
22
+ <% end -%>
23
+ <% if raises -%>
24
+ Raises:
25
+ <% raises.each do |r| -%>
26
+ * <%= error_type(r[:text]) %> <%= error_text(r[:text]) %>
27
+ <% end -%>
28
+
29
+ <% end -%>
30
+ <% if examples -%>
31
+ ##### Examples
32
+
33
+ <% examples.each do |eg| -%>
34
+ ###### <%= eg[:name] %>
35
+
36
+ ```puppet
37
+ <%= eg[:text] %>
38
+ ```
39
+
40
+ <% end -%>
41
+ <% end -%>
42
+ <% if params -%>
43
+ <% params.each do |param| -%>
44
+ ##### `<%= param[:name] %>`
45
+
46
+ Data type: `<%= param[:types][0] %>`
47
+
48
+ <%= param[:text] %>
49
+
50
+ <% if options_for_param(param[:name]) -%>
51
+ Options:
52
+
53
+ <% options_for_param(param[:name]).each do |o| -%>
54
+ * **<%= o[:opt_name] %>** `<%= o[:opt_types][0] %>`: <%= o[:opt_text] %>
55
+ <% end -%>
56
+
57
+ <% end -%>
58
+ <% if enums_for_param(param[:name]) -%>
59
+ Options:
60
+
61
+ <% enums_for_param(param[:name]).each do |e| -%>
62
+ * **<%= e[:opt_name] %>**: <%= e[:opt_text] %>
63
+ <% end -%>
64
+
65
+ <% end -%>
66
+ <% end -%>
67
+ <% end -%>
@@ -1,4 +1,4 @@
1
- ### <%= name %>
1
+ ### <a name="<%= link %>"></a>`<%= name %>`
2
2
 
3
3
  Type: <%= type %>
4
4
 
@@ -55,6 +55,7 @@ Returns: `<%= sig.return_type %>`<% if sig.return_val %> <%= sig.return_val %><%
55
55
  <% end -%>
56
56
  <% if raises -%>
57
57
  Raises:
58
+
58
59
  <% raises.each do |r| -%>
59
60
  * <%= error_type(r[:text]) %> <%= error_text(r[:text]) %>
60
61
  <% end -%>