Skip to content

Commit

Permalink
fix wrong markdowntype javascript for json (#1389)
Browse files Browse the repository at this point in the history
Co-authored-by: vismaya <vismaya@itpro.tv>
  • Loading branch information
vismaya-kalyan and vismaya authored Apr 30, 2024
1 parent 619337e commit 584dd02
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 43 deletions.
12 changes: 6 additions & 6 deletions doc/tutorial/Docs.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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`):
```javascript
```json
{"msg":"Hello, Alp"}
```
- When 'name' is not specified (`application/json;charset=utf-8`, `application/json`):
```javascript
```json
{"msg":"Hello, anonymous coward"}
```
Expand All @@ -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`):
```javascript
```json
{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
```
Expand All @@ -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`):
```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"}
```
Expand All @@ -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`):
```javascript
```json
{"yCoord":14,"xCoord":3}
````
Expand Down Expand Up @@ -242,7 +242,7 @@ The relevant output of `markdown api2Docs` is now:
- Example (`application/json;charset=utf-8`, `application/json`):
```javascript
```json
{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
```
Expand Down
14 changes: 7 additions & 7 deletions servant-docs/example/greet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):

```javascript
```json
"HELLO, HASKELLER"
```

- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
"Hello, haskeller"
```

Expand All @@ -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`):

```javascript
```json
"HELLO, HASKELLER"
```

- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
"Hello, haskeller"
```

Expand Down Expand Up @@ -90,7 +90,7 @@ And some more

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand Down Expand Up @@ -132,13 +132,13 @@ curl -XDELETE \

- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`, `text/plain;charset=utf-8`):

```javascript
```json
"HELLO, HASKELLER"
```

- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
"Hello, haskeller"
```

Expand Down
57 changes: 28 additions & 29 deletions servant-docs/golden/comprehensive.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -30,7 +30,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -48,7 +48,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -70,7 +70,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -92,7 +92,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -114,7 +114,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -135,7 +135,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -160,7 +160,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -178,7 +178,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -200,7 +200,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -218,7 +218,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
17
```

Expand All @@ -240,7 +240,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -262,7 +262,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -280,7 +280,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -298,7 +298,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -316,7 +316,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -341,7 +341,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -366,7 +366,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -392,7 +392,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -410,7 +410,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
17
```

Expand Down Expand Up @@ -446,7 +446,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -461,7 +461,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
17
```

Expand All @@ -477,7 +477,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -492,7 +492,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json
17
```

Expand All @@ -508,7 +508,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -526,7 +526,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand Down Expand Up @@ -586,7 +586,7 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

Expand All @@ -604,7 +604,6 @@

- Example (`application/json;charset=utf-8`, `application/json`):

```javascript
```json

```

2 changes: 1 addition & 1 deletion servant-docs/src/Servant/Docs/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ markdownWith RenderingOptions{..} api = unlines $
("text", "html") -> "html"
("application", "xml") -> "xml"
("text", "xml") -> "xml"
("application", "json") -> "javascript"
("application", "json") -> "json"
("application", "javascript") -> "javascript"
("text", "css") -> "css"
(_, _) -> ""
Expand Down

0 comments on commit 584dd02

Please sign in to comment.