Skip to content

Commit 8b5731d

Browse files
Merge pull request #252 from kozl/main
Improved markdown templates
2 parents fcd6b72 + cff5f6d commit 8b5731d

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
<% if text -%>
44
<%= text %>
@@ -47,10 +47,14 @@
4747
<% if params -%>
4848
#### Parameters
4949

50-
The following parameters are available in the `<%= name %>` <%= @type %>.
50+
The following parameters are available in the `<%= name %>` <%= @type %>:
5151

5252
<% 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] %>`
5458

5559
<% if param[:types] -%>
5660
Data type: `<%= param[:types].join(', ') -%>`

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
<% if text -%>
44
<%= text %>
@@ -45,16 +45,24 @@
4545
<% end -%>
4646
<% end -%>
4747
<% if alias_of -%>
48-
Alias of `<%= alias_of %>`
48+
Alias of
49+
50+
```puppet
51+
<%= alias_of %>
52+
```
4953

5054
<% end -%>
5155
<% if params -%>
5256
#### Parameters
5357

54-
The following parameters are available in the `<%= name %>` <%= @type %>.
58+
The following parameters are available in the `<%= name %>` <%= @type %>:
59+
60+
<% params.each do |param| -%>
61+
* [`<%= param[:name] %>`](#<%= param[:name] %>)
62+
<% end -%>
5563

5664
<% params.each do |param| -%>
57-
##### `<%= param[:name] %>`
65+
##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`
5866

5967
<% if param[:types] -%>
6068
Data type: `<%= param[:types].join(', ') -%>`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
#### `<%= signature %>`
44

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
Type: <%= type %>
44

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
<% if text -%>
44
<%= text %>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### `<%= name %>`
1+
### <a name="<%= link %>"></a>`<%= name %>`
22

33
<% if text -%>
44
<%= text %>
@@ -98,7 +98,11 @@ Default value: `<%= prop[:default] %>`
9898
The following parameters are available in the `<%= name %>` <%= @type %>.
9999

100100
<% parameters.each do |param| -%>
101-
##### `<%= param[:name] %>`
101+
* [`<%= param[:name] %>`](#<%= param[:name] %>)
102+
<% end -%>
103+
104+
<% parameters.each do |param| -%>
105+
##### <a name="<%= param[:name] %>"></a>`<%= param[:name] %>`
102106

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

spec/markdownlint_style.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88

99
# Allow trailing punctuation in headings.
1010
exclude_rule 'MD026'
11+
12+
# Allow html tags
13+
exclude_rule 'MD033'

0 commit comments

Comments
 (0)