Skip to content

Commit c5485cd

Browse files
danielparkschelnak
authored andcommitted
(#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 504675b commit c5485cd

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

Diff for: lib/puppet-strings/markdown/base.rb

-13
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,6 @@ def link
158158
clean_link(name)
159159
end
160160

161-
# 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.
162-
# @param value
163-
# any string
164-
# @return [String] value or value in backticks if it is in a list
165-
def value_string(value)
166-
to_symbol = %w[undef true false]
167-
if to_symbol.include? value
168-
return "`#{value}`"
169-
else
170-
return value
171-
end
172-
end
173-
174161
def private?
175162
@tags.any? { |tag| tag[:tag_name] == 'api' && tag[:text] == 'private' }
176163
end

Diff for: lib/puppet-strings/markdown/templates/classes_and_defines.erb

+1-1
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 -%>

Diff for: lib/puppet-strings/markdown/templates/data_type.erb

+1-1
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 -%>

Diff for: lib/puppet-strings/markdown/templates/resource_type.erb

+3-3
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[:link] %>"></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)