Skip to content

Commit 8fffce2

Browse files
committed
(puppetlabs#304) Fix double backticks in Markdown
Previously, some values in generated Markdown were wrapped in double backticks instead of single backticks. This removes the code that added the extra backticks.
1 parent 5fe07ba commit 8fffce2

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

lib/puppet-strings/markdown/base.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,6 @@ def link
154154
name.delete('::').strip.gsub(' ','-').downcase
155155
end
156156

157-
# Some return, default, or valid values need to be in backticks. Instead of fu in the handler or code_object, this just does the change on the front.
158-
# @param value
159-
# any string
160-
# @return [String] value or value in backticks if it is in a list
161-
def value_string(value)
162-
to_symbol = %w[undef true false]
163-
if to_symbol.include? value
164-
return "`#{value}`"
165-
else
166-
return value
167-
end
168-
end
169-
170157
def private?
171158
@tags.any? { |tag| tag[:tag_name] == 'api' && tag[:text] == 'private' }
172159
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Options:
7979

8080
<% end -%>
8181
<% if defaults && defaults[param[:name]] -%>
82-
Default value: `<%= value_string(defaults[param[:name]]) %>`
82+
Default value: `<%= defaults[param[:name]] %>`
8383

8484
<% end -%>
8585
<% end -%>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Options:
8787

8888
<% end -%>
8989
<% if defaults && defaults[param[:name]] -%>
90-
Default value: `<%= value_string(defaults[param[:name]]) %>`
90+
Default value: `<%= defaults[param[:name]] %>`
9191

9292
<% end -%>
9393
<% end -%>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The following properties are available in the `<%= name %>` <%= @type %>.
5353
##### `<%= prop[:name] %>`
5454

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

5858
<% end -%>
5959
<% if prop[:isnamevar] -%>
@@ -105,7 +105,7 @@ The following parameters are available in the `<%= name %>` <%= @type %>.
105105
##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`
106106

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

110110
<% end -%>
111111
<% if param[:isnamevar] -%>
@@ -141,7 +141,7 @@ Options:
141141

142142
<% end -%>
143143
<% if param[:default] -%>
144-
Default value: `<%= value_string(param[:default]) %>`
144+
Default value: `<%= param[:default] %>`
145145

146146
<% end -%>
147147
<% if param[:required_features] -%>

0 commit comments

Comments
 (0)