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.
Files changed (172) hide show
  1. package/LICENSE.MD +33 -0
  2. package/README.md +246 -0
  3. package/dist/api-client-VHQARPDT.js +15 -0
  4. package/dist/api-client-VHQARPDT.js.map +1 -0
  5. package/dist/chunk-5765WX4D.js +192 -0
  6. package/dist/chunk-5765WX4D.js.map +1 -0
  7. package/dist/chunk-72RDEJR2.js +94 -0
  8. package/dist/chunk-72RDEJR2.js.map +1 -0
  9. package/dist/chunk-SQ2MMFUZ.js +102 -0
  10. package/dist/chunk-SQ2MMFUZ.js.map +1 -0
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.js +242 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/deploy-V4JO2D6B.js +179 -0
  15. package/dist/deploy-V4JO2D6B.js.map +1 -0
  16. package/dist/doctor-ICALAJ4N.js +309 -0
  17. package/dist/doctor-ICALAJ4N.js.map +1 -0
  18. package/dist/login-UG3WU7DY.js +92 -0
  19. package/dist/login-UG3WU7DY.js.map +1 -0
  20. package/dist/logout-WJKHJZT6.js +24 -0
  21. package/dist/logout-WJKHJZT6.js.map +1 -0
  22. package/dist/logs-BLUJPWNO.js +77 -0
  23. package/dist/logs-BLUJPWNO.js.map +1 -0
  24. package/dist/projects-LJ57GK3D.js +49 -0
  25. package/dist/projects-LJ57GK3D.js.map +1 -0
  26. package/package.json +50 -0
  27. package/templates/book-docs/.env.sample +1 -0
  28. package/templates/book-docs/docs/v1.0.0/concepts.mdx +89 -0
  29. package/templates/book-docs/docs/v1.0.0/content/_category_.json +7 -0
  30. package/templates/book-docs/docs/v1.0.0/content/formatting.mdx +128 -0
  31. package/templates/book-docs/docs/v1.0.0/content/reusable-content.mdx +116 -0
  32. package/templates/book-docs/docs/v1.0.0/content/structure.mdx +92 -0
  33. package/templates/book-docs/docs/v1.0.0/customization/_category_.json +7 -0
  34. package/templates/book-docs/docs/v1.0.0/customization/branding.mdx +115 -0
  35. package/templates/book-docs/docs/v1.0.0/customization/themes.mdx +81 -0
  36. package/templates/book-docs/docs/v1.0.0/introduction.mdx +38 -0
  37. package/templates/book-docs/docs/v1.0.0/quickstart.mdx +112 -0
  38. package/templates/book-docs/docs/v2.0.0/concepts.mdx +89 -0
  39. package/templates/book-docs/docs/v2.0.0/content/_category_.json +7 -0
  40. package/templates/book-docs/docs/v2.0.0/content/formatting.mdx +128 -0
  41. package/templates/book-docs/docs/v2.0.0/content/reusable-content.mdx +116 -0
  42. package/templates/book-docs/docs/v2.0.0/content/structure.mdx +92 -0
  43. package/templates/book-docs/docs/v2.0.0/customization/_category_.json +7 -0
  44. package/templates/book-docs/docs/v2.0.0/customization/branding.mdx +115 -0
  45. package/templates/book-docs/docs/v2.0.0/customization/themes.mdx +81 -0
  46. package/templates/book-docs/docs/v2.0.0/introduction.mdx +39 -0
  47. package/templates/book-docs/docs/v2.0.0/quickstart.mdx +112 -0
  48. package/templates/book-docs/gitignore +7 -0
  49. package/templates/book-docs/package.json +28 -0
  50. package/templates/book-docs/postcss.config.mjs +8 -0
  51. package/templates/book-docs/public/api-specs/openapi-example.json +259 -0
  52. package/templates/book-docs/public/api-specs/postman-example.json +205 -0
  53. package/templates/book-docs/public/api-specs/test-api.json +256 -0
  54. package/templates/book-docs/public/api-specs/users-api.json +264 -0
  55. package/templates/book-docs/specra.config.json +77 -0
  56. package/templates/book-docs/src/app.css +86 -0
  57. package/templates/book-docs/src/app.html +17 -0
  58. package/templates/book-docs/src/params/product.ts +7 -0
  59. package/templates/book-docs/src/routes/+layout.server.ts +14 -0
  60. package/templates/book-docs/src/routes/+layout.svelte +21 -0
  61. package/templates/book-docs/src/routes/+page.server.ts +9 -0
  62. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  63. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  64. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  65. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  66. package/templates/book-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  67. package/templates/book-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  68. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  69. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  70. package/templates/book-docs/static/favicon.svg +4 -0
  71. package/templates/book-docs/svelte.config.js +13 -0
  72. package/templates/book-docs/tsconfig.json +12 -0
  73. package/templates/book-docs/vite.config.ts +6 -0
  74. package/templates/jbrains-docs/.env.sample +1 -0
  75. package/templates/jbrains-docs/docs/v1.0.0/advanced/_category_.json +8 -0
  76. package/templates/jbrains-docs/docs/v1.0.0/advanced/async.mdx +95 -0
  77. package/templates/jbrains-docs/docs/v1.0.0/advanced/generics.mdx +126 -0
  78. package/templates/jbrains-docs/docs/v1.0.0/basics/_category_.json +8 -0
  79. package/templates/jbrains-docs/docs/v1.0.0/basics/control-flow.mdx +106 -0
  80. package/templates/jbrains-docs/docs/v1.0.0/basics/syntax.mdx +129 -0
  81. package/templates/jbrains-docs/docs/v1.0.0/basics/types.mdx +135 -0
  82. package/templates/jbrains-docs/docs/v1.0.0/getting-started.mdx +111 -0
  83. package/templates/jbrains-docs/docs/v1.0.0/home.mdx +37 -0
  84. package/templates/jbrains-docs/docs/v1.0.0/tools/_category_.json +8 -0
  85. package/templates/jbrains-docs/docs/v1.0.0/tools/build-tools.mdx +165 -0
  86. package/templates/jbrains-docs/docs/v1.0.0/tools/testing.mdx +112 -0
  87. package/templates/jbrains-docs/docs/v2.0.0/advanced/_category_.json +8 -0
  88. package/templates/jbrains-docs/docs/v2.0.0/advanced/async.mdx +95 -0
  89. package/templates/jbrains-docs/docs/v2.0.0/advanced/generics.mdx +126 -0
  90. package/templates/jbrains-docs/docs/v2.0.0/basics/_category_.json +8 -0
  91. package/templates/jbrains-docs/docs/v2.0.0/basics/control-flow.mdx +106 -0
  92. package/templates/jbrains-docs/docs/v2.0.0/basics/syntax.mdx +129 -0
  93. package/templates/jbrains-docs/docs/v2.0.0/basics/types.mdx +135 -0
  94. package/templates/jbrains-docs/docs/v2.0.0/getting-started.mdx +111 -0
  95. package/templates/jbrains-docs/docs/v2.0.0/home.mdx +37 -0
  96. package/templates/jbrains-docs/docs/v2.0.0/tools/_category_.json +8 -0
  97. package/templates/jbrains-docs/docs/v2.0.0/tools/build-tools.mdx +165 -0
  98. package/templates/jbrains-docs/docs/v2.0.0/tools/testing.mdx +112 -0
  99. package/templates/jbrains-docs/gitignore +7 -0
  100. package/templates/jbrains-docs/package.json +28 -0
  101. package/templates/jbrains-docs/postcss.config.mjs +8 -0
  102. package/templates/jbrains-docs/public/api-specs/openapi-example.json +259 -0
  103. package/templates/jbrains-docs/public/api-specs/postman-example.json +205 -0
  104. package/templates/jbrains-docs/public/api-specs/test-api.json +256 -0
  105. package/templates/jbrains-docs/public/api-specs/users-api.json +264 -0
  106. package/templates/jbrains-docs/specra.config.json +80 -0
  107. package/templates/jbrains-docs/src/app.css +86 -0
  108. package/templates/jbrains-docs/src/app.html +17 -0
  109. package/templates/jbrains-docs/src/params/product.ts +7 -0
  110. package/templates/jbrains-docs/src/routes/+layout.server.ts +14 -0
  111. package/templates/jbrains-docs/src/routes/+layout.svelte +21 -0
  112. package/templates/jbrains-docs/src/routes/+page.server.ts +9 -0
  113. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  114. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  115. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  116. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  117. package/templates/jbrains-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  118. package/templates/jbrains-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  119. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  120. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  121. package/templates/jbrains-docs/static/favicon.svg +4 -0
  122. package/templates/jbrains-docs/svelte.config.js +13 -0
  123. package/templates/jbrains-docs/tsconfig.json +12 -0
  124. package/templates/jbrains-docs/vite.config.ts +6 -0
  125. package/templates/minimal/.env.sample +1 -0
  126. package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
  127. package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
  128. package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
  129. package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
  130. package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
  131. package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
  132. package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
  133. package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
  134. package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
  135. package/templates/minimal/docs/v2.0.0/about.mdx +57 -0
  136. package/templates/minimal/docs/v2.0.0/components/_category_.json +8 -0
  137. package/templates/minimal/docs/v2.0.0/components/callout.mdx +83 -0
  138. package/templates/minimal/docs/v2.0.0/components/code-block.mdx +103 -0
  139. package/templates/minimal/docs/v2.0.0/components/index.mdx +8 -0
  140. package/templates/minimal/docs/v2.0.0/components/tabs.mdx +92 -0
  141. package/templates/minimal/docs/v2.0.0/configuration.mdx +322 -0
  142. package/templates/minimal/docs/v2.0.0/features.mdx +197 -0
  143. package/templates/minimal/docs/v2.0.0/getting-started.mdx +183 -0
  144. package/templates/minimal/gitignore +7 -0
  145. package/templates/minimal/package.json +29 -0
  146. package/templates/minimal/postcss.config.mjs +8 -0
  147. package/templates/minimal/specra.config.json +91 -0
  148. package/templates/minimal/src/app.css +86 -0
  149. package/templates/minimal/src/app.html +17 -0
  150. package/templates/minimal/src/hooks.server.ts +8 -0
  151. package/templates/minimal/src/params/product.ts +7 -0
  152. package/templates/minimal/src/routes/+error.svelte +10 -0
  153. package/templates/minimal/src/routes/+layout.server.ts +14 -0
  154. package/templates/minimal/src/routes/+layout.svelte +21 -0
  155. package/templates/minimal/src/routes/+page.server.ts +9 -0
  156. package/templates/minimal/src/routes/+page.svelte +149 -0
  157. package/templates/minimal/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  158. package/templates/minimal/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  159. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  160. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  161. package/templates/minimal/src/routes/docs/[version]/+layout.server.ts +42 -0
  162. package/templates/minimal/src/routes/docs/[version]/+page.server.ts +27 -0
  163. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  164. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  165. package/templates/minimal/static/api-specs/openapi-example.json +259 -0
  166. package/templates/minimal/static/api-specs/postman-example.json +205 -0
  167. package/templates/minimal/static/api-specs/test-api.json +256 -0
  168. package/templates/minimal/static/api-specs/users-api.json +264 -0
  169. package/templates/minimal/static/favicon.svg +4 -0
  170. package/templates/minimal/svelte.config.js +13 -0
  171. package/templates/minimal/tsconfig.json +12 -0
  172. package/templates/minimal/vite.config.ts +6 -0
