Skip to content

Commit 98de6ee

Browse files
committed
Add clearer slate support in README. Reorganize slate_example.mustache for cleaner pages.
1 parent 5f0b3f7 commit 98de6ee

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ end
276276
* **markdown**: Generates an index file and example files in Markdown.
277277
* **api_blueprint**: Generates an index file and example files in [APIBlueprint](https://apiblueprint.org).
278278
* **append_json**: Lets you selectively run specs without destroying current documentation. See section below.
279+
* **slate**: Builds markdown files that can be used with [Slate](https://github.com/lord/slate), a beautiful static documentation builder.
279280
* **open_api**: Generates [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) (OAS) (Current supported version is 2.0). Can be used for [Swagger-UI](https://swagger.io/tools/swagger-ui/)
280281

281282
### append_json

templates/rspec_api_documentation/slate_example.mustache

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,73 @@
66

77
### Request
88

9+
{{# curl }}
10+
```shell
11+
{{{ curl }}}
12+
```
13+
{{/ curl }}
14+
915
#### Endpoint
1016

17+
`{{ http_method }} {{ route }}`
18+
1119
{{# requests}}
1220
```plaintext
1321
{{ request_method }} {{ request_path }}
1422
{{ request_headers_text }}
1523
```
1624
{{/ requests}}
1725

18-
`{{ http_method }} {{ route }}`
19-
2026
#### Parameters
2127

2228
{{# requests}}
2329
{{# request_query_parameters_text }}
24-
2530
```json
2631
{{ request_query_parameters_text }}
2732
```
2833
{{/ request_query_parameters_text }}
29-
{{# request_body }}
3034

35+
{{# request_body }}
3136
```json
3237
{{{ request_body }}}
3338
```
3439
{{/ request_body }}
3540

3641
{{# has_parameters? }}
37-
3842
| Name | Description |
3943
|:-----|:------------|
4044
{{# parameters }}
4145
| {{#scope}}{{scope}}[{{/scope}}{{ name }}{{#scope}}]{{/scope}} {{# required }}*required*{{/ required }} | {{{ description }}} |
4246
{{/ parameters }}
43-
4447
{{/ has_parameters? }}
4548
{{^ has_parameters? }}
4649
None known.
4750
{{/ has_parameters? }}
4851

49-
{{# response_status}}
50-
5152
### Response
5253

54+
55+
{{# response_status}}
5356
```plaintext
5457
{{ response_headers_text }}
5558
{{ response_status }} {{ response_status_text}}
5659
```
5760

5861
{{# response_body}}
59-
6062
```json
6163
{{{ response_body }}}
6264
```
6365
{{/response_body}}
64-
6566
{{/ response_status}}
6667

67-
{{# has_response_fields? }}
6868

69+
{{# has_response_fields? }}
6970
#### Fields
7071

7172
| Name | Description |
7273
|:-----------|:--------------------|
7374
{{# response_fields }}
7475
| {{#scope}}{{scope}}[{{/scope}}{{ name }}{{#scope}}]{{/scope}} | {{{ description }}} |
7576
{{/ response_fields }}
76-
7777
{{/ has_response_fields? }}
78-
79-
{{# curl }}
80-
```shell
81-
{{{ curl }}}
82-
```
83-
{{/ curl }}
8478
{{/ requests}}

templates/rspec_api_documentation/slate_index.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: {{ api_name }}
33
language_tabs:
4-
- json: JSON
54
- shell: cURL
65
---
76

0 commit comments

Comments
 (0)