(PDOC-233) Increase chances of markdown rendering correctly

Some variants of markdown do not convert atx-style headers correctly
unless they are surrounded by blank lines.  This commit adds blank lines
to increase chances of rendering when using those variants while still
maintaining compatibly with variants that do not require the surrounding
blank lines.  Also increases readability when viewing the raw markdown
file.
This commit is contained in:
John Lyman 2018-03-16 13:18:08 +00:00
parent 6eec1544f7
commit d9065e6f2e
6 changed files with 65 additions and 4 deletions

View File

@ -24,8 +24,10 @@
<% end -%> <% end -%>
<% if examples -%> <% if examples -%>
#### Examples #### Examples
<% examples.each do |eg| -%> <% examples.each do |eg| -%>
##### <%= eg[:name] %> ##### <%= eg[:name] %>
```puppet ```puppet
<%= eg[:text] %> <%= eg[:text] %>
``` ```

View File

@ -1,16 +1,15 @@
### <%= name %> ### <%= name %>
Type: <%= type %> Type: <%= type %>
<% if text -%> <% if text -%>
<%= text %> <%= text %>
<% elsif summary -%> <% elsif summary -%>
<%= summary %> <%= summary %>
<% else -%> <% else -%>
<%= "The #{name} class." %> <%= "The #{name} class." %>
<% end -%> <% end -%>
<% signatures.each do |sig| -%> <% signatures.each do |sig| -%>
#### `<%= sig.signature %>` #### `<%= sig.signature %>`

View File

@ -24,14 +24,17 @@
<% end -%> <% end -%>
<% if examples -%> <% if examples -%>
#### Examples #### Examples
<% examples.each do |eg| -%> <% examples.each do |eg| -%>
##### <%= eg[:name] %> ##### <%= eg[:name] %>
```puppet ```puppet
<%= eg[:text] %> <%= eg[:text] %>
``` ```
<% end -%> <% end -%>
<% end -%> <% end -%>
<% if properties %> <% if properties -%>
#### Properties #### Properties
The following properties are available in the `<%= name %>` <%= @type %>. The following properties are available in the `<%= name %>` <%= @type %>.

View File

