Skip to content

Commit ad71967

Browse files
committed
"user" -> "person" dwyl/app#33 #1
1 parent 853d40b commit ad71967

File tree

5 files changed

+170
-148
lines changed

5 files changed

+170
-148
lines changed

Diff for: src/pages/reference_api/about.mdx

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# About API
22

3-
The About API provides information about the Nextra framework, including its version, features, and capabilities. This endpoint is useful for retrieving metadata about your documentation site and can be utilized in various parts of your application.
3+
The About API provides information about the `Nextra` framework,
4+
including its version, features, and capabilities.
5+
This endpoint is useful for retrieving metadata
6+
about your documentation site and can be utilized
7+
in various parts of your application.
48

59
## GET `/api/about`
610

@@ -9,9 +13,9 @@ The About API provides information about the Nextra framework, including its ver
913

1014
The response includes the following fields:
1115

12-
- `version`: The current version of Nextra.
16+
- `version`: The current version of `Nextra`.
1317
- `features`: A list of features available in this version.
14-
- `description`: A brief description of Nextra.
18+
- `description`: A brief description of `Nextra`.
1519

1620
## Example
1721

Diff for: src/pages/reference_api/index.mdx

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# API Reference Overview
22

3-
The Nextra API Reference provides comprehensive information about the APIs available within the Nextra framework. This documentation is intended for developers who wish to integrate Nextra's features into their own applications or extend its functionality.
3+
The `Nextra` API Reference provides comprehensive information about the APIs
4+
available within the `Nextra` framework.
5+
This documentation is intended for developers
6+
who wish to integrate `Nextra` features into their own applications
7+
or extend its functionality.
48

5-
Explore the various API endpoints and learn how to effectively use them in your projects. Each section includes detailed descriptions, usage examples, and response formats to help you get started quickly and efficiently.
9+
Explore the various API endpoints
10+
and learn how to effectively use them in your projects.
11+
Each section includes detailed descriptions, usage examples,
12+
and response formats to help you get started quickly and efficiently.
613

714
Check out the individual API sections for more details:
815
- [About API](reference_api/about)

Diff for: src/pages/reference_api/person.mdx

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Person API
2+
3+
The `Person` API allows you to manage personal data
4+
within your Nextra-powered documentation site.
5+
This endpoint provides functionalities to create, retrieve, update,
6+
and delete `person` information, making it a crucial component
7+
for any personalized applications.
8+
9+
## Endpoints
10+
11+
### Get Person
12+
13+
Retrieve a list of all persons.
14+
15+
**Endpoint:**
16+
```
17+
GET /api/persons
18+
```
19+
20+
**Response:**
21+
22+
The response includes a list of person objects,
23+
each containing the following fields:
24+
- `id`: The unique identifier for the person.
25+
- `name`: The name of the person.
26+
- `email`: The email address.
27+
- `role`: The role of the person has in the system.
28+
29+
**Example:**
30+
31+
```json
32+
[
33+
{
34+
"id": "1",
35+
"name": "John Doe",
36+
"email": "[email protected]",
37+
"role": "admin"
38+
},
39+
{
40+
"id": "2",
41+
"name": "Jane Smith",
42+
"email": "[email protected]",
43+
"role": "editor"
44+
}
45+
]
46+
```
47+
48+
### Create Person
49+
50+
Add a new user to the system.
51+
52+
**Endpoint:**
53+
```
54+
POST /api/person
55+
```
56+
57+
**Request Body:**
58+
59+
The request body should include the following fields:
60+
- `name` (required): The name of the person.
61+
- `email` (required): The email address of the person.
62+
- `role` (optional): The role of the person. Default is `viewer`.
63+
64+
**Example:**
65+
66+
```json
67+
{
68+
"name": "Alice Johnson",
69+
"email": "[email protected]",
70+
"role": "editor"
71+
}
72+
```
73+
74+
**Response:**
75+
76+
The response includes the created person object.
77+
78+
```json
79+
{
80+
"id": "3",
81+
"name": "Alice Johnson",
82+
"email": "[email protected]",
83+
"role": "editor"
84+
}
85+
```
86+
87+
### Update Person
88+
89+
Modify an existing person's information.
90+
91+
**Endpoint:**
92+
```
93+
PUT /api/person/:id
94+
```
95+
96+
**Request Body:**
97+
98+
The request body can include any of the following fields to update:
99+
- `name` (optional): The name of the person.
100+
- `email` (optional): The email address of the person.
101+
- `role` (optional): The role of the person.
102+
103+
**Example:**
104+
105+
```json
106+
{
107+
"name": "Alice Johnson",
108+
"email": "[email protected]",
109+
"role": "admin"
110+
}
111+
```
112+
113+
**Response:**
114+
115+
The response includes the updated person object.
116+
117+
```json
118+
{
119+
"id": "3",
120+
"name": "Alice Johnson",
121+
"email": "[email protected]",
122+
"role": "admin"
123+
}
124+
```
125+
126+
### Delete Person
127+
128+
Remove a person from the system.
129+
130+
**Endpoint:**
131+
```
132+
DELETE /api/person/:id
133+
```
134+
135+
**Response:**
136+
137+
The response includes a confirmation message.
138+
139+
```json
140+
{
141+
"message": "User deleted successfully."
142+
}
143+
```
144+
145+
## Summary
146+
147+
The Person API provides essential operations
148+
for managing people within your `Nextra` documentation site.
149+
Whether you need to add a new person, update or remove existing ones,
150+
these endpoints offer the flexibility
151+
to handle all person-related tasks efficiently.
152+
For more information on other available APIs,
153+
refer back to the [API Reference](index).

Diff for: src/pages/reference_api/users.mdx

-142
This file was deleted.

Diff for: tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ As you can see, you can group pages together in directories
223223
thus organizing them neatly.
224224

225225
If you want a directory to have its own page,
226-
you can simply add an `index.mdx` file.
226+
you can simply add an `index.mdx` file in the directory.
227227
Let's say we want `api_reference` to have an introductory page
228228
when we click on it on the sidebar.
229229
Simply create the `index.mdx` file:

0 commit comments

Comments
 (0)