@@ -0,0 +1,197 @@
1
+ ---
2
+ title: Features
3
+ description: Explore all the features of the Specra documentation platform
4
+ sidebar_position: 4
5
+ icon: scroll-text
6
+ ---
7
+
8
+ ## Content Features
9
+
10
+ ### MDX Support
11
+
12
+ Write documentation in MDX—Markdown with React components built in.
13
+
14
+ ```mdx
15
+ # Hello World
16
+
17
+ This is **Markdown** with a <Badge variant="success">React component</Badge>!
18
+ ```
19
+
20
+ <Callout type="tip">
21
+ MDX lets you create interactive, dynamic documentation that goes beyond static text.
22
+ </Callout>
23
+
24
+ ### Syntax Highlighting
25
+
26
+ Code blocks automatically get syntax highlighting with line numbers:
27
+
28
+ ```typescript
29
+ interface User {
30
+ id: string;
31
+ name: string;
32
+ email: string;
33
+ }
34
+
35
+ function greetUser(user: User): string {
36
+ return `Hello, ${user.name}!`;
37
+ }
38
+ ```
39
+
40
+ Supported languages include JavaScript, TypeScript, Python, Bash, JSON, CSS, and many more.
41
+
42
+ ### Math Equations
43
+
44
+ Render mathematical equations using KaTeX:
45
+
46
+ Inline: <Math>{"E = mc^2"}</Math>
47
+
48
+ Block:
49
+ <Math block>
50
+ {"\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}"}
51
+ </Math>
52
+
53
+ ### Mermaid Diagrams
54
+
55
+ Create diagrams from text using Mermaid:
56
+
57
+ <Mermaid
58
+ chart={`
59
+ graph LR
60
+ A[Write MDX] --> B[Build]
61
+ B --> C[Deploy]
62
+ C --> D[Users Read Docs]
63
+ `}
64
+ caption="Documentation workflow"
65
+ />
66
+
67
+ ## Navigation Features
68
+
69
+ ### Automatic Sidebar
70
+
71
+ The sidebar is automatically generated from your folder structure. Use `_category_.json` to customize:
72
+
73
+ ```json
74
+ {
75
+ "label": "Guides",
76
+ "position": 2,
77
+ "collapsible": true,
78
+ "collapsed": false
79
+ }
80
+ ```
81
+
82
+ ### Table of Contents
83
+
84
+ A floating table of contents is automatically generated from your headings. It highlights the current section as you scroll.
85
+
86
+ ### Breadcrumbs
87
+
88
+ Breadcrumb navigation helps users understand their location in the documentation hierarchy.
89
+
90
+ ### Version Switcher
91
+
92
+ Support multiple documentation versions with easy switching:
93
+
94
+ - `/docs/v1.0.0/getting-started`
95
+ - `/docs/v2.0.0/getting-started`
96
+ - `/docs/next/getting-started` (unreleased)
97
+
98
+ ## Search
99
+
100
+ ### Full-Text Search
101
+
102
+ Powered by Meilisearch for instant, typo-tolerant search results.
103
+
104
+ - **Keyboard shortcut**: Press `⌘K` or `Ctrl+K` to open search
105
+ - **Typo tolerance**: Finds results even with spelling mistakes
106
+ - **Highlighted results**: See where your query matches
107
+
108
+ ### Search Indexing
109
+
110
+ Documentation is automatically indexed at build time for fast search.
111
+
112
+ ## Theme & Styling
113
+
114
+ ### Dark Mode
115
+
116
+ Automatic dark mode that respects system preferences:
117
+
118
+ - Light mode
119
+ - Dark mode
120
+ - System preference (auto)
121
+
122
+ Toggle with the button in the header.
123
+
124
+ ### Customizable Design
125
+
126
+ All styling is based on CSS variables and Tailwind, making customization easy:
127
+
128
+ ```css
129
+ :root {
130
+ --primary: oklch(0.55 0.22 264.376);
131
+ --background: oklch(1 0 0);
132
+ --foreground: oklch(0.145 0 0);
133
+ }
134
+ ```
135
+
136
+ ## Components
137
+
138
+ ### Rich Component Library
139
+
140
+ Built-in components for common documentation patterns:
141
+
142
+ <CardGrid cols={3}>
143
+ <Card icon="message-square" title="Callouts" description="Info, warning, tip, error alerts" />
144
+ <Card icon="layers" title="Tabs" description="Tabbed content sections" />
145
+ <Card icon="list" title="Steps" description="Step-by-step guides" />
146
+ <Card icon="chevrons-up-down" title="Accordion" description="Collapsible content" />
147
+ <Card icon="grid" title="Cards" description="Feature cards with icons" />
148
+ <Card icon="code" title="Code Blocks" description="Syntax highlighted code" />
149
+ </CardGrid>
150
+
151
+ See the [Components](/docs/v1.0.0/components) section for documentation on each component.
152
+
153
+ ## Developer Experience
154
+
155
+ ### Hot Reload
156
+
157
+ Changes to MDX files are instantly reflected without a full page refresh.
158
+
159
+ ### Frontmatter Validation
160
+
161
+ Frontmatter fields are validated at build time to catch errors early.
162
+
163
+ ### SEO Optimization
164
+
165
+ Automatic meta tags, OpenGraph images, and structured data from frontmatter:
166
+
167
+ - Title and description tags
168
+ - OpenGraph and Twitter cards
169
+ - Canonical URLs
170
+ - Sitemap generation
171
+
172
+ ### Reading Time
173
+
174
+ Automatic calculation and display of estimated reading time for each page.
175
+
176
+ ## Production Features
177
+
178
+ ### Static Generation
179
+
180
+ All pages are pre-rendered at build time for maximum performance:
181
+
182
+ - Zero JavaScript required for content
183
+ - Edge caching friendly
184
+ - Fast Time to First Byte (TTFB)
185
+
186
+ ### Performance
187
+
188
+ - Lighthouse score: 90+ (desktop)
189
+ - Lazy-loaded images with Next.js Image
190
+ - Code splitting for components
191
+
192
+ ### Accessibility
193
+
194
+ - Keyboard navigation
195
+ - Screen reader support
196
+ - High contrast support
197
+ - Focus management
@@ -0,0 +1,183 @@
1
+ ---
2
+ title: Getting Started
3
+ description: Set up and start writing documentation with Specra
4
+ sidebar_position: 2
5
+ icon: book
6
+ tab_group: guides
7
+ ---
8
+
9
+ ## Prerequisites
10
+
11
+ Before you begin, make sure you have:
12
+ - Node.js 18+ installed
13
+ - A package manager (npm, yarn, or pnpm)
14
+
15
+ ## Quick Start
16
+
17
+ <Steps>
18
+ <Step title="Clone the Repository">
19
+ ```bash
20
+ git clone https://github.com/your-org/specra-docs.git
21
+ cd specra-docs
22
+ ```
23
+ </Step>
24
+
25
+ <Step title="Install Dependencies">
26
+ <Tabs defaultValue="npm">
27
+ <Tab label="npm">
28
+ ```bash
29
+ npm install
30
+ ```
31
+ </Tab>
32
+ <Tab label="yarn">
33
+ ```bash
34
+ yarn install
35
+ ```
36
+ </Tab>
37
+ <Tab label="pnpm">
38
+ ```bash
39
+ pnpm install
40
+ ```
41
+ </Tab>
42
+ </Tabs>
43
+ </Step>
44
+
45
+ <Step title="Start Development Server">
46
+ <Tabs defaultValue="npm">
47
+ <Tab label="npm">
48
+ ```bash
49
+ npm run dev
50
+ ```
51
+ </Tab>
52
+ <Tab label="yarn">
53
+ ```bash
54
+ yarn dev
55
+ ```
56
+ </Tab>
57
+ <Tab label="pnpm">
58
+ ```bash
59
+ pnpm dev
60
+ ```
61
+ </Tab>
62
+ </Tabs>
63
+
64
+ Open [http://localhost:3000](http://localhost:3000) to view your docs.
65
+ </Step>
66
+ </Steps>
67
+
68
+ ## Creating Documentation
69
+
70
+ <Callout type="warning">
71
+ All documentation files **must use the `.mdx` extension**, not `.md`. MDX enables React components inside your markdown.
72
+ </Callout>
73
+
74
+ ### File Structure
75
+
76
+ Documentation lives in the `docs/` folder, organized by version:
77
+
78
+ ```txt
79
+ docs/
80
+ ├── v1.0.0/ # Version 1.0.0 docs
81
+ │ ├── about.mdx
82
+ │ ├── getting-started.mdx
83
+ │ └── guides/
84
+ │ ├── _category_.json
85
+ │ └── writing-content.mdx
86
+ ├── v2.0.0/ # Version 2.0.0 docs
87
+ │ └── ...
88
+ └── next/ # Unreleased/development docs
89
+ └── ...
90
+ ```
91
+
92
+ ### Creating a New Page
93
+
94
+ 1. Create a new `.mdx` file in the appropriate folder
95
+ 2. Add frontmatter at the top of the file
96
+ 3. Write your content using Markdown and components
97
+
98
+ **Example: `docs/v1.0.0/my-page.mdx`**
99
+
100
+ ```mdx
101
+ ---
102
+ title: My Page Title
103
+ description: A brief description for SEO
104
+ sidebar_position: 5
105
+ ---
106
+
107
+ # My Page Title
108
+
109
+ Your content goes here. You can use **Markdown**
110
+ and <Badge>React components</Badge>.
111
+ ```
112
+
113
+ ## Frontmatter
114
+
115
+ Every MDX file should have frontmatter at the top. Here are the available fields:
116
+
117
+ | Field | Required | Description |
118
+ |-------|----------|-------------|
119
+ | `title` | ✅ | Page title (used in sidebar and browser tab) |
120
+ | `description` | Recommended | Short description for SEO meta tags |
121
+ | `sidebar_position` | No | Order in the sidebar (lower = higher) |
122
+ | `tab_group` | No | Tab group name |
123
+ | `tags` | No | Array of tags for categorization |
124
+ | `draft` | No | Set `true` to hide in production |
125
+ | `last_updated` | No | Date string for "last updated" display |
126
+
127
+ <Callout type="tip">
128
+ Use `sidebar_position` to control the order of pages in the sidebar. Pages are sorted by this number, then alphabetically.
129
+ </Callout>
130
+
131
+ ## Organizing with Folders
132
+
133
+ Create folders to group related documentation:
134
+
135
+ ```
136
+ docs/v1.0.0/
137
+ ├── guides/
138
+ │ ├── _category_.json # Configure folder display
139
+ │ ├── index.mdx # Optional: custom folder landing page
140
+ │ ├── installation.mdx
141
+ │ └── configuration.mdx
142
+ ```
143
+
144
+ ### Category Configuration
145
+
146
+ Create `_category_.json` in a folder to customize its sidebar appearance:
147
+
148
+ ```json
149
+ {
150
+ "label": "Guides",
151
+ "position": 2,
152
+ "collapsible": true,
153
+ "collapsed": false
154
+ }
155
+ ```
156
+
157
+ ## Using Components
158
+
159
+ Specra includes many built-in components. Import is automatic—just use them:
160
+
161
+ ```mdx
162
+ <Callout type="info">
163
+ This is an info callout!
164
+ </Callout>
165
+
166
+ <Tabs defaultValue="JavaScript">
167
+ <Tab label="JavaScript">
168
+ JavaScript code here
169
+ </Tab>
170
+ <Tab label="Python">
171
+ Python code here
172
+ </Tab>
173
+ </Tabs>
174
+ ```
175
+
176
+ See the [Components](/docs/v1.0.0/components) section for all available components.
177
+
178
+ ## Next Steps
179
+
180
+ <CardGrid cols={2}>
181
+ <Card icon="settings" title="Configuration" description="Customize your docs site" href="/docs/v1.0.0/configuration" />
182
+ <Card icon="layers" title="Features" description="Explore all platform features" href="/docs/v1.0.0/features" />
183
+ </CardGrid>
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ .svelte-kit
3
+ build
4
+ .env
5
+ .env.*
6
+ !.env.example
7
+ vite.config.ts.timestamp-*
@@ -0,0 +1,29 @@
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
+ "lucide-svelte": "^0.454.0",
14
+ "specra": "^0.2.4"
15
+ },
16
+ "devDependencies": {
17
+ "@sveltejs/adapter-static": "^3.0.0",
18
+ "@sveltejs/kit": "^2.0.0",
19
+ "@sveltejs/vite-plugin-svelte": "^6.0.0",
20
+ "@tailwindcss/postcss": "^4.1.9",
21
+ "@tailwindcss/typography": "^0.5.19",
22
+ "postcss": "^8.5",
23
+ "svelte": "^5.0.0",
24
+ "svelte-check": "^4.0.0",
25
+ "tailwindcss": "^4.1.9",
26
+ "typescript": "^5",
27
+ "vite": "^6.3.0"
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ '@tailwindcss/postcss': {},
5
+ },
6
+ }
7
+
8
+ export default config
@@ -0,0 +1,91 @@
1
+ {
2
+ "$schema": "./node_modules/specra/config/specra.config.schema.json",
3
+ "site": {
4
+ "title": "My Docs",
5
+ "description": "Documentation for my project",
6
+ "url": "http://localhost:5173",
7
+ "baseUrl": "/",
8
+ "language": "en",
9
+ "organizationName": "my-org",
10
+ "projectName": "my-project",
11
+ "activeVersion": "v1.0.0"
12
+ },
13
+ "theme": {
14
+ "defaultMode": "system",
15
+ "respectPrefersColorScheme": true
16
+ },
17
+ "navigation": {
18
+ "showSidebar": true,
19
+ "collapsibleSidebar": true,
20
+ "showBreadcrumbs": true,
21
+ "showTableOfContents": true,
22
+ "tocPosition": "right",
23
+ "tocMaxDepth": 3,
24
+ "tabGroups": [
25
+ {
26
+ "id": "guides",
27
+ "label": "Guides",
28
+ "icon": "book-open"
29
+ },
30
+ {
31
+ "id": "api",
32
+ "label": "API Reference",
33
+ "icon": "zap"
34
+ },
35
+ {
36
+ "id": "components",
37
+ "label": "Components",
38
+ "icon": "layers"
39
+ }
40
+ ]
41
+ },
42
+ "social": {
43
+ "github": "https://github.com/your-org/your-repo"
44
+ },
45
+ "search": {
46
+ "enabled": false
47
+ },
48
+ "footer": {
49
+ "copyright": "Copyright © 2025 My Project. All rights reserved.",
50
+ "links": [
51
+ {
52
+ "title": "Documentation",
53
+ "items": [
54
+ {
55
+ "label": "Getting Started",
56
+ "href": "/docs/v1.0.0/getting-started"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "title": "Community",
62
+ "items": [
63
+ {
64
+ "label": "GitHub",
65
+ "href": "https://github.com/your-org/your-repo"
66
+ }
67
+ ]
68
+ }
69
+ ],
70
+ "branding": {
71
+ "showBranding": true,
72
+ "logo": "https://specra-docs.com/favicon.svg",
73
+ "title": "Specra",
74
+ "url": "https://specra-docs.com"
75
+ }
76
+ },
77
+ "banner": {
78
+ "enabled": false,
79
+ "message": "🎉 This is a development version. Some features may not work as expected.",
80
+ "type": "error",
81
+ "dismissible": true
82
+ },
83
+ "features": {
84
+ "showLastUpdated": true,
85
+ "showReadingTime": true,
86
+ "showAuthors": false,
87
+ "showTags": true,
88
+ "versioning": true,
89
+ "i18n": false
90
+ }
91
+ }
@@ -0,0 +1,86 @@
1
+ @import "specra/styles";
2
+ @source "./**/*.{js,ts,svelte}";
3
+
4
+ @theme inline {
5
+ --font-sans: "Geist", "Geist Fallback", system-ui, sans-serif;
6
+ --font-mono: "Geist Mono", "Geist Mono Fallback", monospace;
7
+ }
8
+
9
+ /* =============================================
10
+ THEME OVERRIDES
11
+ Uncomment a :root block for light theme and/or
12
+ a .dark block for dark theme. Mix and match!
13
+ ============================================= */
14
+
15
+ /* ─── Mint Light ─── */
16
+ /* :root {
17
+ --primary: oklch(0.45 0.18 162);
18
+ --primary-foreground: oklch(0.98 0 0);
19
+ --ring: oklch(0.45 0.18 162);
20
+ } */
21
+
22
+ /* ─── Ocean Light ─── */
23
+ /* :root {
24
+ --primary: oklch(0.45 0.18 240);
25
+ --primary-foreground: oklch(0.98 0 0);
26
+ --ring: oklch(0.45 0.18 240);
27
+ } */
28
+
29
+ /* ─── Rose Light ─── */
30
+ /* :root {
31
+ --primary: oklch(0.50 0.20 350);
32
+ --primary-foreground: oklch(0.98 0 0);
33
+ --ring: oklch(0.50 0.20 350);
34
+ } */
35
+
36
+ /* ─── Amber Light ─── */
37
+ /* :root {
38
+ --primary: oklch(0.55 0.16 70);
39
+ --primary-foreground: oklch(0.98 0 0);
40
+ --ring: oklch(0.55 0.16 70);
41
+ } */
42
+
43
+ /* ─── Violet Light ─── */
44
+ /* :root {
45
+ --primary: oklch(0.48 0.22 290);
46
+ --primary-foreground: oklch(0.98 0 0);
47
+ --ring: oklch(0.48 0.22 290);
48
+ } */
49
+
50
+ /* ─── Mint Dark ─── */
51
+ /* .dark {
52
+ --primary: oklch(0.72 0.18 162);
53
+ --primary-foreground: oklch(0.10 0.03 160);
54
+ --ring: oklch(0.72 0.18 162);
55
+ } */
56
+
57
+ /* ─── Ocean Dark ─── */
58
+ /* .dark {
59
+ --primary: oklch(0.68 0.16 240);
60
+ --primary-foreground: oklch(0.98 0 0);
61
+ --ring: oklch(0.68 0.16 240);
62
+ } */
63
+
64
+ /* ─── Rose Dark ─── */
65
+ /* .dark {
66
+ --primary: oklch(0.70 0.18 350);
67
+ --primary-foreground: oklch(0.98 0 0);
68
+ --ring: oklch(0.70 0.18 350);
69
+ } */
70
+
71
+ /* ─── Amber Dark ─── */
72
+ /* .dark {
73
+ --primary: oklch(0.75 0.16 70);
74
+ --primary-foreground: oklch(0.10 0.03 70);
75
+ --ring: oklch(0.75 0.16 70);
76
+ } */
77
+
78
+ /* ─── Violet Dark ─── */
79
+ /* .dark {
80
+ --primary: oklch(0.70 0.20 290);
81
+ --primary-foreground: oklch(0.98 0 0);
82
+ --ring: oklch(0.70 0.20 290);
83
+ } */
84
+
85
+ /* For full theme customization (backgrounds, borders, sidebar, etc.)
86
+ see: https://specra-docs.com/docs/v1.0.0/configuration/theming */
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%sveltekit.assets%/favicon.svg" type="image/svg+xml" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap"
11
+ rel="stylesheet">
12
+ %sveltekit.head%
13
+ </head>
14
+ <body data-sveltekit-preload-data="hover" class="font-sans antialiased">
15
+ <div style="display: contents">%sveltekit.body%</div>
16
+ </body>
17
+ </html>
@@ -0,0 +1,8 @@
1
+ import { createSecurityHandle } from 'specra/middleware/security';
2
+ import { sequence } from '@sveltejs/kit/hooks';
3
+
4
+ export const handle = sequence(
5
+ createSecurityHandle({
6
+ strictPathValidation: true,
7
+ })
8
+ );
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SvelteKit param matcher for product slugs.
3
+ * Matches any string that does NOT look like a version (e.g., v1.0.0).
4
+ */
5
+ export function match(param: string): boolean {
6
+ return !/^v\d/.test(param);
7
+ }
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { page } from '$app/stores';
3
+ import { VersionNotFound } from 'specra/components';
4
+ </script>
5
+
6
+ <svelte:head>
7
+ <title>Page Not Found</title>
8
+ </svelte:head>
9
+
10
+ <VersionNotFound />
@@ -0,0 +1,14 @@
1
+ import { getConfig, initConfig } from 'specra';
2
+ import specraConfig from '../../specra.config.json';
3
+ import type { LayoutServerLoad } from './$types';
4
+ import type { SpecraConfig } from 'specra';
5
+
6
+ initConfig(specraConfig as unknown as Partial<SpecraConfig>);
7
+
8
+ export const prerender = true;
9
+ export const trailingSlash = 'never';
10
+
11
+ export const load: LayoutServerLoad = async () => {
12
+ const config = getConfig();
13
+ return { config };
14
+ };
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import '../app.css';
3
+ import { LayoutProviders } from 'specra/components';
4
+ import type { Snippet } from 'svelte';
5
+ import type { LayoutData } from './$types';
6
+
7
+ let { data, children }: { data: LayoutData; children: Snippet } = $props();
8
+ </script>
9
+
10
+ <svelte:head>
11
+ <title>{data?.config?.site?.title || 'Documentation'}</title>
12
+ <meta name="description" content={data?.config?.site?.description || 'Modern documentation platform'} />
13
+ </svelte:head>
14
+
15
+ {#if data?.config}
16
+ <LayoutProviders config={data.config}>
17
+ {@render children?.()}
18
+ </LayoutProviders>
19
+ {:else}
20
+ {@render children?.()}
21
+ {/if}
@@ -0,0 +1,9 @@
1
+ import { redirect } from '@sveltejs/kit';
2
+ import { getConfig } from 'specra';
3
+ import type { PageServerLoad } from './$types';
4
+
5
+ export const load: PageServerLoad = async () => {
6
+ const config = getConfig();
7
+ const activeVersion = config.site?.activeVersion || 'v1.0.0';
8
+ redirect(302, `/docs/${activeVersion}/about`);
9
+ };