You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/developer-hub/README.md
+83-1Lines changed: 83 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,10 +120,92 @@ Update the `meta.json` file in each section to control navigation. Example:
120
120
- Use proper heading hierarchy (h2, h3, etc.)
121
121
- Link to related documentation when relevant
122
122
123
+
## API Reference Generation
124
+
125
+
The API reference documentation is automatically generated from OpenAPI specifications using the `scripts/generate-docs.ts` script. This script converts OpenAPI specs (from services like Hermes and Fortuna) into MDX documentation files.
126
+
127
+
### What It Does
128
+
129
+
The script performs the following steps:
130
+
131
+
1.**File Generation**: Uses `fumadocs-openapi` to convert OpenAPI specs into MDX files
132
+
- Each API endpoint becomes a separate MDX file
133
+
- Files are organized by product (e.g., `pyth-core`, `entropy`) and service (e.g., `hermes`, `fortuna`)
134
+
135
+
2.**Meta File Generation**: Creates `meta.json` files for navigation
1. Run `pnpm generate:docs` to generate the documentation
183
+
2. The new service will appear in the API reference navigation
184
+
185
+
### Generated Files
186
+
187
+
All generated files are written to `content/docs/api-reference/`:
188
+
189
+
```
190
+
content/docs/api-reference/
191
+
├── meta.json # Root navigation
192
+
├── pyth-core/
193
+
│ ├── meta.json # Product navigation
194
+
│ └── hermes/
195
+
│ ├── meta.json # Service navigation
196
+
│ ├── index.mdx # Service overview page
197
+
│ └── *.mdx # Individual endpoint pages
198
+
└── entropy/
199
+
└── ...
200
+
```
201
+
202
+
**Important**: Generated files should not be edited manually. Any changes will be overwritten the next time the script runs. If you need to customize the documentation, modify the OpenAPI specification or the generation script itself.
203
+
123
204
## Available Commands
124
205
125
206
-`pnpm turbo run start:dev` - Start development server
126
-
-`pnpm turbo run build` - Build the project
207
+
-`pnpm turbo run build` - Build the project (includes API reference generation)
208
+
-`pnpm generate:docs` - Generate API reference documentation manually
127
209
-`pnpm turbo run fix:format` - Format code with Prettier
128
210
-`pnpm turbo run fix:lint:eslint` - Fix ESLint issues
0 commit comments