change javascript to json

This commit is contained in:
vismaya 2021-01-22 16:02:02 -05:00
parent 0743ca724d
commit 832663a6aa
4 changed files with 42 additions and 43 deletions

View file

@ -132,13 +132,13 @@ That lets us see what our API docs look like in markdown, by looking at `markdow
- When a value is provided for 'name' (`application/json;charset=utf-8`, `application/json`): - When a value is provided for 'name' (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"msg":"Hello, Alp"} {"msg":"Hello, Alp"}
``` ```
- When 'name' is not specified (`application/json;charset=utf-8`, `application/json`): - When 'name' is not specified (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"msg":"Hello, anonymous coward"} {"msg":"Hello, anonymous coward"}
``` ```
@ -153,7 +153,7 @@ That lets us see what our API docs look like in markdown, by looking at `markdow
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]} {"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
``` ```
@ -169,7 +169,7 @@ That lets us see what our API docs look like in markdown, by looking at `markdow
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"subject":"Hey Alp, we miss you!","body":"Hi Alp,\n\nSince you've recently turned 26, have you checked out our latest haskell, mathematics products? Give us a visit!","to":"alp@foo.com","from":"great@company.com"} {"subject":"Hey Alp, we miss you!","body":"Hi Alp,\n\nSince you've recently turned 26, have you checked out our latest haskell, mathematics products? Give us a visit!","to":"alp@foo.com","from":"great@company.com"}
``` ```
@ -192,7 +192,7 @@ That lets us see what our API docs look like in markdown, by looking at `markdow
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"yCoord":14,"xCoord":3} {"yCoord":14,"xCoord":3}
```` ````
@ -242,7 +242,7 @@ The relevant output of `markdown api2Docs` is now:
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]} {"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
``` ```

View file

@ -19,13 +19,13 @@ You'll also note that multiple intros are possible.
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`): - If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
"HELLO, HASKELLER" "HELLO, HASKELLER"
``` ```
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`): - If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
"Hello, haskeller" "Hello, haskeller"
``` ```
@ -41,13 +41,13 @@ You'll also note that multiple intros are possible.
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`): - If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
"HELLO, HASKELLER" "HELLO, HASKELLER"
``` ```
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`): - If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
"Hello, haskeller" "Hello, haskeller"
``` ```
@ -81,7 +81,7 @@ And some more
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -111,12 +111,12 @@ And some more
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`, `text/plain;charset=utf-8`): - If you use ?capital=true (`application/json;charset=utf-8`, `application/json`, `text/plain;charset=utf-8`):
```javascript ```json
"HELLO, HASKELLER" "HELLO, HASKELLER"
``` ```
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`): - If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
"Hello, haskeller" "Hello, haskeller"
``` ```

View file

@ -12,7 +12,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -30,7 +30,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -48,7 +48,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -70,7 +70,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -92,7 +92,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -114,7 +114,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -135,7 +135,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -160,7 +160,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -178,7 +178,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -200,7 +200,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -218,7 +218,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
17 17
``` ```
@ -240,7 +240,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -262,7 +262,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -280,7 +280,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -298,7 +298,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -316,7 +316,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -341,7 +341,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -366,7 +366,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -392,7 +392,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -410,7 +410,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
17 17
``` ```
@ -446,7 +446,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -461,7 +461,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
17 17
``` ```
@ -477,7 +477,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -492,7 +492,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
17 17
``` ```
@ -508,7 +508,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -526,7 +526,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -568,7 +568,7 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```
@ -586,7 +586,6 @@
- Example (`application/json;charset=utf-8`, `application/json`): - Example (`application/json;charset=utf-8`, `application/json`):
```javascript ```json
``` ```

View file

@ -809,7 +809,7 @@ markdownWith RenderingOptions{..} api = unlines $
("text", "html") -> "html" ("text", "html") -> "html"
("application", "xml") -> "xml" ("application", "xml") -> "xml"
("text", "xml") -> "xml" ("text", "xml") -> "xml"
("application", "json") -> "javascript" ("application", "json") -> "json"
("application", "javascript") -> "javascript" ("application", "javascript") -> "javascript"
("text", "css") -> "css" ("text", "css") -> "css"
(_, _) -> "" (_, _) -> ""