create-specra 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +21 -0
- package/README.md +137 -0
- package/package.json +42 -0
- package/templates/minimal/README.md +132 -0
- package/templates/minimal/app/api/mdx-watch/route.ts +80 -0
- package/templates/minimal/app/docs/[version]/[...slug]/loading.tsx +7 -0
- package/templates/minimal/app/docs/[version]/[...slug]/page.tsx +212 -0
- package/templates/minimal/app/docs/[version]/not-found.tsx +10 -0
- package/templates/minimal/app/docs/[version]/page.tsx +27 -0
- package/templates/minimal/app/globals.css +1 -0
- package/templates/minimal/app/layout.tsx +89 -0
- package/templates/minimal/app/page.tsx +185 -0
- package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
- package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
- package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
- package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
- package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
- package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
- package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
- package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
- package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
- package/templates/minimal/docs/v1.0.0/index.mdx +29 -0
- package/templates/minimal/middleware.ts +23 -0
- package/templates/minimal/next.config.default.mjs +36 -0
- package/templates/minimal/next.config.export.mjs +62 -0
- package/templates/minimal/next.config.mjs +18 -0
- package/templates/minimal/package-lock.json +7338 -0
- package/templates/minimal/package.json +32 -0
- package/templates/minimal/postcss.config.mjs +8 -0
- package/templates/minimal/public/api-specs/openapi-example.json +259 -0
- package/templates/minimal/public/api-specs/postman-example.json +205 -0
- package/templates/minimal/public/api-specs/test-api.json +256 -0
- package/templates/minimal/public/api-specs/users-api.json +264 -0
- package/templates/minimal/scripts/generate-redirects.mjs +88 -0
- package/templates/minimal/scripts/index-search.ts +159 -0
- package/templates/minimal/scripts/test-search.ts +83 -0
- package/templates/minimal/specra.config.json +124 -0
- package/templates/minimal/tsconfig.json +41 -0
- package/templates/minimal/yarn.lock +3909 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuration
|
|
3
|
+
description: Configure your Specra documentation site with specra.config.json
|
|
4
|
+
sidebar_position: 3
|
|
5
|
+
icon: cog
|
|
6
|
+
tab_group: guides
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Specra uses a centralized configuration file `specra.config.json` at the project root to manage all settings.
|
|
10
|
+
|
|
11
|
+
## Complete Configuration Example
|
|
12
|
+
|
|
13
|
+
Here's a complete example showing all available configuration options:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"$schema": "./lib/config.types.ts",
|
|
18
|
+
"site": {
|
|
19
|
+
"title": "Documentation Library",
|
|
20
|
+
"description": "Comprehensive documentation for your project",
|
|
21
|
+
"url": "https://your-docs.com",
|
|
22
|
+
"baseUrl": "/",
|
|
23
|
+
"language": "en",
|
|
24
|
+
"organizationName": "Your Organization",
|
|
25
|
+
"projectName": "your-project",
|
|
26
|
+
"activeVersion": "v1.0.0",
|
|
27
|
+
"favicon": "/icon-light-32x32.png"
|
|
28
|
+
},
|
|
29
|
+
"theme": {
|
|
30
|
+
"defaultMode": "system",
|
|
31
|
+
"respectPrefersColorScheme": true
|
|
32
|
+
},
|
|
33
|
+
"navigation": {
|
|
34
|
+
"showSidebar": true,
|
|
35
|
+
"collapsibleSidebar": true,
|
|
36
|
+
"showBreadcrumbs": true,
|
|
37
|
+
"showTableOfContents": true,
|
|
38
|
+
"tocPosition": "right",
|
|
39
|
+
"tocMaxDepth": 3,
|
|
40
|
+
"tabGroups": [
|
|
41
|
+
{
|
|
42
|
+
"id": "guides",
|
|
43
|
+
"label": "Guides",
|
|
44
|
+
"icon": "book-open"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "api",
|
|
48
|
+
"label": "API Reference",
|
|
49
|
+
"icon": "zap"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"social": {
|
|
54
|
+
"github": "https://github.com/your-org/your-repo",
|
|
55
|
+
"twitter": "https://twitter.com/your-handle",
|
|
56
|
+
"discord": "https://discord.gg/your-server",
|
|
57
|
+
"custom": [
|
|
58
|
+
{
|
|
59
|
+
"label": "Website",
|
|
60
|
+
"href": "https://yourwebsite.com"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"search": {
|
|
65
|
+
"enabled": true,
|
|
66
|
+
"placeholder": "Search documentation...",
|
|
67
|
+
"provider": "meilisearch",
|
|
68
|
+
"meilisearch": {
|
|
69
|
+
"host": "http://localhost:7700",
|
|
70
|
+
"apiKey": "your-api-key",
|
|
71
|
+
"indexName": "docs"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"analytics": {
|
|
75
|
+
"googleAnalytics": "G-XXXXXXXXXX",
|
|
76
|
+
"plausible": "your-domain.com"
|
|
77
|
+
},
|
|
78
|
+
"footer": {
|
|
79
|
+
"copyright": "Copyright © 2024 Your Organization. All rights reserved.",
|
|
80
|
+
"links": [
|
|
81
|
+
{
|
|
82
|
+
"title": "Documentation",
|
|
83
|
+
"items": [
|
|
84
|
+
{
|
|
85
|
+
"label": "Getting Started",
|
|
86
|
+
"href": "/docs/v1.0.0/getting-started"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"label": "API Reference",
|
|
90
|
+
"href": "/docs/v1.0.0/api-overview"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"title": "Community",
|
|
96
|
+
"items": [
|
|
97
|
+
{
|
|
98
|
+
"label": "GitHub",
|
|
99
|
+
"href": "https://github.com/your-org/your-repo"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"label": "Discord",
|
|
103
|
+
"href": "https://discord.gg/your-server"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"banner": {
|
|
110
|
+
"enabled": true,
|
|
111
|
+
"message": "�� Version 2.0 is now available!",
|
|
112
|
+
"type": "info",
|
|
113
|
+
"dismissible": true
|
|
114
|
+
},
|
|
115
|
+
"features": {
|
|
116
|
+
"editUrl": "https://github.com/your-org/your-repo/edit/main/docs",
|
|
117
|
+
"showLastUpdated": true,
|
|
118
|
+
"showReadingTime": true,
|
|
119
|
+
"showAuthors": false,
|
|
120
|
+
"showTags": true,
|
|
121
|
+
"versioning": true,
|
|
122
|
+
"i18n": false
|
|
123
|
+
},
|
|
124
|
+
"env": {
|
|
125
|
+
"API_BASE_URL": "https://api.example.com",
|
|
126
|
+
"API_VERSION": "v1",
|
|
127
|
+
"CDN_URL": "https://cdn.example.com"
|
|
128
|
+
},
|
|
129
|
+
"deployment": {
|
|
130
|
+
"target": "vercel",
|
|
131
|
+
"basePath": "",
|
|
132
|
+
"customDomain": false
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
<Callout type="tip">
|
|
138
|
+
Copy this complete configuration as a starting point and customize it for your needs.
|
|
139
|
+
</Callout>
|
|
140
|
+
|
|
141
|
+
## Site Configuration
|
|
142
|
+
|
|
143
|
+
Core metadata and branding for your documentation site.
|
|
144
|
+
|
|
145
|
+
| Option | Type | Description |
|
|
146
|
+
|--------|------|-------------|
|
|
147
|
+
| `title` | string | Site title (shown in header and browser tab) |
|
|
148
|
+
| `description` | string | Meta description for SEO |
|
|
149
|
+
| `url` | string | Full URL where docs are hosted |
|
|
150
|
+
| `baseUrl` | string | Base path (default: `/`) |
|
|
151
|
+
| `language` | string | Language code (default: `en`) |
|
|
152
|
+
| `activeVersion` | string | Default documentation version |
|
|
153
|
+
| `organizationName` | string | Your organization name |
|
|
154
|
+
| `projectName` | string | Project name |
|
|
155
|
+
|
|
156
|
+
## Theme Configuration
|
|
157
|
+
|
|
158
|
+
Control the appearance and color scheme.
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"theme": {
|
|
163
|
+
"defaultMode": "system",
|
|
164
|
+
"respectPrefersColorScheme": true
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Option | Type | Description |
|
|
170
|
+
|--------|------|-------------|
|
|
171
|
+
| `defaultMode` | `"light" \| "dark" \| "system"` | Default theme mode |
|
|
172
|
+
| `respectPrefersColorScheme` | boolean | Follow system theme preference |
|
|
173
|
+
|
|
174
|
+
## Navigation Configuration
|
|
175
|
+
|
|
176
|
+
Control sidebar, breadcrumbs, and table of contents.
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"navigation": {
|
|
181
|
+
"showSidebar": true,
|
|
182
|
+
"collapsibleSidebar": true,
|
|
183
|
+
"showBreadcrumbs": true,
|
|
184
|
+
"showTableOfContents": true,
|
|
185
|
+
"tocPosition": "right",
|
|
186
|
+
"tocMaxDepth": 3
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
| Option | Type | Description |
|
|
192
|
+
|--------|------|-------------|
|
|
193
|
+
| `showSidebar` | boolean | Show/hide the sidebar |
|
|
194
|
+
| `collapsibleSidebar` | boolean | Allow sections to collapse |
|
|
195
|
+
| `showBreadcrumbs` | boolean | Show breadcrumb navigation |
|
|
196
|
+
| `showTableOfContents` | boolean | Show table of contents |
|
|
197
|
+
| `tocPosition` | `"left" \| "right"` | TOC position |
|
|
198
|
+
| `tocMaxDepth` | number | Maximum heading depth for TOC (1-6) |
|
|
199
|
+
|
|
200
|
+
## Search Configuration
|
|
201
|
+
|
|
202
|
+
Configure the search functionality.
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"search": {
|
|
207
|
+
"enabled": true,
|
|
208
|
+
"placeholder": "Search documentation...",
|
|
209
|
+
"provider": "meilisearch",
|
|
210
|
+
"meilisearch": {
|
|
211
|
+
"host": "http://localhost:7700",
|
|
212
|
+
"apiKey": "your-api-key",
|
|
213
|
+
"indexName": "docs"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
<Callout type="info">
|
|
220
|
+
Press **⌘K** (Mac) or **Ctrl+K** (Windows/Linux) to open the search modal.
|
|
221
|
+
</Callout>
|
|
222
|
+
|
|
223
|
+
## Social Links
|
|
224
|
+
|
|
225
|
+
Add links to your social profiles and repositories.
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"social": {
|
|
230
|
+
"github": "https://github.com/your-org/your-repo",
|
|
231
|
+
"twitter": "https://twitter.com/yourhandle",
|
|
232
|
+
"discord": "https://discord.gg/yourserver"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Features Configuration
|
|
238
|
+
|
|
239
|
+
Toggle documentation features.
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"features": {
|
|
244
|
+
"editUrl": "https://github.com/your-org/repo/edit/main/docs",
|
|
245
|
+
"showLastUpdated": true,
|
|
246
|
+
"showReadingTime": true,
|
|
247
|
+
"showAuthors": false,
|
|
248
|
+
"showTags": true,
|
|
249
|
+
"versioning": true
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
| Option | Type | Description |
|
|
255
|
+
|--------|------|-------------|
|
|
256
|
+
| `editUrl` | string | Base URL for "Edit this page" links |
|
|
257
|
+
| `showLastUpdated` | boolean | Show last updated date |
|
|
258
|
+
| `showReadingTime` | boolean | Show estimated reading time |
|
|
259
|
+
| `showAuthors` | boolean | Show author information |
|
|
260
|
+
| `showTags` | boolean | Show document tags |
|
|
261
|
+
| `versioning` | boolean | Enable version switcher |
|
|
262
|
+
|
|
263
|
+
## Environment Variables
|
|
264
|
+
|
|
265
|
+
Define custom environment variables that can be used in your MDX content:
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"env": {
|
|
270
|
+
"API_BASE_URL": "https://api.example.com",
|
|
271
|
+
"API_VERSION": "v1"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Use them in MDX with `${VARIABLE_NAME}` or `{{VARIABLE_NAME}}` syntax:
|
|
277
|
+
|
|
278
|
+
```mdx
|
|
279
|
+
The API is available at ${API_BASE_URL}/users
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Banner Configuration
|
|
283
|
+
|
|
284
|
+
Show a site-wide banner for announcements.
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"banner": {
|
|
289
|
+
"enabled": true,
|
|
290
|
+
"message": "🎉 Version 2.0 is now available!",
|
|
291
|
+
"type": "info",
|
|
292
|
+
"dismissible": true
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
| Option | Type | Description |
|
|
298
|
+
|--------|------|-------------|
|
|
299
|
+
| `enabled` | boolean | Show/hide the banner |
|
|
300
|
+
| `message` | string | Banner message text |
|
|
301
|
+
| `type` | `"info" \| "warning" \| "error"` | Banner style |
|
|
302
|
+
| `dismissible` | boolean | Allow users to dismiss |
|
|
303
|
+
|
|
304
|
+
## Footer Configuration
|
|
305
|
+
|
|
306
|
+
Customize the footer links.
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"footer": {
|
|
311
|
+
"copyright": "© 2024 Your Organization",
|
|
312
|
+
"links": [
|
|
313
|
+
{
|
|
314
|
+
"title": "Documentation",
|
|
315
|
+
"items": [
|
|
316
|
+
{ "label": "Getting Started", "href": "/docs/v1.0.0/getting-started" }
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
```
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Features
|
|
3
|
+
description: Explore all the features of the Specra documentation platform
|
|
4
|
+
sidebar_position: 4
|
|
5
|
+
icon: scroll-text
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Content Features
|
|
9
|
+
|
|
10
|
+
### MDX Support
|
|
11
|
+
|
|
12
|
+
Write documentation in MDX—Markdown with React components built in.
|
|
13
|
+
|
|
14
|
+
```mdx
|
|
15
|
+
# Hello World
|
|
16
|
+
|
|
17
|
+
This is **Markdown** with a <Badge variant="success">React component</Badge>!
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
<Callout type="tip">
|
|
21
|
+
MDX lets you create interactive, dynamic documentation that goes beyond static text.
|
|
22
|
+
</Callout>
|
|
23
|
+
|
|
24
|
+
### Syntax Highlighting
|
|
25
|
+
|
|
26
|
+
Code blocks automatically get syntax highlighting with line numbers:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
interface User {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
email: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function greetUser(user: User): string {
|
|
36
|
+
return `Hello, ${user.name}!`;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Supported languages include JavaScript, TypeScript, Python, Bash, JSON, CSS, and many more.
|
|
41
|
+
|
|
42
|
+
### Math Equations
|
|
43
|
+
|
|
44
|
+
Render mathematical equations using KaTeX:
|
|
45
|
+
|
|
46
|
+
Inline: <Math>{"E = mc^2"}</Math>
|
|
47
|
+
|
|
48
|
+
Block:
|
|
49
|
+
<Math block>
|
|
50
|
+
{"\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}"}
|
|
51
|
+
</Math>
|
|
52
|
+
|
|
53
|
+
### Mermaid Diagrams
|
|
54
|
+
|
|
55
|
+
Create diagrams from text using Mermaid:
|
|
56
|
+
|
|
57
|
+
<Mermaid
|
|
58
|
+
chart={`
|
|
59
|
+
graph LR
|
|
60
|
+
A[Write MDX] --> B[Build]
|
|
61
|
+
B --> C[Deploy]
|
|
62
|
+
C --> D[Users Read Docs]
|
|
63
|
+
`}
|
|
64
|
+
caption="Documentation workflow"
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
## Navigation Features
|
|
68
|
+
|
|
69
|
+
### Automatic Sidebar
|
|
70
|
+
|
|
71
|
+
The sidebar is automatically generated from your folder structure. Use `_category_.json` to customize:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"label": "Guides",
|
|
76
|
+
"position": 2,
|
|
77
|
+
"collapsible": true,
|
|
78
|
+
"collapsed": false
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Table of Contents
|
|
83
|
+
|
|
84
|
+
A floating table of contents is automatically generated from your headings. It highlights the current section as you scroll.
|
|
85
|
+
|
|
86
|
+
### Breadcrumbs
|
|
87
|
+
|
|
88
|
+
Breadcrumb navigation helps users understand their location in the documentation hierarchy.
|
|
89
|
+
|
|
90
|
+
### Version Switcher
|
|
91
|
+
|
|
92
|
+
Support multiple documentation versions with easy switching:
|
|
93
|
+
|
|
94
|
+
- `/docs/v1.0.0/getting-started`
|
|
95
|
+
- `/docs/v2.0.0/getting-started`
|
|
96
|
+
- `/docs/next/getting-started` (unreleased)
|
|
97
|
+
|
|
98
|
+
## Search
|
|
99
|
+
|
|
100
|
+
### Full-Text Search
|
|
101
|
+
|
|
102
|
+
Powered by Meilisearch for instant, typo-tolerant search results.
|
|
103
|
+
|
|
104
|
+
- **Keyboard shortcut**: Press `⌘K` or `Ctrl+K` to open search
|
|
105
|
+
- **Typo tolerance**: Finds results even with spelling mistakes
|
|
106
|
+
- **Highlighted results**: See where your query matches
|
|
107
|
+
|
|
108
|
+
### Search Indexing
|
|
109
|
+
|
|
110
|
+
Documentation is automatically indexed at build time for fast search.
|
|
111
|
+
|
|
112
|
+
## Theme & Styling
|
|
113
|
+
|
|
114
|
+
### Dark Mode
|
|
115
|
+
|
|
116
|
+
Automatic dark mode that respects system preferences:
|
|
117
|
+
|
|
118
|
+
- Light mode
|
|
119
|
+
- Dark mode
|
|
120
|
+
- System preference (auto)
|
|
121
|
+
|
|
122
|
+
Toggle with the button in the header.
|
|
123
|
+
|
|
124
|
+
### Customizable Design
|
|
125
|
+
|
|
126
|
+
All styling is based on CSS variables and Tailwind, making customization easy:
|
|
127
|
+
|
|
128
|
+
```css
|
|
129
|
+
:root {
|
|
130
|
+
--primary: oklch(0.55 0.22 264.376);
|
|
131
|
+
--background: oklch(1 0 0);
|
|
132
|
+
--foreground: oklch(0.145 0 0);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Components
|
|
137
|
+
|
|
138
|
+
### Rich Component Library
|
|
139
|
+
|
|
140
|
+
Built-in components for common documentation patterns:
|
|
141
|
+
|
|
142
|
+
<CardGrid cols={3}>
|
|
143
|
+
<Card icon="message-square" title="Callouts" description="Info, warning, tip, error alerts" />
|
|
144
|
+
<Card icon="layers" title="Tabs" description="Tabbed content sections" />
|
|
145
|
+
<Card icon="list" title="Steps" description="Step-by-step guides" />
|
|
146
|
+
<Card icon="chevrons-up-down" title="Accordion" description="Collapsible content" />
|
|
147
|
+
<Card icon="grid" title="Cards" description="Feature cards with icons" />
|
|
148
|
+
<Card icon="code" title="Code Blocks" description="Syntax highlighted code" />
|
|
149
|
+
</CardGrid>
|
|
150
|
+
|
|
151
|
+
See the [Components](/docs/v1.0.0/components) section for documentation on each component.
|
|
152
|
+
|
|
153
|
+
## Developer Experience
|
|
154
|
+
|
|
155
|
+
### Hot Reload
|
|
156
|
+
|
|
157
|
+
Changes to MDX files are instantly reflected without a full page refresh.
|
|
158
|
+
|
|
159
|
+
### Frontmatter Validation
|
|
160
|
+
|
|
161
|
+
Frontmatter fields are validated at build time to catch errors early.
|
|
162
|
+
|
|
163
|
+
### SEO Optimization
|
|
164
|
+
|
|
165
|
+
Automatic meta tags, OpenGraph images, and structured data from frontmatter:
|
|
166
|
+
|
|
167
|
+
- Title and description tags
|
|
168
|
+
- OpenGraph and Twitter cards
|
|
169
|
+
- Canonical URLs
|
|
170
|
+
- Sitemap generation
|
|
171
|
+
|
|
172
|
+
### Reading Time
|
|
173
|
+
|
|
174
|
+
Automatic calculation and display of estimated reading time for each page.
|
|
175
|
+
|
|
176
|
+
## Production Features
|
|
177
|
+
|
|
178
|
+
### Static Generation
|
|
179
|
+
|
|
180
|
+
All pages are pre-rendered at build time for maximum performance:
|
|
181
|
+
|
|
182
|
+
- Zero JavaScript required for content
|
|
183
|
+
- Edge caching friendly
|
|
184
|
+
- Fast Time to First Byte (TTFB)
|
|
185
|
+
|
|
186
|
+
### Performance
|
|
187
|
+
|
|
188
|
+
- Lighthouse score: 90+ (desktop)
|
|
189
|
+
- Lazy-loaded images with Next.js Image
|
|
190
|
+
- Code splitting for components
|
|
191
|
+
|
|
192
|
+
### Accessibility
|
|
193
|
+
|
|
194
|
+
- Keyboard navigation
|
|
195
|
+
- Screen reader support
|
|
196
|
+
- High contrast support
|
|
197
|
+
- Focus management
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
description: Set up and start writing documentation with Specra
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
icon: book
|
|
6
|
+
tab_group: guides
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Before you begin, make sure you have:
|
|
12
|
+
- Node.js 18+ installed
|
|
13
|
+
- A package manager (npm, yarn, or pnpm)
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
<Steps>
|
|
18
|
+
<Step title="Clone the Repository">
|
|
19
|
+
```bash
|
|
20
|
+
git clone https://github.com/your-org/specra-docs.git
|
|
21
|
+
cd specra-docs
|
|
22
|
+
```
|
|
23
|
+
</Step>
|
|
24
|
+
|
|
25
|
+
<Step title="Install Dependencies">
|
|
26
|
+
<Tabs defaultValue="npm">
|
|
27
|
+
<Tab label="npm">
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
```
|
|
31
|
+
</Tab>
|
|
32
|
+
<Tab label="yarn">
|
|
33
|
+
```bash
|
|
34
|
+
yarn install
|
|
35
|
+
```
|
|
36
|
+
</Tab>
|
|
37
|
+
<Tab label="pnpm">
|
|
38
|
+
```bash
|
|
39
|
+
pnpm install
|
|
40
|
+
```
|
|
41
|
+
</Tab>
|
|
42
|
+
</Tabs>
|
|
43
|
+
</Step>
|
|
44
|
+
|
|
45
|
+
<Step title="Start Development Server">
|
|
46
|
+
<Tabs defaultValue="npm">
|
|
47
|
+
<Tab label="npm">
|
|
48
|
+
```bash
|
|
49
|
+
npm run dev
|
|
50
|
+
```
|
|
51
|
+
</Tab>
|
|
52
|
+
<Tab label="yarn">
|
|
53
|
+
```bash
|
|
54
|
+
yarn dev
|
|
55
|
+
```
|
|
56
|
+
</Tab>
|
|
57
|
+
<Tab label="pnpm">
|
|
58
|
+
```bash
|
|
59
|
+
pnpm dev
|
|
60
|
+
```
|
|
61
|
+
</Tab>
|
|
62
|
+
</Tabs>
|
|
63
|
+
|
|
64
|
+
Open [http://localhost:3000](http://localhost:3000) to view your docs.
|
|
65
|
+
</Step>
|
|
66
|
+
</Steps>
|
|
67
|
+
|
|
68
|
+
## Creating Documentation
|
|
69
|
+
|
|
70
|
+
<Callout type="warning">
|
|
71
|
+
All documentation files **must use the `.mdx` extension**, not `.md`. MDX enables React components inside your markdown.
|
|
72
|
+
</Callout>
|
|
73
|
+
|
|
74
|
+
### File Structure
|
|
75
|
+
|
|
76
|
+
Documentation lives in the `docs/` folder, organized by version:
|
|
77
|
+
|
|
78
|
+
```txt
|
|
79
|
+
docs/
|
|
80
|
+
├── v1.0.0/ # Version 1.0.0 docs
|
|
81
|
+
│ ├── about.mdx
|
|
82
|
+
│ ├── getting-started.mdx
|
|
83
|
+
│ └── guides/
|
|
84
|
+
│ ├── _category_.json
|
|
85
|
+
│ └── writing-content.mdx
|
|
86
|
+
├── v2.0.0/ # Version 2.0.0 docs
|
|
87
|
+
│ └── ...
|
|
88
|
+
└── next/ # Unreleased/development docs
|
|
89
|
+
└── ...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Creating a New Page
|
|
93
|
+
|
|
94
|
+
1. Create a new `.mdx` file in the appropriate folder
|
|
95
|
+
2. Add frontmatter at the top of the file
|
|
96
|
+
3. Write your content using Markdown and components
|
|
97
|
+
|
|
98
|
+
**Example: `docs/v1.0.0/my-page.mdx`**
|
|
99
|
+
|
|
100
|
+
```mdx
|
|
101
|
+
---
|
|
102
|
+
title: My Page Title
|
|
103
|
+
description: A brief description for SEO
|
|
104
|
+
sidebar_position: 5
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
# My Page Title
|
|
108
|
+
|
|
109
|
+
Your content goes here. You can use **Markdown**
|
|
110
|
+
and <Badge>React components</Badge>.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Frontmatter
|
|
114
|
+
|
|
115
|
+
Every MDX file should have frontmatter at the top. Here are the available fields:
|
|
116
|
+
|
|
117
|
+
| Field | Required | Description |
|
|
118
|
+
|-------|----------|-------------|
|
|
119
|
+
| `title` | ✅ | Page title (used in sidebar and browser tab) |
|
|
120
|
+
| `description` | Recommended | Short description for SEO meta tags |
|
|
121
|
+
| `sidebar_position` | No | Order in the sidebar (lower = higher) |
|
|
122
|
+
| `tab_group` | No | Tab group name |
|
|
123
|
+
| `tags` | No | Array of tags for categorization |
|
|
124
|
+
| `draft` | No | Set `true` to hide in production |
|
|
125
|
+
| `last_updated` | No | Date string for "last updated" display |
|
|
126
|
+
|
|
127
|
+
<Callout type="tip">
|
|
128
|
+
Use `sidebar_position` to control the order of pages in the sidebar. Pages are sorted by this number, then alphabetically.
|
|
129
|
+
</Callout>
|
|
130
|
+
|
|
131
|
+
## Organizing with Folders
|
|
132
|
+
|
|
133
|
+
Create folders to group related documentation:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
docs/v1.0.0/
|
|
137
|
+
├── guides/
|
|
138
|
+
│ ├── _category_.json # Configure folder display
|
|
139
|
+
│ ├── index.mdx # Optional: custom folder landing page
|
|
140
|
+
│ ├── installation.mdx
|
|
141
|
+
│ └── configuration.mdx
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Category Configuration
|
|
145
|
+
|
|
146
|
+
Create `_category_.json` in a folder to customize its sidebar appearance:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"label": "Guides",
|
|
151
|
+
"position": 2,
|
|
152
|
+
"collapsible": true,
|
|
153
|
+
"collapsed": false
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Using Components
|
|
158
|
+
|
|
159
|
+
Specra includes many built-in components. Import is automatic—just use them:
|
|
160
|
+
|
|
161
|
+
```mdx
|
|
162
|
+
<Callout type="info">
|
|
163
|
+
This is an info callout!
|
|
164
|
+
</Callout>
|
|
165
|
+
|
|
166
|
+
<Tabs defaultValue="JavaScript">
|
|
167
|
+
<Tab label="JavaScript">
|
|
168
|
+
JavaScript code here
|
|
169
|
+
</Tab>
|
|
170
|
+
<Tab label="Python">
|
|
171
|
+
Python code here
|
|
172
|
+
</Tab>
|
|
173
|
+
</Tabs>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
See the [Components](/docs/v1.0.0/components) section for all available components.
|
|
177
|
+
|
|
178
|
+
## Next Steps
|
|
179
|
+
|
|
180
|
+
<CardGrid cols={2}>
|
|
181
|
+
<Card icon="settings" title="Configuration" description="Customize your docs site" href="/docs/v1.0.0/configuration" />
|
|
182
|
+
<Card icon="layers" title="Features" description="Explore all platform features" href="/docs/v1.0.0/features" />
|
|
183
|
+
</CardGrid>
|