create-specra 0.1.6 → 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 +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 +14 -19
- package/templates/minimal/specra.config.json +13 -64
- 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 +6 -35
- 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/docs/[version]/[...slug]/loading.tsx +0 -7
- package/templates/minimal/app/docs/[version]/[...slug]/page.tsx +0 -192
- 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 -1
- package/templates/minimal/app/layout.tsx +0 -58
- package/templates/minimal/app/not-found.tsx +0 -10
- package/templates/minimal/app/page.tsx +0 -179
- package/templates/minimal/docs/v1.0.0/index.mdx +0 -29
- package/templates/minimal/next.config.mjs +0 -1
- package/templates/minimal/package-lock.json +0 -6503
- 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 -159
- package/templates/minimal/scripts/test-search.ts +0 -83
- package/templates/minimal/yarn.lock +0 -3940
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Reusable Content
|
|
3
|
+
description: Create reusable content blocks for consistent documentation
|
|
4
|
+
sidebar_position: 3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Reusable content helps you maintain consistency across your documentation by defining content once and using it in multiple places.
|
|
8
|
+
|
|
9
|
+
## Components as Reusable Blocks
|
|
10
|
+
|
|
11
|
+
The built-in component library provides reusable patterns for common documentation needs.
|
|
12
|
+
|
|
13
|
+
### Card Grids
|
|
14
|
+
|
|
15
|
+
Use card grids to create consistent navigation sections across pages:
|
|
16
|
+
|
|
17
|
+
<CardGrid cols={3}>
|
|
18
|
+
<Card icon="zap" title="Fast" description="Optimized for speed" />
|
|
19
|
+
<Card icon="shield" title="Secure" description="Built with security in mind" />
|
|
20
|
+
<Card icon="code" title="Developer First" description="Great developer experience" />
|
|
21
|
+
</CardGrid>
|
|
22
|
+
|
|
23
|
+
### Step-by-Step Patterns
|
|
24
|
+
|
|
25
|
+
Use the Steps component for consistent instructional content:
|
|
26
|
+
|
|
27
|
+
<Steps>
|
|
28
|
+
<Step title="Define the Content">
|
|
29
|
+
Write your content in MDX format with clear, concise language.
|
|
30
|
+
</Step>
|
|
31
|
+
|
|
32
|
+
<Step title="Add Components">
|
|
33
|
+
Enhance your content with interactive components like callouts, tabs, and cards.
|
|
34
|
+
</Step>
|
|
35
|
+
|
|
36
|
+
<Step title="Review and Publish">
|
|
37
|
+
Preview your changes locally, then commit and deploy.
|
|
38
|
+
</Step>
|
|
39
|
+
</Steps>
|
|
40
|
+
|
|
41
|
+
## Consistent Callout Patterns
|
|
42
|
+
|
|
43
|
+
Use standardized callout types across your docs for a consistent reading experience:
|
|
44
|
+
|
|
45
|
+
<Callout type="info">
|
|
46
|
+
**Info callouts** provide supplementary context that helps readers understand a topic better.
|
|
47
|
+
</Callout>
|
|
48
|
+
|
|
49
|
+
<Callout type="warning">
|
|
50
|
+
**Warning callouts** alert readers about potential pitfalls or breaking changes.
|
|
51
|
+
</Callout>
|
|
52
|
+
|
|
53
|
+
<Callout type="tip">
|
|
54
|
+
**Tip callouts** share best practices and shortcuts that improve the reader's workflow.
|
|
55
|
+
</Callout>
|
|
56
|
+
|
|
57
|
+
## Tabbed Content Patterns
|
|
58
|
+
|
|
59
|
+
Use tabs to provide content variations. Common patterns include:
|
|
60
|
+
|
|
61
|
+
### Installation Instructions
|
|
62
|
+
|
|
63
|
+
<Tabs defaultValue="npm">
|
|
64
|
+
<Tab label="npm">
|
|
65
|
+
```bash
|
|
66
|
+
npm install my-package
|
|
67
|
+
```
|
|
68
|
+
</Tab>
|
|
69
|
+
<Tab label="yarn">
|
|
70
|
+
```bash
|
|
71
|
+
yarn add my-package
|
|
72
|
+
```
|
|
73
|
+
</Tab>
|
|
74
|
+
<Tab label="pnpm">
|
|
75
|
+
```bash
|
|
76
|
+
pnpm add my-package
|
|
77
|
+
```
|
|
78
|
+
</Tab>
|
|
79
|
+
</Tabs>
|
|
80
|
+
|
|
81
|
+
### Language Examples
|
|
82
|
+
|
|
83
|
+
<Tabs defaultValue="TypeScript">
|
|
84
|
+
<Tab label="TypeScript">
|
|
85
|
+
```typescript
|
|
86
|
+
const greeting: string = "Hello, world!";
|
|
87
|
+
console.log(greeting);
|
|
88
|
+
```
|
|
89
|
+
</Tab>
|
|
90
|
+
<Tab label="Python">
|
|
91
|
+
```python
|
|
92
|
+
greeting = "Hello, world!"
|
|
93
|
+
print(greeting)
|
|
94
|
+
```
|
|
95
|
+
</Tab>
|
|
96
|
+
<Tab label="Go">
|
|
97
|
+
```go
|
|
98
|
+
package main
|
|
99
|
+
|
|
100
|
+
import "fmt"
|
|
101
|
+
|
|
102
|
+
func main() {
|
|
103
|
+
fmt.Println("Hello, world!")
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
</Tab>
|
|
107
|
+
</Tabs>
|
|
108
|
+
|
|
109
|
+
## Best Practices
|
|
110
|
+
|
|
111
|
+
| Practice | Description |
|
|
112
|
+
|----------|-------------|
|
|
113
|
+
| **Use consistent types** | Always use the same callout type for the same kind of information |
|
|
114
|
+
| **Keep cards brief** | Card descriptions should be one short sentence |
|
|
115
|
+
| **Limit tab count** | Use 2-4 tabs per group for readability |
|
|
116
|
+
| **Name tabs clearly** | Tab labels should be short and descriptive |
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Content Structure
|
|
3
|
+
description: Organize your documentation with folders and categories
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Learn how to organize your documentation into a clear, navigable structure.
|
|
8
|
+
|
|
9
|
+
## File Organization
|
|
10
|
+
|
|
11
|
+
Documentation files live in the `docs/` directory, grouped by version:
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
docs/
|
|
15
|
+
├── v1.0.0/
|
|
16
|
+
│ ├── introduction.mdx
|
|
17
|
+
│ ├── quickstart.mdx
|
|
18
|
+
│ ├── guides/
|
|
19
|
+
│ │ ├── _category_.json
|
|
20
|
+
│ │ ├── installation.mdx
|
|
21
|
+
│ │ └── deployment.mdx
|
|
22
|
+
│ └── reference/
|
|
23
|
+
│ ├── _category_.json
|
|
24
|
+
│ └── api.mdx
|
|
25
|
+
└── v2.0.0/
|
|
26
|
+
└── ...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Categories
|
|
30
|
+
|
|
31
|
+
Folders become sidebar sections. Add a `_category_.json` file to configure each section:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"label": "Guides",
|
|
36
|
+
"position": 2,
|
|
37
|
+
"collapsible": true,
|
|
38
|
+
"collapsed": false,
|
|
39
|
+
"icon": "book-open"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Field | Description |
|
|
44
|
+
|-------|-------------|
|
|
45
|
+
| `label` | Display name in the sidebar |
|
|
46
|
+
| `position` | Order relative to other sections |
|
|
47
|
+
| `collapsible` | Whether the section can be collapsed |
|
|
48
|
+
| `collapsed` | Whether the section starts collapsed |
|
|
49
|
+
| `icon` | Lucide icon name |
|
|
50
|
+
|
|
51
|
+
## Page Ordering
|
|
52
|
+
|
|
53
|
+
Pages within a section are ordered by their `sidebar_position` frontmatter value:
|
|
54
|
+
|
|
55
|
+
```mdx
|
|
56
|
+
---
|
|
57
|
+
title: First Page
|
|
58
|
+
sidebar_position: 1
|
|
59
|
+
---
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
<Callout type="info">
|
|
63
|
+
Pages without a `sidebar_position` are sorted alphabetically after positioned pages.
|
|
64
|
+
</Callout>
|
|
65
|
+
|
|
66
|
+
## Index Pages
|
|
67
|
+
|
|
68
|
+
Create an `index.mdx` in a folder to provide a landing page for that section. When users click the section header in the sidebar, they'll see this page.
|
|
69
|
+
|
|
70
|
+
```txt
|
|
71
|
+
guides/
|
|
72
|
+
├── _category_.json
|
|
73
|
+
├── index.mdx # Landing page for "Guides"
|
|
74
|
+
├── installation.mdx
|
|
75
|
+
└── deployment.mdx
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Best Practices
|
|
79
|
+
|
|
80
|
+
<Steps>
|
|
81
|
+
<Step title="Keep It Flat">
|
|
82
|
+
Avoid deeply nested folders. Two levels of nesting is usually enough for most documentation sites.
|
|
83
|
+
</Step>
|
|
84
|
+
|
|
85
|
+
<Step title="Use Descriptive Names">
|
|
86
|
+
File names become URL slugs. Use lowercase, hyphenated names like `getting-started.mdx`.
|
|
87
|
+
</Step>
|
|
88
|
+
|
|
89
|
+
<Step title="Group Related Content">
|
|
90
|
+
Put related pages in the same folder. This makes the sidebar intuitive and keeps URLs predictable.
|
|
91
|
+
</Step>
|
|
92
|
+
</Steps>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Branding
|
|
3
|
+
description: Customize logos, site title, and brand identity
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Make the documentation site match your brand by customizing the title, description, social links, and footer.
|
|
8
|
+
|
|
9
|
+
## Site Identity
|
|
10
|
+
|
|
11
|
+
Configure basic site information in `specra.config.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"site": {
|
|
16
|
+
"title": "My Project Docs",
|
|
17
|
+
"description": "Official documentation for My Project",
|
|
18
|
+
"url": "https://docs.myproject.com",
|
|
19
|
+
"organizationName": "My Organization",
|
|
20
|
+
"projectName": "my-project"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Field | Description |
|
|
26
|
+
|-------|-------------|
|
|
27
|
+
| `title` | Displayed in the header and browser tab |
|
|
28
|
+
| `description` | Used for SEO meta tags |
|
|
29
|
+
| `url` | Full URL where docs are hosted |
|
|
30
|
+
| `organizationName` | Your company or organization name |
|
|
31
|
+
| `projectName` | Project identifier |
|
|
32
|
+
|
|
33
|
+
## Social Links
|
|
34
|
+
|
|
35
|
+
Add links to your social profiles and repositories:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"social": {
|
|
40
|
+
"github": "https://github.com/your-org/your-repo",
|
|
41
|
+
"twitter": "https://twitter.com/yourhandle",
|
|
42
|
+
"discord": "https://discord.gg/yourserver"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Social links appear as icons in the site header.
|
|
48
|
+
|
|
49
|
+
## Footer
|
|
50
|
+
|
|
51
|
+
Customize the footer with copyright text and link columns:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"footer": {
|
|
56
|
+
"copyright": "Copyright © 2025 My Organization. All rights reserved.",
|
|
57
|
+
"branding": {
|
|
58
|
+
"showBranding": true
|
|
59
|
+
},
|
|
60
|
+
"links": [
|
|
61
|
+
{
|
|
62
|
+
"title": "Documentation",
|
|
63
|
+
"items": [
|
|
64
|
+
{ "label": "Getting Started", "href": "/docs/v2.0.0/quickstart" },
|
|
65
|
+
{ "label": "Concepts", "href": "/docs/v2.0.0/concepts" }
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"title": "Community",
|
|
70
|
+
"items": [
|
|
71
|
+
{ "label": "GitHub", "href": "https://github.com/your-org" }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
<Callout type="info">
|
|
80
|
+
The footer supports multiple link columns. Each column has a title and a list of labeled links.
|
|
81
|
+
</Callout>
|
|
82
|
+
|
|
83
|
+
## Banner
|
|
84
|
+
|
|
85
|
+
Display a site-wide announcement banner:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"banner": {
|
|
90
|
+
"enabled": true,
|
|
91
|
+
"message": "We just launched v2.0 — check out what's new!",
|
|
92
|
+
"type": "info",
|
|
93
|
+
"dismissible": true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
| Option | Type | Description |
|
|
99
|
+
|--------|------|-------------|
|
|
100
|
+
| `enabled` | `boolean` | Show or hide the banner |
|
|
101
|
+
| `message` | `string` | Banner text content |
|
|
102
|
+
| `type` | `"info" \| "warning" \| "error"` | Visual style |
|
|
103
|
+
| `dismissible` | `boolean` | Allow users to close the banner |
|
|
104
|
+
|
|
105
|
+
## Favicon
|
|
106
|
+
|
|
107
|
+
Place your favicon file in the `public/` directory and reference it in `src/app.html`:
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<link rel="icon" href="%sveltekit.assets%/favicon.svg" type="image/svg+xml" />
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
<Callout type="tip">
|
|
114
|
+
Use SVG favicons for crisp rendering at any size and automatic dark mode support.
|
|
115
|
+
</Callout>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Themes
|
|
3
|
+
description: Configure the look and feel of your documentation site
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The platform supports light and dark themes out of the box, with full control over which mode is used by default.
|
|
8
|
+
|
|
9
|
+
## Theme Modes
|
|
10
|
+
|
|
11
|
+
Three theme modes are available:
|
|
12
|
+
|
|
13
|
+
| Mode | Description |
|
|
14
|
+
|------|-------------|
|
|
15
|
+
| `light` | Always use the light theme |
|
|
16
|
+
| `dark` | Always use the dark theme |
|
|
17
|
+
| `system` | Follow the user's operating system preference |
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Set the default theme in `specra.config.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"theme": {
|
|
26
|
+
"defaultMode": "dark",
|
|
27
|
+
"respectPrefersColorScheme": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Option | Type | Default | Description |
|
|
33
|
+
|--------|------|---------|-------------|
|
|
34
|
+
| `defaultMode` | `"light" \| "dark" \| "system"` | `"system"` | Initial theme mode |
|
|
35
|
+
| `respectPrefersColorScheme` | `boolean` | `true` | Whether to detect and follow OS preference |
|
|
36
|
+
|
|
37
|
+
<Callout type="info">
|
|
38
|
+
When `respectPrefersColorScheme` is `true` and `defaultMode` is `"system"`, the site automatically switches themes when the user changes their OS appearance settings.
|
|
39
|
+
</Callout>
|
|
40
|
+
|
|
41
|
+
## Theme Toggle
|
|
42
|
+
|
|
43
|
+
Users can switch themes using the toggle button in the site header. Their preference is saved in local storage and persists across visits.
|
|
44
|
+
|
|
45
|
+
## Customizing Colors
|
|
46
|
+
|
|
47
|
+
All colors are defined as CSS custom properties, making them easy to override:
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
:root {
|
|
51
|
+
--primary: oklch(0.55 0.22 264.376);
|
|
52
|
+
--background: oklch(1 0 0);
|
|
53
|
+
--foreground: oklch(0.145 0 0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dark {
|
|
57
|
+
--primary: oklch(0.65 0.22 264.376);
|
|
58
|
+
--background: oklch(0.145 0 0);
|
|
59
|
+
--foreground: oklch(0.95 0 0);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<Callout type="tip">
|
|
64
|
+
Use the OKLCH color space for perceptually uniform color adjustments. This ensures colors look consistent across light and dark themes.
|
|
65
|
+
</Callout>
|
|
66
|
+
|
|
67
|
+
## Best Practices
|
|
68
|
+
|
|
69
|
+
<Steps>
|
|
70
|
+
<Step title="Choose a Default">
|
|
71
|
+
Pick a default theme that matches your brand. For developer documentation, dark mode is often preferred.
|
|
72
|
+
</Step>
|
|
73
|
+
|
|
74
|
+
<Step title="Test Both Themes">
|
|
75
|
+
Always preview your content in both light and dark modes. Ensure images, diagrams, and code blocks are readable in both.
|
|
76
|
+
</Step>
|
|
77
|
+
|
|
78
|
+
<Step title="Respect User Preference">
|
|
79
|
+
Keep `respectPrefersColorScheme` enabled so users get the theme they expect.
|
|
80
|
+
</Step>
|
|
81
|
+
</Steps>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: Welcome to the documentation
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
icon: book
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Welcome to the v2 documentation. This knowledge base covers everything you need to get started, create content, and customize your site.
|
|
9
|
+
|
|
10
|
+
## Quick Links
|
|
11
|
+
|
|
12
|
+
<CardGrid cols={2}>
|
|
13
|
+
<Card icon="zap" title="Quick Start" description="Get up and running in under 5 minutes" href="/docs/v2.0.0/quickstart" />
|
|
14
|
+
<Card icon="book-open" title="Core Concepts" description="Understand the key ideas behind the platform" href="/docs/v2.0.0/concepts" />
|
|
15
|
+
<Card icon="file-text" title="Content Guide" description="Learn how to write and organize content" href="/docs/v2.0.0/content/formatting" />
|
|
16
|
+
<Card icon="palette" title="Customization" description="Themes, branding, and design options" href="/docs/v2.0.0/customization/themes" />
|
|
17
|
+
</CardGrid>
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
This documentation platform gives you a modern, fast, and beautiful docs experience out of the box. In v2 we've improved performance and added new customization options.
|
|
22
|
+
|
|
23
|
+
- **Versioned documentation** — maintain docs for multiple releases
|
|
24
|
+
- **Dark and light themes** — automatic or manual switching
|
|
25
|
+
- **Rich components** — callouts, tabs, code blocks, cards, and more
|
|
26
|
+
- **Sidebar navigation** — auto-generated from your file structure
|
|
27
|
+
- **Full-text search** — find anything instantly
|
|
28
|
+
|
|
29
|
+
<Callout type="tip">
|
|
30
|
+
Use the sidebar to navigate between sections, or use the search bar to find specific topics.
|
|
31
|
+
</Callout>
|
|
32
|
+
|
|
33
|
+
## What's New in v2
|
|
34
|
+
|
|
35
|
+
| Feature | Description |
|
|
36
|
+
|---------|-------------|
|
|
37
|
+
| **Improved Performance** | Faster page loads and smaller bundle sizes |
|
|
38
|
+
| **New Customization** | More control over themes and branding |
|
|
39
|
+
| **Better Navigation** | Enhanced sidebar and breadcrumb experience |
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quick Start
|
|
3
|
+
description: Get up and running in under 5 minutes
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
icon: zap
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Follow these steps to set up your documentation site and start writing content.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
Before you begin, make sure you have:
|
|
13
|
+
|
|
14
|
+
- **Node.js 18+** installed
|
|
15
|
+
- A package manager (**npm**, **yarn**, or **pnpm**)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
<Step title="Create a New Project">
|
|
21
|
+
Run the CLI to scaffold a new documentation site:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx create-specra my-docs
|
|
25
|
+
```
|
|
26
|
+
</Step>
|
|
27
|
+
|
|
28
|
+
<Step title="Install Dependencies">
|
|
29
|
+
<Tabs defaultValue="npm">
|
|
30
|
+
<Tab label="npm">
|
|
31
|
+
```bash
|
|
32
|
+
cd my-docs && npm install
|
|
33
|
+
```
|
|
34
|
+
</Tab>
|
|
35
|
+
<Tab label="yarn">
|
|
36
|
+
```bash
|
|
37
|
+
cd my-docs && yarn install
|
|
38
|
+
```
|
|
39
|
+
</Tab>
|
|
40
|
+
<Tab label="pnpm">
|
|
41
|
+
```bash
|
|
42
|
+
cd my-docs && pnpm install
|
|
43
|
+
```
|
|
44
|
+
</Tab>
|
|
45
|
+
</Tabs>
|
|
46
|
+
</Step>
|
|
47
|
+
|
|
48
|
+
<Step title="Start the Dev Server">
|
|
49
|
+
<Tabs defaultValue="npm">
|
|
50
|
+
<Tab label="npm">
|
|
51
|
+
```bash
|
|
52
|
+
npm run dev
|
|
53
|
+
```
|
|
54
|
+
</Tab>
|
|
55
|
+
<Tab label="yarn">
|
|
56
|
+
```bash
|
|
57
|
+
yarn dev
|
|
58
|
+
```
|
|
59
|
+
</Tab>
|
|
60
|
+
<Tab label="pnpm">
|
|
61
|
+
```bash
|
|
62
|
+
pnpm dev
|
|
63
|
+
```
|
|
64
|
+
</Tab>
|
|
65
|
+
</Tabs>
|
|
66
|
+
|
|
67
|
+
Your docs site is now running at `http://localhost:5173`.
|
|
68
|
+
</Step>
|
|
69
|
+
</Steps>
|
|
70
|
+
|
|
71
|
+
## Project Structure
|
|
72
|
+
|
|
73
|
+
After scaffolding, your project looks like this:
|
|
74
|
+
|
|
75
|
+
```txt
|
|
76
|
+
my-docs/
|
|
77
|
+
├── docs/
|
|
78
|
+
│ ├── v1.0.0/ # Previous version docs
|
|
79
|
+
│ └── v2.0.0/ # Current version docs
|
|
80
|
+
├── src/ # SvelteKit application
|
|
81
|
+
├── specra.config.json # Site configuration
|
|
82
|
+
└── package.json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
<Callout type="info">
|
|
86
|
+
All documentation lives in the `docs/` directory as `.mdx` files. The sidebar is automatically generated from the folder structure.
|
|
87
|
+
</Callout>
|
|
88
|
+
|
|
89
|
+
## Creating Your First Page
|
|
90
|
+
|
|
91
|
+
Create a new file at `docs/v2.0.0/my-page.mdx`:
|
|
92
|
+
|
|
93
|
+
```mdx
|
|
94
|
+
---
|
|
95
|
+
title: My First Page
|
|
96
|
+
description: A page I just created
|
|
97
|
+
sidebar_position: 10
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
# Hello World
|
|
101
|
+
|
|
102
|
+
This is my first documentation page.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Save the file and it will appear in the sidebar automatically.
|
|
106
|
+
|
|
107
|
+
## Next Steps
|
|
108
|
+
|
|
109
|
+
<CardGrid cols={2}>
|
|
110
|
+
<Card icon="lightbulb" title="Core Concepts" description="Learn the key ideas" href="/docs/v2.0.0/concepts" />
|
|
111
|
+
<Card icon="file-text" title="Formatting" description="Style your content" href="/docs/v2.0.0/content/formatting" />
|
|
112
|
+
</CardGrid>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-docs",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite dev",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"specra": "^0.2.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@sveltejs/adapter-auto": "^3.0.0",
|
|
17
|
+
"@sveltejs/kit": "^2.0.0",
|
|
18
|
+
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
|
19
|
+
"@tailwindcss/postcss": "^4.1.9",
|
|
20
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
21
|
+
"postcss": "^8.5",
|
|
22
|
+
"svelte": "^5.0.0",
|
|
23
|
+
"svelte-check": "^4.0.0",
|
|
24
|
+
"tailwindcss": "^4.1.9",
|
|
25
|
+
"typescript": "^5",
|
|
26
|
+
"vite": "^6.3.0"
|
|
27
|
+
}
|
|
28
|
+
}
|