Add support for generating snippets in Markdown

This commit introduces support for generating snippets formatted
using Markdown. Asciidoctor remains the default.

A new SnippetFormat abstraction has been introduced with Asciidoctor
and Markdown implementations provided out of the box.
Markdown-formatted templates are also provided for all of the default
snippets.

Please refer to the updated reference documentation for further
details.

Closes gh-150
Closes gh-19
This commit is contained in:
Andy Wilkinson
2016-01-29 16:10:00 +00:00
parent b34d2dd443
commit 4d37dea1d6
99 changed files with 2100 additions and 1037 deletions

View File

@@ -0,0 +1,4 @@
{{title}}
```bash
$ curl {{url}} {{options}}
```

View File

@@ -0,0 +1,8 @@
{{title}}
```http
{{method}} {{path}} HTTP/1.1
{{#headers}}
{{name}}: {{value}}
{{/headers}}
{{requestBody}}
```

View File

@@ -0,0 +1,8 @@
{{title}}
```http
HTTP/1.1 {{statusCode}} {{statusReason}}
{{#headers}}
{{name}}: {{value}}
{{/headers}}
{{responseBody}}
```

View File

@@ -0,0 +1,5 @@
Relation | Description | Foo
-------- | ----------- | ---
{{#links}}
{{rel}} | {{description}} | {{foo}}
{{/links}}

View File

@@ -0,0 +1,6 @@
{{title}}
Relation | Description
-------- | -----------
{{#links}}
{{rel}} | {{description}}
{{/links}}

View File

@@ -0,0 +1,5 @@
Parameter | Description | Foo
--------- | ----------- | ---
{{#parameters}}
{{name}} | {{description}} | {{foo}}
{{/parameters}}

View File

@@ -0,0 +1,6 @@
{{title}}
Parameter | Description
--------- | -----------
{{#parameters}}
{{name}} | {{description}}
{{/parameters}}

View File

@@ -0,0 +1,5 @@
Path | Type | Description | Foo
---- | ---- | ----------- | ---
{{#fields}}
{{path}} | {{type}} | {{description}} | {{foo}}
{{/fields}}

View File

@@ -0,0 +1,6 @@
{{title}}
Path | Type | Description
---- | ---- | -----------
{{#fields}}
{{path}} | {{type}} | {{description}}
{{/fields}}

View File

@@ -0,0 +1,5 @@
Name | Description | Foo
---- | ----------- | ---
{{#headers}}
{{name}} | {{description}} | {{foo}}
{{/headers}}

View File

@@ -0,0 +1,6 @@
{{title}}
Name | Description
---- | -----------
{{#headers}}
{{name}} | {{description}}
{{/headers}}

View File

@@ -0,0 +1,5 @@
Parameter | Description | Foo
--------- | ----------- | ---
{{#parameters}}
{{name}} | {{description}} | {{foo}}
{{/parameters}}

View File

@@ -0,0 +1,6 @@
{{title}}
Parameter | Description
--------- | -----------
{{#parameters}}
{{name}} | {{description}}
{{/parameters}}

View File

@@ -0,0 +1,5 @@
Path | Type | Description | Foo
---- | ---- | ----------- | ---
{{#fields}}
{{path}} | {{type}} | {{description}} | {{foo}}
{{/fields}}

View File

@@ -0,0 +1,6 @@
{{title}}
Path | Type | Description
---- | ---- | -----------
{{#fields}}
{{path}} | {{type}} | {{description}}
{{/fields}}

View File

@@ -0,0 +1,5 @@
Name | Description | Foo
---- | ----------- | ---
{{#headers}}
{{name}} | {{description}} | {{foo}}
{{/headers}}

View File

@@ -0,0 +1,6 @@
{{title}}
Name | Description
---- | -----------
{{#headers}}
{{name}} | {{description}}
{{/headers}}