Skip to content

Commit

Permalink
feat(docs): update code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Sep 5, 2023
1 parent 4c033ca commit 2a16cd3
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 62 deletions.
1 change: 1 addition & 0 deletions src/content/docs/specs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: API Specs
description: All supported API specifications
next: false
prev: false
tableOfContents: false
sidebar:
order: 1
---
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/specs/subscriptions/add-new.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx";

<CoreAction />

```
POST /subscriptions
```http title="Endpoint"
POST /v1/subscriptions
```

This endpoint enables clients to add new subscriptions to the system for the authenticated user. It returns an array of `success` responses for newly added subscriptions, and an array of `failure` responses for subscriptions that couldn't be added.
Expand Down Expand Up @@ -121,8 +121,8 @@ Once this is done, the server should asynchronously verify that there isn't a mo
<Tabs>
<TabItem label="JSON">

```sh
curl --location '/subscriptions' \
```console
$ curl --location '/subscriptions' \
--header 'Content-Type: application/json' \
--data '{
"subscriptions": [
Expand All @@ -146,8 +146,8 @@ Once this is done, the server should asynchronously verify that there isn't a mo
</TabItem>
<TabItem label="XML">

```sh
curl --location '/subscriptions' \
```console
$ curl --location '/subscriptions' \
--header 'Content-Type: application/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<subscriptions>
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/specs/subscriptions/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx";

<CoreAction />

```
DELETE /subscriptions/{guid}
```http title="Endpoint"
DELETE /v1/subscriptions/{guid}
```