@ -1,13 +1,17 @@
<% if group.length > 0 -%> <% if group.length > 0 -%>
## <%= group_name %> ## <%= group_name %>
<% if priv -%> <% if priv -%>
### Public <%= group_name %> ### Public <%= group_name %>
<% group.each do |item| -%> <% group.each do |item| -%>
<% unless item[:private] -%> <% unless item[:private] -%>
* [`<%= item[:name] %>`](#<%= item[:link] %>): <%= item[:desc] %> * [`<%= item[:name] %>`](#<%= item[:link] %>): <%= item[:desc] %>
<% end -%> <% end -%>
<% end -%> <% end -%>
### Private <%= group_name %> ### Private <%= group_name %>
<% group.each do |item| -%> <% group.each do |item| -%>
<% if item[:private] -%> <% if item[:private] -%>
* `<%= item[:name] %>`: <%= item[:desc] %> * `<%= item[:name] %>`: <%= item[:desc] %>
@ -18,4 +22,5 @@
* [`<%= item[:name] %>`](#<%= item[:link] %>): <%= item[:desc] %> * [`<%= item[:name] %>`](#<%= item[:link] %>): <%= item[:desc] %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<% end -%> <% end -%>

View File

@ -1,22 +1,35 @@
# Reference # Reference
## Classes ## Classes
### Public Classes ### Public Classes
* [`klass`](#klass): A simple class. * [`klass`](#klass): A simple class.
### Private Classes ### Private Classes
* `noparams`: Overview for class noparams * `noparams`: Overview for class noparams
## Defined types ## Defined types
* [`klass::dt`](#klassdt): A simple defined type. * [`klass::dt`](#klassdt): A simple defined type.
## Resource types ## Resource types
* [`apt_key`](#apt_key): Example resource type using the new API. * [`apt_key`](#apt_key): Example resource type using the new API.
* [`database`](#database): An example database server type. * [`database`](#database): An example database server type.
## Functions ## Functions
* [`func`](#func): A simple Puppet function. * [`func`](#func): A simple Puppet function.
* [`func3x`](#func3x): Documentation for an example 3.x function. * [`func3x`](#func3x): Documentation for an example 3.x function.
* [`func4x`](#func4x): An example 4.x function. * [`func4x`](#func4x): An example 4.x function.
* [`func4x_1`](#func4x_1): An example 4.x function with only one signature. * [`func4x_1`](#func4x_1): An example 4.x function with only one signature.
## Tasks ## Tasks
* [`(stdin)`](#(stdin)): Allows you to backup your database to local file. * [`(stdin)`](#(stdin)): Allows you to backup your database to local file.
## Classes ## Classes
### klass ### klass
@ -30,7 +43,9 @@ www.puppet.com
#### Examples #### Examples
##### This is an example ##### This is an example
```puppet ```puppet
class { 'klass': class { 'klass':
param1 => 1, param1 => 1,
@ -39,6 +54,7 @@ class { 'klass':
``` ```
##### This is another example ##### This is another example
```puppet ```puppet
class { 'klass': class { 'klass':
param1 => 1, param1 => 1,
@ -94,7 +110,9 @@ www.puppet.com
#### Examples #### Examples
##### Here's an example of this type: ##### Here's an example of this type:
```puppet ```puppet
klass::dt { 'foo': klass::dt { 'foo':
param1 => 33, param1 => 33,
@ -155,7 +173,9 @@ If Puppet is given the location of a key file which looks like an absolute
path this type will autorequire that file. path this type will autorequire that file.
#### Examples #### Examples
##### here's an example ##### here's an example
```puppet ```puppet
apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F': apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
source => 'http://apt.puppetlabs.com/pubkey.gpg' source => 'http://apt.puppetlabs.com/pubkey.gpg'
@ -197,7 +217,9 @@ The ID of the key you want to manage.
An example database server type. An example database server type.
#### Examples #### Examples
##### here's an example ##### here's an example
```puppet ```puppet
database { 'foo': database { 'foo':
address => 'qux.baz.bar', address => 'qux.baz.bar',
@ -256,6 +278,7 @@ Default value: `false`
## Functions ## Functions
### func ### func
Type: Puppet Language Type: Puppet Language
A simple Puppet function. A simple Puppet function.
@ -292,6 +315,7 @@ Options:
* **:param3opt** `Array`: Something about this option * **:param3opt** `Array`: Something about this option
### func3x ### func3x
Type: Ruby 3.x API Type: Ruby 3.x API
Documentation for an example 3.x function. Documentation for an example 3.x function.
@ -315,6 +339,7 @@ Data type: `Integer`
The second parameter. The second parameter.
### func4x ### func4x
Type: Ruby 4.x API Type: Ruby 4.x API
An example 4.x function. An example 4.x function.
@ -367,6 +392,7 @@ Data type: `Callable`
The block parameter. The block parameter.
### func4x_1 ### func4x_1
Type: Ruby 4.x API Type: Ruby 4.x API
An example 4.x function with only one signature. An example 4.x function with only one signature.

View File

@ -1,22 +1,35 @@
# Reference # Reference
## Classes ## Classes
### Public Classes ### Public Classes
* [`klass`](#klass): A simple class. * [`klass`](#klass): A simple class.
### Private Classes ### Private Classes
* `noparams`: Overview for class noparams * `noparams`: Overview for class noparams
## Defined types ## Defined types
* [`klass::dt`](#klassdt): A simple defined type. * [`klass::dt`](#klassdt): A simple defined type.
## Resource types ## Resource types
* [`apt_key`](#apt_key): Example resource type using the new API. * [`apt_key`](#apt_key): Example resource type using the new API.
* [`database`](#database): An example database server type. * [`database`](#database): An example database server type.
## Functions ## Functions
* [`func`](#func): A simple Puppet function. * [`func`](#func): A simple Puppet function.
* [`func3x`](#func3x): Documentation for an example 3.x function. * [`func3x`](#func3x): Documentation for an example 3.x function.
* [`func4x`](#func4x): An example 4.x function. * [`func4x`](#func4x): An example 4.x function.
* [`func4x_1`](#func4x_1): An example 4.x function with only one signature. * [`func4x_1`](#func4x_1): An example 4.x function with only one signature.
## Tasks ## Tasks
* [`(stdin)`](#(stdin)): Allows you to backup your database to local file. * [`(stdin)`](#(stdin)): Allows you to backup your database to local file.
## Classes ## Classes
### klass ### klass
@ -30,7 +43,9 @@ www.puppet.com
#### Examples #### Examples
##### This is an example ##### This is an example
```puppet ```puppet
class { 'klass': class { 'klass':
param1 => 1, param1 => 1,
@ -39,6 +54,7 @@ class { 'klass':
``` ```
##### This is another example ##### This is another example
```puppet ```puppet
class { 'klass': class { 'klass':
param1 => 1, param1 => 1,
@ -94,7 +110,9 @@ www.puppet.com
#### Examples #### Examples
##### Here's an example of this type: ##### Here's an example of this type:
```puppet ```puppet
klass::dt { 'foo': klass::dt { 'foo':
param1 => 33, param1 => 33,
@ -155,7 +173,9 @@ If Puppet is given the location of a key file which looks like an absolute
path this type will autorequire that file. path this type will autorequire that file.
#### Examples #### Examples
##### here's an example ##### here's an example
```puppet ```puppet
apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F': apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
source => 'http://apt.puppetlabs.com/pubkey.gpg' source => 'http://apt.puppetlabs.com/pubkey.gpg'
@ -197,7 +217,9 @@ The ID of the key you want to manage.
An example database server type. An example database server type.
#### Examples #### Examples
##### here's an example ##### here's an example
```puppet ```puppet
database { 'foo': database { 'foo':
address => 'qux.baz.bar', address => 'qux.baz.bar',
@ -256,6 +278,7 @@ Default value: `false`
## Functions ## Functions
### func ### func
Type: Puppet Language Type: Puppet Language
A simple Puppet function. A simple Puppet function.
@ -292,6 +315,7 @@ Options:
* **:param3opt** `Array`: Something about this option * **:param3opt** `Array`: Something about this option
### func3x ### func3x
Type: Ruby 3.x API Type: Ruby 3.x API
Documentation for an example 3.x function. Documentation for an example 3.x function.
@ -315,6 +339,7 @@ Data type: `Integer`
The second parameter. The second parameter.
### func4x ### func4x
Type: Ruby 4.x API Type: Ruby 4.x API
An example 4.x function. An example 4.x function.
@ -367,6 +392,7 @@ Data type: `Callable`
The block parameter. The block parameter.
### func4x_1 ### func4x_1
Type: Ruby 4.x API Type: Ruby 4.x API
An example 4.x function with only one signature. An example 4.x function with only one signature.