Skip to content

Commit 74022ea

Browse files
committed
feat: vitepress with 4.x docs
1 parent 9eae910 commit 74022ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2767
-8986
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules
22
/.vuepress/dist
3-
/yarn-error.log
3+
docs/.vitepress/dist
4+
docs/.vitepress/cache

Diff for: .vuepress/4.0.js

-116
This file was deleted.

Diff for: 4.0/getting-started/upgrade.md

-105
This file was deleted.

Diff for: README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Laravel JSON:API Documentation
22

3-
## Versions
3+
This documentation is for the Laravel JSON:API package, which provides a JSON:API 1.0 compliant server for Laravel
4+
applications.
45

5-
| Laravel | PHP | Laravel JSON:API |
6-
|-------------|-------------|--------------------------------|
7-
| ^11.0 | ^8.2 | [^4.0](./4.0/getting-started/) |
8-
| ^10.0 | ^8.1 | [^3.0](./3.0/getting-started/) |
9-
| ^8.76\|^9.0 | ^7.4\|^8.0 | [^2.0](./2.0/getting-started/) |
10-
| ^8.30 | ^7.4\|8.0.* | [^1.0](./1.0/getting-started/) |
6+
We use [Vitepress](https://vitepress.dev/) to generate the documentation.

Diff for: docs/.vitepress/4.x.js

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
const prefix = (base, path, children) => children.map(({text, link}) => ({
2+
text,
3+
link: `${base}/${path}/${link}`,
4+
}));
5+
6+
export default (base) => [
7+
{
8+
text: 'Getting Started',
9+
collapsed: false,
10+
items: prefix(base, 'getting-started', [
11+
{text: 'Installation', link: ''},
12+
{text: 'Upgrade Guide', link: 'upgrade'},
13+
{text: 'Core Concepts', link: 'core-concepts'},
14+
{text: 'Directory Structure', link: 'directory-structure'},
15+
]),
16+
},
17+
{
18+
text: 'Tutorial',
19+
collapsed: true,
20+
items: prefix(base, 'tutorial', [
21+
{text: '1. Getting Started', link: ''},
22+
{text: '2. Models', link: '02-models'},
23+
{text: '3. Server and Schemas', link: '03-server-and-schemas'},
24+
{text: '4. Relationships', link: '04-relationships'},
25+
{text: '5. Creating Resources', link: '05-creating-resources'},
26+
{text: '6. Modifying Resources', link: '06-modifying-resources'},
27+
{text: '7. Deleting Resources', link: '07-deleting-resources'},
28+
{text: '8. Fetching Resources', link: '08-fetching-resources'},
29+
]),
30+
},
31+
{
32+
text: 'Servers',
33+
collapsed: false,
34+
items: prefix(base, 'servers', [
35+
{text: 'The Basics', link: ''},
36+
{text: 'Events', link: 'events'},
37+
]),
38+
},
39+
{
40+
text: 'Schemas',
41+
collapsed: false,
42+
items: prefix(base, 'schemas', [
43+
{text: 'The Basics', link: ''},
44+
{text: 'Identifier', link: 'identifier'},
45+
{text: 'Attributes', link: 'attributes'},
46+
{text: 'Relationships', link: 'relationships'},
47+
{text: 'Eager Loading', link: 'eager-loading'},
48+
{text: 'Sorting', link: 'sorting'},
49+
{text: 'Pagination', link: 'pagination'},
50+
{text: 'Filters', link: 'filters'},
51+
{text: 'Soft Deleting', link: 'soft-deleting'},
52+
]),
53+
},
54+
{
55+
text: 'Routing',
56+
collapsed: false,
57+
items: prefix(base, 'routing', [
58+
{text: 'Routing', link: ''},
59+
{text: 'Controllers', link: 'controllers'},
60+
{text: 'Writing Actions', link: 'writing-actions'},
61+
{text: 'Custom Actions', link: 'custom-actions'},
62+
]),
63+
},
64+
{
65+
text: 'Requests',
66+
collapsed: false,
67+
items: prefix(base, 'requests', [
68+
{text: 'The Basics', link: ''},
69+
{text: 'Authorization', link: 'authorization'},
70+
{text: 'JSON:API Compliance', link: 'compliance'},
71+
{text: 'Resources', link: 'resources'},
72+
{text: 'Query Parameters', link: 'query-parameters'},
73+
]),
74+
},
75+
{
76+
text: 'Responses',
77+
collapsed: false,
78+
items: prefix(base, 'responses', [
79+
{text: 'JSON:API Documents', link: ''},
80+
{text: 'Errors', link: 'errors'},
81+
]),
82+
},
83+
{
84+
text: 'API Resources',
85+
collapsed: true,
86+
items: prefix(base, 'resources', [
87+
{text: 'The Basics', link: ''},
88+
{text: 'Attributes', link: 'attributes'},
89+
{text: 'Relationships', link: 'relationships'},
90+
{text: 'Meta', link: 'meta'},
91+
{text: 'Links', link: 'links'},
92+
]),
93+
},
94+
{
95+
text: 'Digging Deeper',
96+
collapsed: false,
97+
items: prefix(base, 'digging-deeper', [
98+
{text: 'Artisan Console', link: 'artisan'},
99+
{text: 'Countable', link: 'countable'},
100+
{text: 'Localisation', link: 'localisation'},
101+
{text: 'Proxies', link: 'proxies'},
102+
{text: 'Non-Eloquent Models', link: 'non-eloquent'},
103+
{text: 'Polymorphic to Many', link: 'polymorphic-to-many'},
104+
]),
105+
},
106+
{
107+
text: 'Testing',
108+
collapsed: false,
109+
items: prefix(base, 'testing', [
110+
{text: 'Getting Started', link: ''},
111+
{text: 'Resources', link: 'resources'},
112+
{text: 'Relationships', link: 'relationships'},
113+
{text: 'Requests', link: 'requests'},
114+
{text: 'Assertions', link: 'assertions'},
115+
]),
116+
},
117+
];

0 commit comments

Comments
 (0)