This endpoint allows clients to mark a feed as deleted. This prevents the server from updating the feed in the background and prevents the server from returning any information, such as playback positions, related to the given associated feed.
Expand Down Expand Up @@ -50,9 +50,9 @@ If the client attempts to [fetch a deleted subscription](/specs/subscriptions/ge

## Example request

```sh
curl --location --request DELETE \
'/subscriptions/2d8bb39b-8d34-48d4-b223-a0d01eb27d71'
```console
$ curl --location --request DELETE \
'/v1/subscriptions/2d8bb39b-8d34-48d4-b223-a0d01eb27d71'
```

## Example 202 response
Expand Down
48 changes: 24 additions & 24 deletions src/content/docs/specs/subscriptions/get-all.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx";

<CoreAction />

```
GET /subscriptions
```http title="Endpoint"
GET /v1/subscriptions
```

This endpoint enables clients to return all subscription information relating to the authenticated user. It returns pagination information and an array of `subscriptions`.
Expand Down Expand Up @@ -85,18 +85,18 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a `
<Tabs>
<TabItem label="JSON">

```sh
curl -X 'GET' \
'/subscriptions?page=1&per_page=5' \
```console
$ curl -X 'GET' \
'/v1/subscriptions?page=1&per_page=5' \
-H 'accept: application/json'
```

</TabItem>
<TabItem label="XML">

```sh
curl -X 'GET' \
'/subscriptions?page=1&per_page=5' \
```console
$ curl -X 'GET' \
'/v1/subscriptions?page=1&per_page=5' \
-H 'accept: application/xml'
```

Expand All @@ -106,7 +106,7 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a `
<Tabs>
<TabItem label="JSON">

```json
```json {8, 11} collapse={2-4}
{
"total": 1,
"page": 1,
Expand All @@ -126,7 +126,7 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a `
</TabItem>
<TabItem label="XML">

```xml
```xml {8, 11} collapse={3-5}
<?xml version="1.0" encoding="UTF-8"?>
<subscriptions>
<total>1</total>
Expand All @@ -152,18 +152,18 @@ In this scenario, the client requests all subscriptions and specifies a `since`
<Tabs>
<TabItem label="JSON">

```sh
curl -X 'GET' \
'/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \
```console "since=2022-05-30T00%3A00%3A00.000Z"
$ curl -X 'GET' \
'/v1/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \
-H 'accept: application/json'
```

</TabItem>
<TabItem label="XML">

```sh
curl -X 'GET' \
'/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \
```console "since=2022-05-30T00%3A00%3A00.000Z"
$ curl -X 'GET' \
'/v1/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \
-H 'accept: application/xml'
```

Expand All @@ -173,7 +173,7 @@ In this scenario, the client requests all subscriptions and specifies a `since`
<Tabs>
<TabItem label="JSON">

```json
```json {8, 11} collapse={2-4}
{
"total": 1,
"page": 1,
Expand All @@ -193,7 +193,7 @@ In this scenario, the client requests all subscriptions and specifies a `since`
</TabItem>
<TabItem label="XML">

```xml
```xml {8, 11} collapse={3-5}
<?xml version="1.0" encoding="UTF-8"?>
<subscriptions>
<total>1</total>
Expand All @@ -217,18 +217,18 @@ In this scenario, the client requests all subscriptions and specifies a `since`
<Tabs>
<TabItem label="JSON">

```sh
curl -X 'GET' \
'/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \
```console
$ curl -X 'GET' \
'/v1/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \
-H 'accept: application/json'
```

</TabItem>
<TabItem label="XML">

```sh
curl -X 'GET' \
'/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \
```console
$ curl -X 'GET' \
'/v1/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \
-H 'accept: application/xml'
```

Expand Down
26 changes: 13 additions & 13 deletions src/content/docs/specs/subscriptions/get-single.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx";

<CoreAction />

```
GET /subscriptions/{guid}
```http title="Endpoint"
GET /v1/subscriptions/{guid}
```

This endpoint returns subscription information relating to a specific subscription for the authenticated user. It returns the following information:
Expand Down Expand Up @@ -49,18 +49,18 @@ The client should update its local subscription data to match the information re
<Tabs>
<TabItem label="JSON">

```sh
curl -X 'GET' \
'/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \
```console
$ curl -X 'GET' \
'/v1/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \
-H 'accept: application/json'
```

</TabItem>
<TabItem label="XML">

```sh
curl -X 'GET' \
'/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \
```console
$ curl -X 'GET' \
'/v1/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \
-H 'accept: application/xml'
```

Expand All @@ -74,9 +74,9 @@ The client should update its local subscription data to match the information re

```json
{
"feed_url": "https://example.com/feed2",
"guid": "968cb508-803c-493c-8ff2-9e397dadb83c",
"is_subscribed": true
"feed_url": "https://example.com/feed2",
"guid": "968cb508-803c-493c-8ff2-9e397dadb83c",
"is_subscribed": true
}
```

Expand Down Expand Up @@ -104,8 +104,8 @@ If a subscription has been [deleted](/specs/subscriptions/delete), the server mu

```json
{
"code": 410,
"message": "Subscription has been deleted"
"code": 410,
"message": "Subscription has been deleted"
}
```

Expand Down
28 changes: 14 additions & 14 deletions src/content/docs/specs/subscriptions/status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx";

<CoreAction />

```
GET /deletions/{id}
```http title="Endpoint"
GET /v1/deletions/{id}
```

This endpoint enables clients to query the status of a [deletion](/specs/subscriptions/delete). When a client sends a `DELETE` request, the server must respond with a `deletion_id` that can be used with this endpoint to check whether a deletion has been successfully actioned.
Expand All @@ -30,18 +30,18 @@ The client must send the deletion's `id` in the path of the request.
<Tabs>
<TabItem label="JSON">

```sh
curl -X 'GET' \
'/deletions/25' \
```console
$ curl -X 'GET' \
'/v1/deletions/25' \
-H 'accept: application/json'
```

</TabItem>
<TabItem label="XML">

```sh
curl -X 'GET' \
'/deletions/25' \
```console
$ curl -X 'GET' \
'/v1/deletions/25' \
-H 'accept: application/xml'
```

Expand All @@ -57,7 +57,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
<Tabs>
<TabItem label="JSON">

```json
```json {3}
{
"deletion_id": 25,
"status": "SUCCESS",
Expand All @@ -68,7 +68,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
</TabItem>
<TabItem label="XML">

```xml
```xml {3}
<?xml version="1.0" encoding="UTF-8"?>
<deletion>
<deletion_id>25</deletion_id>
Expand All @@ -85,7 +85,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
<Tabs>
<TabItem label="JSON">

```json
```json {3}
{
"deletion_id": 25,
"status": "PENDING",
Expand All @@ -96,7 +96,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
</TabItem>
<TabItem label="XML">

```xml
```xml {3}
<?xml version="1.0" encoding="UTF-8"?>
<deletion>
<deletion_id>25</deletion_id>
Expand All @@ -113,7 +113,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
<Tabs>
<TabItem label="JSON">

```json
```json {3}
{
"deletion_id": 25,
"status": "FAILURE",
Expand All @@ -124,7 +124,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i
</TabItem>
<TabItem label="XML">

```xml
```xml {3}
<?xml version="1.0" encoding="UTF-8"?>
<deletion>
<deletion_id>25</deletion_id>
Expand Down

0 comments on commit 2a16cd3

Please sign in to comment.