git.iko.soy/typeable/servant
on master help sign in
Merge pull request #1043 from rsoeldner/fix-markdown
58ccae1Oleg Grenrus
servant-docs/example/greet.md+28−31
@@ -10,34 +10,42 @@ You'll also note that multiple intros are possible.
10
10
11## POST /greet
11## POST /greet
12
12
13−#### Request:
13+### Request:
14
14
15- Supported content types are:
15- Supported content types are:
16
16
17+ - `application/json;charset=utf-8`
17 - `application/json`
18 - `application/json`
18
19
19−- Example: `application/json`
20+- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
20
21
21```javascript
22```javascript
22"HELLO, HASKELLER"
23"HELLO, HASKELLER"
23```
24```
24
25
25−#### Response:
26+- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
26
27
28+```javascript
29+"Hello, haskeller"
30+```
31+
32+### Response:
33+
27−- Status code 201
34+- Status code 200
28- Headers: [("X-Example","1729")]
35- Headers: [("X-Example","1729")]
29
36
30- Supported content types are:
37- Supported content types are:
31
38
39+ - `application/json;charset=utf-8`
32 - `application/json`
40 - `application/json`
33
41
34−- If you use ?capital=true
42+- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
35
43
36```javascript
44```javascript
37"HELLO, HASKELLER"
45"HELLO, HASKELLER"
38```
46```
39
47
40−- If you use ?capital=false
48+- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
41
49
42```javascript
50```javascript
43"Hello, haskeller"
51"Hello, haskeller"
@@ -45,81 +53,70 @@ You'll also note that multiple intros are possible.
45
53
46## DELETE /greet/:greetid
54## DELETE /greet/:greetid
47
55
48−#### Title
56+### Title
49
57
50This is some text
58This is some text
51
59
52−#### Second secton
60+### Second secton
53
61
54And some more
62And some more
55
63
56−#### Captures:
64+### Captures:
57
65
58- *greetid*: identifier of the greet msg to remove
66- *greetid*: identifier of the greet msg to remove
59
67
68+### Headers:
60
69
61- This endpoint is sensitive to the value of the **unicorns** HTTP header.
70- This endpoint is sensitive to the value of the **unicorns** HTTP header.
62
71
63−#### Response:
72+### Response:
64
73
65- Status code 200
74- Status code 200
66- Headers: []
75- Headers: []
67
76
68- Supported content types are:
77- Supported content types are:
69
78
79+ - `application/json;charset=utf-8`
70 - `application/json`
80 - `application/json`
71
81
72−- Response body as below.
82+- Example (`application/json;charset=utf-8`, `application/json`):
73
83
74```javascript
84```javascript
75−[]
85+
76```
86```
77
87
78## GET /hello/:name
88## GET /hello/:name
79
89
80−#### Captures:
90+### Captures:
81
91
82- *name*: name of the person to greet
92- *name*: name of the person to greet
83
93
84−#### GET Parameters:
94+### GET Parameters:
85
95
86- capital
96- capital
87 - **Values**: *true, false*
97 - **Values**: *true, false*
88 - **Description**: Get the greeting message in uppercase (true) or not (false).Default is false.
98 - **Description**: Get the greeting message in uppercase (true) or not (false).Default is false.
89
99
90
100
91−#### Response:
101+### Response:
92
102
93- Status code 200
103- Status code 200
94- Headers: []
104- Headers: []
95
105
96- Supported content types are:
106- Supported content types are:
97
107
108+ - `application/json;charset=utf-8`
98 - `application/json`
109 - `application/json`
99 - `text/plain;charset=utf-8`
110 - `text/plain;charset=utf-8`
100
111
101−- If you use ?capital=true
112+- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`, `text/plain;charset=utf-8`):
102
113
103```javascript
114```javascript
104"HELLO, HASKELLER"
115"HELLO, HASKELLER"
105```
116```
106
117
107−- If you use ?capital=true
118+- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
108−
109−```
110−"HELLO, HASKELLER"
111−```
112−
113−- If you use ?capital=false
114
119
115```javascript
120```javascript
116"Hello, haskeller"
121"Hello, haskeller"
117```
122```
118−
119−- If you use ?capital=false
120−
121−```
122−"Hello, haskeller"
123−```
124−
125−
servant-docs/src/Servant/Docs/Internal.hs+2−3
@@ -760,9 +760,9 @@ markdownWith RenderingOptions{..} api = unlines $
760
760
761 contentStr mime_type body =
761 contentStr mime_type body =
762 "" :
762 "" :
763− " ```" <> markdownForType mime_type :
763+ "```" <> markdownForType mime_type :
764 cs body :
764 cs body :
765− " ```" :
765+ "```" :
766 "" :
766 "" :
767 []
767 []
768
768
@@ -866,7 +866,6 @@ instance {-# OVERLAPPABLE #-}
866 t = Proxy :: Proxy '[ct]
866 t = Proxy :: Proxy '[ct]
867 method' = reflectMethod (Proxy :: Proxy method)
867 method' = reflectMethod (Proxy :: Proxy method)
868 status = fromInteger $ natVal (Proxy :: Proxy status)
868 status = fromInteger $ natVal (Proxy :: Proxy status)
869− p = Proxy :: Proxy a
870
869
871instance {-# OVERLAPPING #-}
870instance {-# OVERLAPPING #-}
872 (ToSample a, AllMimeRender (ct ': cts) a, KnownNat status
871 (ToSample a, AllMimeRender (ct ': cts) a, KnownNat status