specra-cli 0.3.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 +33 -0
- package/README.md +246 -0
- package/dist/api-client-VHQARPDT.js +15 -0
- package/dist/api-client-VHQARPDT.js.map +1 -0
- package/dist/chunk-5765WX4D.js +192 -0
- package/dist/chunk-5765WX4D.js.map +1 -0
- package/dist/chunk-72RDEJR2.js +94 -0
- package/dist/chunk-72RDEJR2.js.map +1 -0
- package/dist/chunk-SQ2MMFUZ.js +102 -0
- package/dist/chunk-SQ2MMFUZ.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +242 -0
- package/dist/cli.js.map +1 -0
- package/dist/deploy-V4JO2D6B.js +179 -0
- package/dist/deploy-V4JO2D6B.js.map +1 -0
- package/dist/doctor-ICALAJ4N.js +309 -0
- package/dist/doctor-ICALAJ4N.js.map +1 -0
- package/dist/login-UG3WU7DY.js +92 -0
- package/dist/login-UG3WU7DY.js.map +1 -0
- package/dist/logout-WJKHJZT6.js +24 -0
- package/dist/logout-WJKHJZT6.js.map +1 -0
- package/dist/logs-BLUJPWNO.js +77 -0
- package/dist/logs-BLUJPWNO.js.map +1 -0
- package/dist/projects-LJ57GK3D.js +49 -0
- package/dist/projects-LJ57GK3D.js.map +1 -0
- package/package.json +50 -0
- package/templates/book-docs/.env.sample +1 -0
- 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 +86 -0
- package/templates/book-docs/src/app.html +17 -0
- package/templates/book-docs/src/params/product.ts +7 -0
- package/templates/book-docs/src/routes/+layout.server.ts +14 -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/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/book-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/book-docs/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/book-docs/static/favicon.svg +4 -0
- package/templates/book-docs/svelte.config.js +13 -0
- package/templates/book-docs/tsconfig.json +12 -0
- package/templates/book-docs/vite.config.ts +6 -0
- package/templates/jbrains-docs/.env.sample +1 -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 +86 -0
- package/templates/jbrains-docs/src/app.html +17 -0
- package/templates/jbrains-docs/src/params/product.ts +7 -0
- package/templates/jbrains-docs/src/routes/+layout.server.ts +14 -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/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/jbrains-docs/static/favicon.svg +4 -0
- package/templates/jbrains-docs/svelte.config.js +13 -0
- package/templates/jbrains-docs/tsconfig.json +12 -0
- package/templates/jbrains-docs/vite.config.ts +6 -0
- package/templates/minimal/.env.sample +1 -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/v2.0.0/about.mdx +57 -0
- package/templates/minimal/docs/v2.0.0/components/_category_.json +8 -0
- package/templates/minimal/docs/v2.0.0/components/callout.mdx +83 -0
- package/templates/minimal/docs/v2.0.0/components/code-block.mdx +103 -0
- package/templates/minimal/docs/v2.0.0/components/index.mdx +8 -0
- package/templates/minimal/docs/v2.0.0/components/tabs.mdx +92 -0
- package/templates/minimal/docs/v2.0.0/configuration.mdx +322 -0
- package/templates/minimal/docs/v2.0.0/features.mdx +197 -0
- package/templates/minimal/docs/v2.0.0/getting-started.mdx +183 -0
- package/templates/minimal/gitignore +7 -0
- package/templates/minimal/package.json +29 -0
- package/templates/minimal/postcss.config.mjs +8 -0
- package/templates/minimal/specra.config.json +91 -0
- package/templates/minimal/src/app.css +86 -0
- package/templates/minimal/src/app.html +17 -0
- package/templates/minimal/src/hooks.server.ts +8 -0
- package/templates/minimal/src/params/product.ts +7 -0
- package/templates/minimal/src/routes/+error.svelte +10 -0
- package/templates/minimal/src/routes/+layout.server.ts +14 -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/+page.svelte +149 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/minimal/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/minimal/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/minimal/static/api-specs/openapi-example.json +259 -0
- package/templates/minimal/static/api-specs/postman-example.json +205 -0
- package/templates/minimal/static/api-specs/test-api.json +256 -0
- package/templates/minimal/static/api-specs/users-api.json +264 -0
- package/templates/minimal/static/favicon.svg +4 -0
- package/templates/minimal/svelte.config.js +13 -0
- package/templates/minimal/tsconfig.json +12 -0
- package/templates/minimal/vite.config.ts +6 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Control Flow
|
|
3
|
+
description: Navigation flow and content organization
|
|
4
|
+
sidebar_position: 3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page explains how navigation flow works in the documentation system — how users move between pages and how you control the reading path.
|
|
8
|
+
|
|
9
|
+
## Sidebar Navigation
|
|
10
|
+
|
|
11
|
+
The sidebar is the primary navigation mechanism. It is automatically generated from the file and folder structure in `docs/`:
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
docs/v2.0.0/
|
|
15
|
+
├── home.mdx → Top-level page
|
|
16
|
+
├── getting-started.mdx → Top-level page
|
|
17
|
+
├── basics/
|
|
18
|
+
│ ├── _category_.json → Section configuration
|
|
19
|
+
│ ├── syntax.mdx → Page in section
|
|
20
|
+
│ ├── types.mdx → Page in section
|
|
21
|
+
│ └── control-flow.mdx → Page in section
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Pages are sorted by `sidebar_position`, then alphabetically.
|
|
25
|
+
|
|
26
|
+
## Previous/Next Navigation
|
|
27
|
+
|
|
28
|
+
At the bottom of each page, previous and next links are automatically generated based on the sidebar order. This creates a linear reading path through the documentation.
|
|
29
|
+
|
|
30
|
+
<Callout type="tip">
|
|
31
|
+
Design your `sidebar_position` values to create a logical reading flow from introduction to advanced topics.
|
|
32
|
+
</Callout>
|
|
33
|
+
|
|
34
|
+
## Tab Groups
|
|
35
|
+
|
|
36
|
+
Tab groups split the sidebar into separate tabbed sections. This is useful when documentation covers distinct but related areas:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"navigation": {
|
|
41
|
+
"tabGroups": [
|
|
42
|
+
{ "id": "language", "label": "Language" },
|
|
43
|
+
{ "id": "multiplatform", "label": "Multiplatform" }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Assign categories to tab groups in `_category_.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"label": "Basics",
|
|
54
|
+
"tab_group": "language"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
<Callout type="info">
|
|
59
|
+
Pages not assigned to any tab group appear in all tabs. Use tab groups to separate conceptually different areas of documentation.
|
|
60
|
+
</Callout>
|
|
61
|
+
|
|
62
|
+
## Breadcrumbs
|
|
63
|
+
|
|
64
|
+
Breadcrumbs show the user's current position in the documentation hierarchy:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Home > Basics > Control Flow
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Enable or disable breadcrumbs in configuration:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"navigation": {
|
|
75
|
+
"showBreadcrumbs": true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Version Switching
|
|
81
|
+
|
|
82
|
+
Users can switch between documentation versions using the version selector in the header. The system attempts to navigate to the same page in the selected version.
|
|
83
|
+
|
|
84
|
+
## Linking Between Pages
|
|
85
|
+
|
|
86
|
+
Use standard Markdown links with the full path:
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
[Getting Started](/docs/v2.0.0/getting-started)
|
|
90
|
+
[Basic Syntax](/docs/v2.0.0/basics/syntax)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Cross-Version Links
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
[See v1.0.0 docs](/docs/v1.0.0/getting-started)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Cards as Navigation
|
|
100
|
+
|
|
101
|
+
Use CardGrid for hub pages that direct users to different sections:
|
|
102
|
+
|
|
103
|
+
<CardGrid cols={2}>
|
|
104
|
+
<Card icon="code" title="Basic Syntax" description="The fundamental building blocks" href="/docs/v2.0.0/basics/syntax" />
|
|
105
|
+
<Card icon="layers" title="Types & Variables" description="Type system and declarations" href="/docs/v2.0.0/basics/types" />
|
|
106
|
+
</CardGrid>
|
|
@@ -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/v2.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: '2.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 = "2.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": "2.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/ # Previous version
|
|
123
|
+
├── v2.0.0/ # Current version
|
|
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/ # Previous version docs
|
|
78
|
+
│ └── v2.0.0/ # Current version docs
|
|
79
|
+
├── src/ # Application source
|
|
80
|
+
├── specra.config.json # Configuration
|
|
81
|
+
└── package.json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Hello World
|
|
85
|
+
|
|
86
|
+
Create a new file `docs/v2.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/v2.0.0/basics/syntax" />
|
|
110
|
+
<Card icon="layers" title="Types & Variables" description="Understand the type system" href="/docs/v2.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 v2 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/v2.0.0/getting-started" />
|
|
14
|
+
<Card icon="code" title="Basic Syntax" description="Learn the fundamental syntax and structure" href="/docs/v2.0.0/basics/syntax" />
|
|
15
|
+
<Card icon="layers" title="Types & Variables" description="Understand the type system and variable declarations" href="/docs/v2.0.0/basics/types" />
|
|
16
|
+
<Card icon="wrench" title="Build Tools" description="Configure and use build tools for your projects" href="/docs/v2.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/v2.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 New in v2
|
|
32
|
+
|
|
33
|
+
| Feature | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| **Improved Build Tools** | Faster builds and better error reporting |
|
|
36
|
+
| **Enhanced Type Checking** | Stricter validation and better diagnostics |
|
|
37
|
+
| **New Components** | Additional built-in components for richer content |
|
|
@@ -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.
|