create-specra 0.1.7 → 0.2.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 +16 -4
- package/README.md +53 -17
- package/dist/chunk-3DKWECRK.js +45 -0
- package/dist/chunk-3DKWECRK.js.map +1 -0
- package/dist/chunk-MA7QG54W.js +74 -0
- package/dist/chunk-MA7QG54W.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +33 -0
- package/dist/cli.js.map +1 -0
- package/dist/deploy-SCEMUQNS.js +141 -0
- package/dist/deploy-SCEMUQNS.js.map +1 -0
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/login-NKDRQXRE.js +71 -0
- package/dist/login-NKDRQXRE.js.map +1 -0
- package/dist/logout-H543QEKU.js +20 -0
- package/dist/logout-H543QEKU.js.map +1 -0
- package/dist/logs-YDAUCMAV.js +71 -0
- package/dist/logs-YDAUCMAV.js.map +1 -0
- package/dist/projects-3TAY7EDJ.js +42 -0
- package/dist/projects-3TAY7EDJ.js.map +1 -0
- package/package.json +7 -3
- package/templates/book-docs/docs/v1.0.0/concepts.mdx +89 -0
- package/templates/book-docs/docs/v1.0.0/content/_category_.json +7 -0
- package/templates/book-docs/docs/v1.0.0/content/formatting.mdx +128 -0
- package/templates/book-docs/docs/v1.0.0/content/reusable-content.mdx +116 -0
- package/templates/book-docs/docs/v1.0.0/content/structure.mdx +92 -0
- package/templates/book-docs/docs/v1.0.0/customization/_category_.json +7 -0
- package/templates/book-docs/docs/v1.0.0/customization/branding.mdx +115 -0
- package/templates/book-docs/docs/v1.0.0/customization/themes.mdx +81 -0
- package/templates/book-docs/docs/v1.0.0/introduction.mdx +38 -0
- package/templates/book-docs/docs/v1.0.0/quickstart.mdx +112 -0
- package/templates/book-docs/docs/v2.0.0/concepts.mdx +89 -0
- package/templates/book-docs/docs/v2.0.0/content/_category_.json +7 -0
- package/templates/book-docs/docs/v2.0.0/content/formatting.mdx +128 -0
- package/templates/book-docs/docs/v2.0.0/content/reusable-content.mdx +116 -0
- package/templates/book-docs/docs/v2.0.0/content/structure.mdx +92 -0
- package/templates/book-docs/docs/v2.0.0/customization/_category_.json +7 -0
- package/templates/book-docs/docs/v2.0.0/customization/branding.mdx +115 -0
- package/templates/book-docs/docs/v2.0.0/customization/themes.mdx +81 -0
- package/templates/book-docs/docs/v2.0.0/introduction.mdx +39 -0
- package/templates/book-docs/docs/v2.0.0/quickstart.mdx +112 -0
- package/templates/book-docs/gitignore +7 -0
- package/templates/book-docs/package.json +28 -0
- package/templates/book-docs/postcss.config.mjs +8 -0
- package/templates/book-docs/public/api-specs/openapi-example.json +259 -0
- package/templates/book-docs/public/api-specs/postman-example.json +205 -0
- package/templates/book-docs/public/api-specs/test-api.json +256 -0
- package/templates/book-docs/public/api-specs/users-api.json +264 -0
- package/templates/book-docs/specra.config.json +77 -0
- package/templates/book-docs/src/app.css +2 -0
- package/templates/book-docs/src/app.html +12 -0
- package/templates/book-docs/src/routes/+layout.server.ts +11 -0
- package/templates/book-docs/src/routes/+layout.svelte +21 -0
- package/templates/book-docs/src/routes/+page.server.ts +9 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +119 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +129 -0
- package/templates/book-docs/svelte.config.js +8 -0
- package/templates/book-docs/tsconfig.json +12 -0
- package/templates/book-docs/vite.config.ts +6 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/async.mdx +95 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/generics.mdx +126 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/control-flow.mdx +106 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/syntax.mdx +129 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/types.mdx +135 -0
- package/templates/jbrains-docs/docs/v1.0.0/getting-started.mdx +111 -0
- package/templates/jbrains-docs/docs/v1.0.0/home.mdx +37 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/build-tools.mdx +165 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/testing.mdx +112 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/async.mdx +95 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/generics.mdx +126 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/control-flow.mdx +106 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/syntax.mdx +129 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/types.mdx +135 -0
- package/templates/jbrains-docs/docs/v2.0.0/getting-started.mdx +111 -0
- package/templates/jbrains-docs/docs/v2.0.0/home.mdx +37 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/build-tools.mdx +165 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/testing.mdx +112 -0
- package/templates/jbrains-docs/gitignore +7 -0
- package/templates/jbrains-docs/package.json +28 -0
- package/templates/jbrains-docs/postcss.config.mjs +8 -0
- package/templates/jbrains-docs/public/api-specs/openapi-example.json +259 -0
- package/templates/jbrains-docs/public/api-specs/postman-example.json +205 -0
- package/templates/jbrains-docs/public/api-specs/test-api.json +256 -0
- package/templates/jbrains-docs/public/api-specs/users-api.json +264 -0
- package/templates/jbrains-docs/specra.config.json +80 -0
- package/templates/jbrains-docs/src/app.css +2 -0
- package/templates/jbrains-docs/src/app.html +12 -0
- package/templates/jbrains-docs/src/routes/+layout.server.ts +11 -0
- package/templates/jbrains-docs/src/routes/+layout.svelte +21 -0
- package/templates/jbrains-docs/src/routes/+page.server.ts +9 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +119 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +129 -0
- package/templates/jbrains-docs/svelte.config.js +8 -0
- package/templates/jbrains-docs/tsconfig.json +12 -0
- package/templates/jbrains-docs/vite.config.ts +6 -0
- package/templates/minimal/docs/v1.0.0/about.mdx +3 -3
- package/templates/minimal/docs/v2.0.0/about.mdx +3 -3
- package/templates/minimal/gitignore +7 -0
- package/templates/minimal/package.json +18 -24
- package/templates/minimal/specra.config.json +12 -63
- package/templates/minimal/src/app.css +2 -0
- package/templates/minimal/src/app.html +12 -0
- package/templates/minimal/src/routes/+layout.server.ts +11 -0
- package/templates/minimal/src/routes/+layout.svelte +21 -0
- package/templates/minimal/src/routes/+page.server.ts +9 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +119 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +129 -0
- package/templates/minimal/svelte.config.js +8 -0
- package/templates/minimal/tsconfig.json +7 -36
- package/templates/minimal/vite.config.ts +6 -0
- package/templates/minimal/README.md +0 -132
- package/templates/minimal/app/api/mdx-watch/route.ts +0 -6
- package/templates/minimal/app/api/search/route.ts +0 -75
- package/templates/minimal/app/docs/[version]/[...slug]/loading.tsx +0 -7
- package/templates/minimal/app/docs/[version]/[...slug]/page.tsx +0 -205
- package/templates/minimal/app/docs/[version]/[...slug]/page.tsx.bak +0 -203
- package/templates/minimal/app/docs/[version]/not-found.tsx +0 -10
- package/templates/minimal/app/docs/[version]/page.tsx +0 -27
- package/templates/minimal/app/globals.css +0 -9
- package/templates/minimal/app/layout.tsx +0 -62
- package/templates/minimal/app/not-found.tsx +0 -10
- package/templates/minimal/app/page.tsx +0 -179
- package/templates/minimal/next.config.mjs +0 -1
- package/templates/minimal/package-lock.json +0 -7881
- package/templates/minimal/proxy_.ts +0 -22
- package/templates/minimal/scripts/generate-redirects.mjs +0 -128
- package/templates/minimal/scripts/generate-static-redirects.mjs +0 -115
- package/templates/minimal/scripts/index-search.ts +0 -182
- package/templates/minimal/scripts/test-search.ts +0 -83
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Basic Syntax
|
|
3
|
+
description: Learn the fundamental syntax and structure
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page covers the essential syntax you need to know to start writing documentation content with MDX.
|
|
8
|
+
|
|
9
|
+
## Page Structure
|
|
10
|
+
|
|
11
|
+
Every MDX page starts with frontmatter followed by content:
|
|
12
|
+
|
|
13
|
+
```mdx
|
|
14
|
+
---
|
|
15
|
+
title: Page Title
|
|
16
|
+
description: Page description
|
|
17
|
+
sidebar_position: 1
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
Your content goes here.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The frontmatter is a YAML block enclosed by `---` lines. It defines metadata about the page.
|
|
24
|
+
|
|
25
|
+
## Markdown Basics
|
|
26
|
+
|
|
27
|
+
MDX supports all standard Markdown syntax:
|
|
28
|
+
|
|
29
|
+
### Text Formatting
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
**Bold text**
|
|
33
|
+
*Italic text*
|
|
34
|
+
`Inline code`
|
|
35
|
+
~~Strikethrough~~
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Bold text**, *Italic text*, `Inline code`, ~~Strikethrough~~
|
|
39
|
+
|
|
40
|
+
### Links
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
[Internal link](/docs/v1.0.0/getting-started)
|
|
44
|
+
[External link](https://example.com)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Images
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+

|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Code Blocks
|
|
54
|
+
|
|
55
|
+
Fenced code blocks support syntax highlighting for many languages:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface Document {
|
|
59
|
+
title: string;
|
|
60
|
+
content: string;
|
|
61
|
+
version: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function createDocument(title: string): Document {
|
|
65
|
+
return {
|
|
66
|
+
title,
|
|
67
|
+
content: '',
|
|
68
|
+
version: '1.0.0',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
class Document:
|
|
75
|
+
def __init__(self, title: str):
|
|
76
|
+
self.title = title
|
|
77
|
+
self.content = ""
|
|
78
|
+
self.version = "1.0.0"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Components in MDX
|
|
82
|
+
|
|
83
|
+
MDX lets you use components directly in your Markdown. Components are available globally — no imports needed:
|
|
84
|
+
|
|
85
|
+
```mdx
|
|
86
|
+
<Callout type="info">
|
|
87
|
+
This is a callout component inside MDX.
|
|
88
|
+
</Callout>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
<Callout type="info">
|
|
92
|
+
This is a callout component inside MDX.
|
|
93
|
+
</Callout>
|
|
94
|
+
|
|
95
|
+
## Headings
|
|
96
|
+
|
|
97
|
+
Use headings to create document structure. The table of contents (when enabled) is generated from H2 and H3 headings:
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
## Section (H2)
|
|
101
|
+
### Subsection (H3)
|
|
102
|
+
#### Detail (H4)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
<Callout type="tip">
|
|
106
|
+
Start your content with H2 (`##`). The page title from frontmatter automatically renders as H1.
|
|
107
|
+
</Callout>
|
|
108
|
+
|
|
109
|
+
## Lists
|
|
110
|
+
|
|
111
|
+
### Unordered
|
|
112
|
+
|
|
113
|
+
- First item
|
|
114
|
+
- Second item
|
|
115
|
+
- Nested item
|
|
116
|
+
- Third item
|
|
117
|
+
|
|
118
|
+
### Ordered
|
|
119
|
+
|
|
120
|
+
1. First step
|
|
121
|
+
2. Second step
|
|
122
|
+
3. Third step
|
|
123
|
+
|
|
124
|
+
## Tables
|
|
125
|
+
|
|
126
|
+
| Column A | Column B | Column C |
|
|
127
|
+
|----------|----------|----------|
|
|
128
|
+
| Cell 1 | Cell 2 | Cell 3 |
|
|
129
|
+
| Cell 4 | Cell 5 | Cell 6 |
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Types & Variables
|
|
3
|
+
description: Understand the type system and variable declarations
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page covers how content types and configuration variables work in the documentation platform.
|
|
8
|
+
|
|
9
|
+
## Frontmatter Types
|
|
10
|
+
|
|
11
|
+
Frontmatter fields have specific types that the system validates:
|
|
12
|
+
|
|
13
|
+
| Field | Type | Required | Description |
|
|
14
|
+
|-------|------|----------|-------------|
|
|
15
|
+
| `title` | `string` | Yes | Page title |
|
|
16
|
+
| `description` | `string` | No | SEO description |
|
|
17
|
+
| `sidebar_position` | `number` | No | Sidebar ordering |
|
|
18
|
+
| `icon` | `string` | No | Lucide icon name |
|
|
19
|
+
| `tab_group` | `string` | No | Tab group assignment |
|
|
20
|
+
| `tags` | `string[]` | No | Content tags |
|
|
21
|
+
| `draft` | `boolean` | No | Hide in production |
|
|
22
|
+
|
|
23
|
+
## Configuration Types
|
|
24
|
+
|
|
25
|
+
The `specra.config.json` file uses typed configuration:
|
|
26
|
+
|
|
27
|
+
### Theme Configuration
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
interface ThemeConfig {
|
|
31
|
+
defaultMode: 'light' | 'dark' | 'system';
|
|
32
|
+
respectPrefersColorScheme: boolean;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"theme": {
|
|
41
|
+
"defaultMode": "light",
|
|
42
|
+
"respectPrefersColorScheme": true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Navigation Configuration
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
interface NavigationConfig {
|
|
51
|
+
showSidebar: boolean;
|
|
52
|
+
collapsibleSidebar: boolean;
|
|
53
|
+
showBreadcrumbs: boolean;
|
|
54
|
+
showTableOfContents: boolean;
|
|
55
|
+
tocPosition: 'left' | 'right';
|
|
56
|
+
tocMaxDepth: number;
|
|
57
|
+
tabGroups?: TabGroup[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface TabGroup {
|
|
61
|
+
id: string;
|
|
62
|
+
label: string;
|
|
63
|
+
icon?: string;
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
<Callout type="info">
|
|
68
|
+
Tab groups allow you to split sidebar content into separate sections. Each category folder can be assigned to a tab group using `tab_group` in its `_category_.json`.
|
|
69
|
+
</Callout>
|
|
70
|
+
|
|
71
|
+
### Category Configuration
|
|
72
|
+
|
|
73
|
+
Categories are defined with `_category_.json` files:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
interface CategoryConfig {
|
|
77
|
+
label: string;
|
|
78
|
+
position: number;
|
|
79
|
+
collapsible: boolean;
|
|
80
|
+
collapsed: boolean;
|
|
81
|
+
icon?: string;
|
|
82
|
+
tab_group?: string;
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Example:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"label": "Basics",
|
|
91
|
+
"position": 3,
|
|
92
|
+
"collapsible": true,
|
|
93
|
+
"collapsed": false,
|
|
94
|
+
"icon": "book",
|
|
95
|
+
"tab_group": "language"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Content Variables
|
|
100
|
+
|
|
101
|
+
Environment variables can be defined in configuration and used in content:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"env": {
|
|
106
|
+
"API_URL": "https://api.example.com",
|
|
107
|
+
"VERSION": "1.0.0"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<Callout type="tip">
|
|
113
|
+
Use environment variables for values that change between environments, like API URLs or version numbers.
|
|
114
|
+
</Callout>
|
|
115
|
+
|
|
116
|
+
## Version Variables
|
|
117
|
+
|
|
118
|
+
The documentation supports multiple versions. Each version is a folder under `docs/`:
|
|
119
|
+
|
|
120
|
+
```txt
|
|
121
|
+
docs/
|
|
122
|
+
├── v1.0.0/ # Version 1.0.0
|
|
123
|
+
├── v2.0.0/ # Version 2.0.0
|
|
124
|
+
└── next/ # Development version
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The active version is set in configuration:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"site": {
|
|
132
|
+
"activeVersion": "v1.0.0"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
description: Set up your environment and create your first project
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
icon: rocket
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
This guide walks you through setting up your development environment and writing your first program.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
- **Node.js 18+** installed on your machine
|
|
13
|
+
- A code editor (VS Code recommended)
|
|
14
|
+
- A terminal or command line
|
|
15
|
+
|
|
16
|
+
## Create a Project
|
|
17
|
+
|
|
18
|
+
<Steps>
|
|
19
|
+
<Step title="Scaffold the Project">
|
|
20
|
+
Use the CLI to create a new project:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx create-specra my-project
|
|
24
|
+
```
|
|
25
|
+
</Step>
|
|
26
|
+
|
|
27
|
+
<Step title="Install Dependencies">
|
|
28
|
+
<Tabs defaultValue="npm">
|
|
29
|
+
<Tab label="npm">
|
|
30
|
+
```bash
|
|
31
|
+
cd my-project && npm install
|
|
32
|
+
```
|
|
33
|
+
</Tab>
|
|
34
|
+
<Tab label="yarn">
|
|
35
|
+
```bash
|
|
36
|
+
cd my-project && yarn install
|
|
37
|
+
```
|
|
38
|
+
</Tab>
|
|
39
|
+
<Tab label="pnpm">
|
|
40
|
+
```bash
|
|
41
|
+
cd my-project && pnpm install
|
|
42
|
+
```
|
|
43
|
+
</Tab>
|
|
44
|
+
</Tabs>
|
|
45
|
+
</Step>
|
|
46
|
+
|
|
47
|
+
<Step title="Run the Project">
|
|
48
|
+
<Tabs defaultValue="npm">
|
|
49
|
+
<Tab label="npm">
|
|
50
|
+
```bash
|
|
51
|
+
npm run dev
|
|
52
|
+
```
|
|
53
|
+
</Tab>
|
|
54
|
+
<Tab label="yarn">
|
|
55
|
+
```bash
|
|
56
|
+
yarn dev
|
|
57
|
+
```
|
|
58
|
+
</Tab>
|
|
59
|
+
<Tab label="pnpm">
|
|
60
|
+
```bash
|
|
61
|
+
pnpm dev
|
|
62
|
+
```
|
|
63
|
+
</Tab>
|
|
64
|
+
</Tabs>
|
|
65
|
+
|
|
66
|
+
Open `http://localhost:5173` in your browser.
|
|
67
|
+
</Step>
|
|
68
|
+
</Steps>
|
|
69
|
+
|
|
70
|
+
## Project Structure
|
|
71
|
+
|
|
72
|
+
A newly scaffolded project has this structure:
|
|
73
|
+
|
|
74
|
+
```txt
|
|
75
|
+
my-project/
|
|
76
|
+
├── docs/
|
|
77
|
+
│ ├── v1.0.0/ # Documentation content
|
|
78
|
+
│ └── v2.0.0/ # Another version
|
|
79
|
+
├── src/ # Application source
|
|
80
|
+
├── specra.config.json # Configuration
|
|
81
|
+
└── package.json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Hello World
|
|
85
|
+
|
|
86
|
+
Create a new file `docs/v1.0.0/hello.mdx`:
|
|
87
|
+
|
|
88
|
+
```mdx
|
|
89
|
+
---
|
|
90
|
+
title: Hello World
|
|
91
|
+
sidebar_position: 99
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
# Hello World
|
|
95
|
+
|
|
96
|
+
This is your first documentation page!
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
<Callout type="tip">
|
|
101
|
+
Files are automatically picked up by the sidebar. Use `sidebar_position` to control ordering.
|
|
102
|
+
</Callout>
|
|
103
|
+
|
|
104
|
+
## What's Next
|
|
105
|
+
|
|
106
|
+
Now that you have a running project, explore the language fundamentals:
|
|
107
|
+
|
|
108
|
+
<CardGrid cols={2}>
|
|
109
|
+
<Card icon="code" title="Basic Syntax" description="Learn the fundamental building blocks" href="/docs/v1.0.0/basics/syntax" />
|
|
110
|
+
<Card icon="layers" title="Types & Variables" description="Understand the type system" href="/docs/v1.0.0/basics/types" />
|
|
111
|
+
</CardGrid>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Home
|
|
3
|
+
description: Welcome to the language documentation
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
icon: home
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Welcome to the documentation. Learn the language from basics to advanced topics, and explore multiplatform tooling.
|
|
9
|
+
|
|
10
|
+
## Get Started
|
|
11
|
+
|
|
12
|
+
<CardGrid cols={2}>
|
|
13
|
+
<Card icon="book-open" title="Get Started" description="Set up your environment and write your first program" href="/docs/v1.0.0/getting-started" />
|
|
14
|
+
<Card icon="code" title="Basic Syntax" description="Learn the fundamental syntax and structure" href="/docs/v1.0.0/basics/syntax" />
|
|
15
|
+
<Card icon="layers" title="Types & Variables" description="Understand the type system and variable declarations" href="/docs/v1.0.0/basics/types" />
|
|
16
|
+
<Card icon="wrench" title="Build Tools" description="Configure and use build tools for your projects" href="/docs/v1.0.0/tools/build-tools" />
|
|
17
|
+
</CardGrid>
|
|
18
|
+
|
|
19
|
+
## Language
|
|
20
|
+
|
|
21
|
+
The **Language** section covers everything from basic syntax to advanced features like generics and async programming.
|
|
22
|
+
|
|
23
|
+
<Callout type="info">
|
|
24
|
+
If you're new, start with the [Getting Started](/docs/v1.0.0/getting-started) guide, then work through the Basics section.
|
|
25
|
+
</Callout>
|
|
26
|
+
|
|
27
|
+
## Multiplatform
|
|
28
|
+
|
|
29
|
+
The **Multiplatform** section covers tooling, build systems, and testing across different platforms and environments.
|
|
30
|
+
|
|
31
|
+
## What's in This Documentation
|
|
32
|
+
|
|
33
|
+
| Section | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| **Basics** | Syntax, types, variables, and control flow |
|
|
36
|
+
| **Advanced** | Generics, async programming, and advanced patterns |
|
|
37
|
+
| **Tools** | Build tools, testing frameworks, and project setup |
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Build Tools
|
|
3
|
+
description: Configure and use build tools for your documentation project
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page covers the build tools used to develop, build, and deploy your documentation site.
|
|
8
|
+
|
|
9
|
+
## Development Server
|
|
10
|
+
|
|
11
|
+
Start the development server with hot reload:
|
|
12
|
+
|
|
13
|
+
<Tabs defaultValue="npm">
|
|
14
|
+
<Tab label="npm">
|
|
15
|
+
```bash
|
|
16
|
+
npm run dev
|
|
17
|
+
```
|
|
18
|
+
</Tab>
|
|
19
|
+
<Tab label="yarn">
|
|
20
|
+
```bash
|
|
21
|
+
yarn dev
|
|
22
|
+
```
|
|
23
|
+
</Tab>
|
|
24
|
+
<Tab label="pnpm">
|
|
25
|
+
```bash
|
|
26
|
+
pnpm dev
|
|
27
|
+
```
|
|
28
|
+
</Tab>
|
|
29
|
+
</Tabs>
|
|
30
|
+
|
|
31
|
+
The dev server runs on `http://localhost:5173` by default with:
|
|
32
|
+
- **Hot Module Replacement (HMR)** — instant updates when you edit MDX files
|
|
33
|
+
- **Error overlay** — displays build errors in the browser
|
|
34
|
+
- **Fast startup** — powered by Vite
|
|
35
|
+
|
|
36
|
+
## Production Build
|
|
37
|
+
|
|
38
|
+
Build the site for production:
|
|
39
|
+
|
|
40
|
+
<Tabs defaultValue="npm">
|
|
41
|
+
<Tab label="npm">
|
|
42
|
+
```bash
|
|
43
|
+
npm run build
|
|
44
|
+
```
|
|
45
|
+
</Tab>
|
|
46
|
+
<Tab label="yarn">
|
|
47
|
+
```bash
|
|
48
|
+
yarn build
|
|
49
|
+
```
|
|
50
|
+
</Tab>
|
|
51
|
+
<Tab label="pnpm">
|
|
52
|
+
```bash
|
|
53
|
+
pnpm build
|
|
54
|
+
```
|
|
55
|
+
</Tab>
|
|
56
|
+
</Tabs>
|
|
57
|
+
|
|
58
|
+
This outputs a static site to the `build/` directory.
|
|
59
|
+
|
|
60
|
+
<Callout type="info">
|
|
61
|
+
The production build pre-renders all pages for optimal performance and SEO.
|
|
62
|
+
</Callout>
|
|
63
|
+
|
|
64
|
+
## Preview
|
|
65
|
+
|
|
66
|
+
Preview the production build locally:
|
|
67
|
+
|
|
68
|
+
<Tabs defaultValue="npm">
|
|
69
|
+
<Tab label="npm">
|
|
70
|
+
```bash
|
|
71
|
+
npm run preview
|
|
72
|
+
```
|
|
73
|
+
</Tab>
|
|
74
|
+
<Tab label="yarn">
|
|
75
|
+
```bash
|
|
76
|
+
yarn preview
|
|
77
|
+
```
|
|
78
|
+
</Tab>
|
|
79
|
+
<Tab label="pnpm">
|
|
80
|
+
```bash
|
|
81
|
+
pnpm preview
|
|
82
|
+
```
|
|
83
|
+
</Tab>
|
|
84
|
+
</Tabs>
|
|
85
|
+
|
|
86
|
+
## Vite Configuration
|
|
87
|
+
|
|
88
|
+
The documentation platform uses Vite as its build tool. The default configuration is in `vite.config.ts`:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
92
|
+
import { defineConfig } from 'vite';
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
plugins: [sveltekit()]
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## SvelteKit Configuration
|
|
100
|
+
|
|
101
|
+
SvelteKit is configured in `svelte.config.js`:
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
import { specraConfig } from 'specra/svelte-config';
|
|
105
|
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
106
|
+
|
|
107
|
+
const config = specraConfig({
|
|
108
|
+
vitePreprocess: { vitePreprocess }
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export default config;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## PostCSS & Tailwind
|
|
115
|
+
|
|
116
|
+
Styling is handled by Tailwind CSS via PostCSS. Configuration is in `postcss.config.mjs`:
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
const config = {
|
|
120
|
+
plugins: {
|
|
121
|
+
'@tailwindcss/postcss': {},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default config;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## TypeScript
|
|
129
|
+
|
|
130
|
+
TypeScript is configured in `tsconfig.json` with strict mode enabled:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
135
|
+
"compilerOptions": {
|
|
136
|
+
"strict": true,
|
|
137
|
+
"allowJs": true,
|
|
138
|
+
"checkJs": true
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Type Checking
|
|
144
|
+
|
|
145
|
+
Run the type checker:
|
|
146
|
+
|
|
147
|
+
<Tabs defaultValue="npm">
|
|
148
|
+
<Tab label="npm">
|
|
149
|
+
```bash
|
|
150
|
+
npm run check
|
|
151
|
+
```
|
|
152
|
+
</Tab>
|
|
153
|
+
<Tab label="yarn">
|
|
154
|
+
```bash
|
|
155
|
+
yarn check
|
|
156
|
+
```
|
|
157
|
+
</Tab>
|
|
158
|
+
<Tab label="pnpm">
|
|
159
|
+
```bash
|
|
160
|
+
pnpm check
|
|
161
|
+
```
|
|
162
|
+
</Tab>
|
|
163
|
+
</Tabs>
|
|
164
|
+
|
|
165
|
+
This runs `svelte-kit sync` followed by `svelte-check` to verify your TypeScript types.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Testing
|
|
3
|
+
description: Verify your documentation builds and renders correctly
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page covers strategies for testing your documentation site to ensure content renders correctly and the build succeeds.
|
|
8
|
+
|
|
9
|
+
## Build Verification
|
|
10
|
+
|
|
11
|
+
The simplest test is to run a production build and check for errors:
|
|
12
|
+
|
|
13
|
+
<Tabs defaultValue="npm">
|
|
14
|
+
<Tab label="npm">
|
|
15
|
+
```bash
|
|
16
|
+
npm run build
|
|
17
|
+
```
|
|
18
|
+
</Tab>
|
|
19
|
+
<Tab label="yarn">
|
|
20
|
+
```bash
|
|
21
|
+
yarn build
|
|
22
|
+
```
|
|
23
|
+
</Tab>
|
|
24
|
+
<Tab label="pnpm">
|
|
25
|
+
```bash
|
|
26
|
+
pnpm build
|
|
27
|
+
```
|
|
28
|
+
</Tab>
|
|
29
|
+
</Tabs>
|
|
30
|
+
|
|
31
|
+
The build will fail if:
|
|
32
|
+
- MDX files have syntax errors
|
|
33
|
+
- Frontmatter is malformed
|
|
34
|
+
- Required fields are missing
|
|
35
|
+
|
|
36
|
+
<Callout type="tip">
|
|
37
|
+
Run `npm run build` in your CI pipeline to catch documentation errors before they reach production.
|
|
38
|
+
</Callout>
|
|
39
|
+
|
|
40
|
+
## Type Checking
|
|
41
|
+
|
|
42
|
+
Verify TypeScript types are correct:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run check
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This catches type errors in your SvelteKit configuration and any custom components.
|
|
49
|
+
|
|
50
|
+
## Content Checklist
|
|
51
|
+
|
|
52
|
+
When reviewing documentation changes, verify:
|
|
53
|
+
|
|
54
|
+
| Check | Description |
|
|
55
|
+
|-------|-------------|
|
|
56
|
+
| **Frontmatter** | All pages have `title`, and key pages have `description` |
|
|
57
|
+
| **Links** | Internal links point to existing pages |
|
|
58
|
+
| **Versions** | Content exists in all active version directories |
|
|
59
|
+
| **Sidebar Order** | `sidebar_position` values create a logical reading flow |
|
|
60
|
+
| **Categories** | Each folder has a `_category_.json` with `label` and `position` |
|
|
61
|
+
|
|
62
|
+
## Visual Testing
|
|
63
|
+
|
|
64
|
+
Preview the site locally and check:
|
|
65
|
+
|
|
66
|
+
<Steps>
|
|
67
|
+
<Step title="Start Dev Server">
|
|
68
|
+
Run `npm run dev` and open the site in your browser.
|
|
69
|
+
</Step>
|
|
70
|
+
|
|
71
|
+
<Step title="Check Navigation">
|
|
72
|
+
Verify sidebar links work, breadcrumbs are correct, and previous/next navigation follows the expected order.
|
|
73
|
+
</Step>
|
|
74
|
+
|
|
75
|
+
<Step title="Check Themes">
|
|
76
|
+
Toggle between light and dark themes. Ensure all content is readable in both modes.
|
|
77
|
+
</Step>
|
|
78
|
+
|
|
79
|
+
<Step title="Check Responsive">
|
|
80
|
+
Test on different viewport sizes. The mobile sidebar should collapse into a menu.
|
|
81
|
+
</Step>
|
|
82
|
+
</Steps>
|
|
83
|
+
|
|
84
|
+
## Common Issues
|
|
85
|
+
|
|
86
|
+
### Frontmatter Parsing Errors
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Error: Invalid frontmatter in docs/v1.0.0/page.mdx
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Ensure your frontmatter uses valid YAML syntax and is enclosed by `---` delimiters.
|
|
93
|
+
|
|
94
|
+
### Missing Pages
|
|
95
|
+
|
|
96
|
+
If a page doesn't appear in the sidebar:
|
|
97
|
+
|
|
98
|
+
1. Check the file has the `.mdx` extension (not `.md`)
|
|
99
|
+
2. Verify the file is in the correct version directory
|
|
100
|
+
3. Check if `draft: true` is set in frontmatter
|
|
101
|
+
|
|
102
|
+
### Broken Links
|
|
103
|
+
|
|
104
|
+
If internal links return 404:
|
|
105
|
+
|
|
106
|
+
1. Check the path matches the file structure
|
|
107
|
+
2. Include the version prefix: `/docs/v1.0.0/page-name`
|
|
108
|
+
3. Use the file's slug (filename without `.mdx`), not the title
|
|
109
|
+
|
|
110
|
+
<Callout type="info">
|
|
111
|
+
The dev server shows detailed error messages in the browser overlay. Check the terminal output for build-time errors.
|
|
112
|
+
</Callout>
|