Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit 20d0082

Browse files
committed
Minor update
1 parent 022e5f1 commit 20d0082

File tree

8 files changed

+307
-15
lines changed

8 files changed

+307
-15
lines changed

docs/intro.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ https://api.aniapi.com
4545
defaultValue="dotnet"
4646
values={[
4747
{ label: '.NET', value: 'dotnet' },
48-
{/*{ label: 'JS', value: 'js' }*/}
48+
{ label: 'JS', value: 'js' }
4949
]}>
5050
<TabItem value="dotnet"><pre><code className="language-bash">nuget install AniAPI-NET</code></pre></TabItem>
51-
{/*<TabItem value="js"><pre><code className="language-bash">npm install --save AniAPI-JS</code></pre></TabItem>*/}
51+
<TabItem value="js"><pre><code className="language-bash">npm install --save AniAPI-JS</code></pre></TabItem>
5252
</Tabs>

docs/resources/_category_.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Resources",
3+
"position": 8
4+
}

docs/resources/anime.mdx

+216
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
import ApiCodeBlock from '../../src/components/ApiCodeBlock';
6+
const endpoints = [
7+
{ method: 'GET', uri: '/v1/anime/:id' },
8+
{ method: 'GET', uri: '/v1/anime' },
9+
];
10+
11+
# Anime
12+
13+
This is an object representing an Anime show.
14+
The API allows you to retrieve individual Anime as well as a list of them using various filters.
15+
16+
<ApiCodeBlock title="Endpoints" items={endpoints} />
17+
18+
## The Anime object
19+
20+
### Attributes
21+
22+
---
23+
24+
#### id `integer`
25+
26+
Unique identifier for an Anime.
27+
28+
---
29+
30+
#### anilist_id `integer`
31+
32+
*[AniList](https://anilist.co/)* external unique identifier.
33+
34+
---
35+
36+
#### mal_id `integer`
37+
38+
*[MyAnimeList](https://myanimelist.net/)* external unique identifier.
39+
40+
---
41+
42+
#### format `enum`
43+
44+
The show format destination.
45+
46+
```js title="Possible format enum values"
47+
"TV": 0,
48+
"TV_SHORT": 1,
49+
"MOVIE": 2,
50+
"SPECIAL": 3,
51+
"OVA": 4,
52+
"ONA": 5,
53+
"MUSIC": 6
54+
```
55+
56+
---
57+
58+
#### status `enum`
59+
60+
The show global release status.
61+
62+
```js title="Possible status enum values"
63+
"FINISHED": 0,
64+
"RELEASING": 1,
65+
"NOT_YET_RELEASED": 2,
66+
"CANCELLED": 3
67+
```
68+
69+
---
70+
71+
#### titles `array of strings`
72+
73+
A collection of titles organized by localization.
74+
75+
---
76+
77+
#### descriptions `array of strings`
78+
79+
A collection of descriptions organized by localization.
80+
81+
---
82+
83+
#### start_date `date`
84+
85+
The show global release date.
86+
87+
---
88+
89+
#### end_date `date`
90+
91+
The known show global end date.
92+
93+
---
94+
95+
#### season_period `enum`
96+
97+
The season on which the show has been released.
98+
99+
```js title="Possible status enum values"
100+
"WINTER": 0,
101+
"SPRING": 1,
102+
"SUMMER": 2,
103+
"FALL": 3,
104+
"UNKNOWN": 4
105+
```
106+
107+
---
108+
109+
`season_year`
110+
111+
`episodes_count`
112+
113+
`episode_duration`
114+
115+
`trailer_url`
116+
117+
`cover_image`
118+
119+
`cover_color`
120+
121+
`banner_image`
122+
123+
`genres`
124+
125+
`sequel`
126+
127+
`prequel`
128+
129+
`score`
130+
131+
### Example
132+
133+
```js title="Anime object example"
134+
{
135+
"anilist_id": 21,
136+
"mal_id": 21,
137+
"format": 0,
138+
"status": 1,
139+
"titles": {
140+
"en": "One Piece",
141+
"jp": "ワンピース",
142+
"it": "One Piece"
143+
},
144+
"descriptions": {
145+
"en": "Gold Roger was known as the Pirate Ki...",
146+
"it": "Monkey D. Luffy (Nel doppiaggio itali..."
147+
},
148+
"start_date": "1999-10-20T00:00:00Z",
149+
"end_date": "1970-01-01T00:00:00Z",
150+
"season_period": 3,
151+
"season_year": 1999,
152+
"episodes_count": 981,
153+
"episode_duration": 24,
154+
"cover_image": "https://s4.anilist.co/file/anilistcdn/media/anime/cov...",
155+
"cover_color": "#e4a15d",
156+
"banner_image": "https://s4.anilist.co/file/anilistcdn/media/anime/ba...",
157+
"genres": [
158+
"Action",
159+
"Adventure",
160+
"Comedy",
161+
"Drama",
162+
"Fantasy",
163+
"Pirates",
164+
"Shounen",
165+
"Ensemble Cast",
166+
"Super Power",
167+
"Ships",
168+
"Male Protagonist",
169+
"Conspiracy",
170+
"Tragedy",
171+
"Crime",
172+
"Time Skip",
173+
"Politics",
174+
"Boys' Love",
175+
"War",
176+
"Shapeshifting",
177+
"Swordplay",
178+
"Lost Civilization",
179+
"Guns",
180+
"Animals",
181+
"Anachronism",
182+
"Primarily Adult Cast",
183+
"Cyborg",
184+
"Skeleton",
185+
"Espionage",
186+
"Primarily Male Cast",
187+
"Gender Bending",
188+
"Ninja",
189+
"Henshin",
190+
"Real Robot",
191+
"Anti-Hero",
192+
"Mermaid",
193+
"Battle Royale",
194+
"Assassins",
195+
"Tanned Skin",
196+
"Zombie",
197+
"Time Manipulation",
198+
"Kuudere"
199+
],
200+
"score": 86,
201+
"user_status": 0,
202+
"id": 11
203+
}
204+
```
205+
206+
## Retrieve a specific Anime
207+
208+
### Parameters
209+
210+
### Returns
211+
212+
## Get a list of Anime
213+
214+
### Parameters
215+
216+
### Returns

docs/v1/_category_.json

-4
This file was deleted.

docs/v1/resources/_category_.json

-4
This file was deleted.

docs/v1/resources/anime.mdx

-5
This file was deleted.

src/components/ApiCodeBlock.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react';
2+
import styles from './ApiCodeBlock.module.css';
3+
4+
export default function ApiCodeBlock(params) {
5+
const items = [];
6+
7+
const getStyleByMethod = (method) => {
8+
switch (method) {
9+
case 'GET': return styles.getMethod;
10+
case 'PUT': return styles.putMethod;
11+
case 'POST': return styles.postMethod;
12+
case 'DELETE': return styles.deleteMethod;
13+
}
14+
}
15+
16+
for (let i = 0; i < params.items.length; i++) {
17+
const method = params.items[i].method;
18+
const uri = params.items[i].uri;
19+
20+
items.push((
21+
<div>
22+
<span className={`${styles.method} ${getStyleByMethod(method)}`}>
23+
{method}
24+
</span>
25+
{uri}
26+
</div>
27+
));
28+
}
29+
30+
return (
31+
<div className={styles.block}>
32+
<div className={styles.blockHead}>
33+
{params.title}
34+
</div>
35+
<div className={styles.blockBody}>
36+
{items}
37+
</div>
38+
</div>
39+
);
40+
}
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.block {
2+
background-color: rgb(40, 42, 54);
3+
color: rgb(248, 248, 242);
4+
border-radius: var(--ifm-global-radius);
5+
font-size: var(--ifm-code-font-size);
6+
}
7+
8+
.blockHead {
9+
padding: .75rem var(--ifm-pre-padding);
10+
border-bottom: 1px solid var(--ifm-color-emphasis-300);
11+
font-weight: 500;
12+
}
13+
14+
.blockBody {
15+
padding: var(--ifm-pre-padding);
16+
line-height: 2rem;
17+
letter-spacing: 1px;
18+
font-size: 90%;
19+
}
20+
21+
.method {
22+
margin-right: .5rem;
23+
margin-left: 1rem;
24+
font-weight: 700;
25+
}
26+
27+
.getMethod {
28+
color: #196bb2;
29+
}
30+
31+
.putMethod {
32+
color: #c48536;
33+
}
34+
35+
.postMethod {
36+
color: #1fa44e;
37+
}
38+
39+
.deleteMethod {
40+
color: #a22027;
41+
}
42+
43+
.param {
44+
45+
}

0 commit comments

Comments
 (0)