@alliance-droid/svelte-docs-system 0.0.1
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/COMPONENTS.md +365 -0
- package/COVERAGE_REPORT.md +663 -0
- package/README.md +42 -0
- package/SEARCH_VERIFICATION.md +229 -0
- package/TEST_SUMMARY.md +344 -0
- package/bin/init.js +821 -0
- package/docs/E2E_TESTS.md +354 -0
- package/docs/TESTING.md +754 -0
- package/docs/de/index.md +41 -0
- package/docs/en/COMPONENTS.md +443 -0
- package/docs/en/api/examples.md +100 -0
- package/docs/en/api/overview.md +69 -0
- package/docs/en/components/index.md +622 -0
- package/docs/en/config/navigation.md +505 -0
- package/docs/en/config/theme-and-colors.md +395 -0
- package/docs/en/getting-started/integration.md +406 -0
- package/docs/en/guides/common-setups.md +651 -0
- package/docs/en/index.md +243 -0
- package/docs/en/markdown.md +102 -0
- package/docs/en/routing.md +64 -0
- package/docs/en/setup.md +52 -0
- package/docs/en/troubleshooting.md +704 -0
- package/docs/es/index.md +41 -0
- package/docs/fr/index.md +41 -0
- package/docs/ja/index.md +41 -0
- package/package.json +40 -0
- package/pagefind.toml +8 -0
- package/postcss.config.js +5 -0
- package/src/app.css +119 -0
- package/src/app.d.ts +13 -0
- package/src/app.html +11 -0
- package/src/lib/assets/favicon.svg +1 -0
- package/src/lib/components/APITable.svelte +120 -0
- package/src/lib/components/APITable.test.ts +153 -0
- package/src/lib/components/Breadcrumbs.svelte +85 -0
- package/src/lib/components/Breadcrumbs.test.ts +148 -0
- package/src/lib/components/Callout.svelte +60 -0
- package/src/lib/components/Callout.test.ts +100 -0
- package/src/lib/components/CodeBlock.svelte +68 -0
- package/src/lib/components/CodeBlock.test.ts +133 -0
- package/src/lib/components/DocLayout.svelte +84 -0
- package/src/lib/components/Footer.svelte +78 -0
- package/src/lib/components/Image.svelte +100 -0
- package/src/lib/components/Image.test.ts +163 -0
- package/src/lib/components/Navbar.svelte +141 -0
- package/src/lib/components/Search.svelte +248 -0
- package/src/lib/components/Sidebar.svelte +110 -0
- package/src/lib/components/Tabs.svelte +48 -0
- package/src/lib/components/Tabs.test.ts +102 -0
- package/src/lib/config.test.ts +140 -0
- package/src/lib/config.ts +179 -0
- package/src/lib/configIntegration.test.ts +272 -0
- package/src/lib/configLoader.ts +231 -0
- package/src/lib/configParser.test.ts +217 -0
- package/src/lib/configParser.ts +234 -0
- package/src/lib/index.ts +34 -0
- package/src/lib/integration.test.ts +426 -0
- package/src/lib/navigationBuilder.test.ts +338 -0
- package/src/lib/navigationBuilder.ts +268 -0
- package/src/lib/performance.test.ts +369 -0
- package/src/lib/routing.test.ts +202 -0
- package/src/lib/routing.ts +127 -0
- package/src/lib/search-functionality.test.ts +493 -0
- package/src/lib/stores/i18n.test.ts +180 -0
- package/src/lib/stores/i18n.ts +143 -0
- package/src/lib/stores/nav.ts +36 -0
- package/src/lib/stores/search.test.ts +140 -0
- package/src/lib/stores/search.ts +162 -0
- package/src/lib/stores/theme.ts +59 -0
- package/src/lib/stores/version.test.ts +139 -0
- package/src/lib/stores/version.ts +111 -0
- package/src/lib/themeCustomization.test.ts +223 -0
- package/src/lib/themeCustomization.ts +212 -0
- package/src/lib/utils/highlight.test.ts +136 -0
- package/src/lib/utils/highlight.ts +100 -0
- package/src/lib/utils/index.ts +7 -0
- package/src/lib/utils/markdown.test.ts +357 -0
- package/src/lib/utils/markdown.ts +77 -0
- package/src/routes/+layout.server.ts +1 -0
- package/src/routes/+layout.svelte +28 -0
- package/src/routes/+page.svelte +165 -0
- package/static/robots.txt +3 -0
- package/svelte.config.js +18 -0
- package/tailwind.config.ts +55 -0
- package/template-starter/.github/workflows/build.yml +40 -0
- package/template-starter/.github/workflows/deploy-github-pages.yml +47 -0
- package/template-starter/.github/workflows/deploy-netlify.yml +41 -0
- package/template-starter/.github/workflows/deploy-vercel.yml +64 -0
- package/template-starter/NPM-PACKAGE-SETUP.md +233 -0
- package/template-starter/README.md +320 -0
- package/template-starter/docs/_config.json +39 -0
- package/template-starter/docs/api/components.md +257 -0
- package/template-starter/docs/api/overview.md +169 -0
- package/template-starter/docs/guides/configuration.md +145 -0
- package/template-starter/docs/guides/github-pages-deployment.md +254 -0
- package/template-starter/docs/guides/netlify-deployment.md +159 -0
- package/template-starter/docs/guides/vercel-deployment.md +131 -0
- package/template-starter/docs/index.md +49 -0
- package/template-starter/docs/setup.md +149 -0
- package/template-starter/package.json +31 -0
- package/template-starter/pagefind.toml +3 -0
- package/template-starter/postcss.config.js +5 -0
- package/template-starter/src/app.css +34 -0
- package/template-starter/src/app.d.ts +13 -0
- package/template-starter/src/app.html +11 -0
- package/template-starter/src/lib/components/APITable.svelte +120 -0
- package/template-starter/src/lib/components/APITable.test.ts +19 -0
- package/template-starter/src/lib/components/Breadcrumbs.svelte +85 -0
- package/template-starter/src/lib/components/Breadcrumbs.test.ts +19 -0
- package/template-starter/src/lib/components/Callout.svelte +60 -0
- package/template-starter/src/lib/components/Callout.test.ts +16 -0
- package/template-starter/src/lib/components/CodeBlock.svelte +68 -0
- package/template-starter/src/lib/components/CodeBlock.test.ts +12 -0
- package/template-starter/src/lib/components/DocLayout.svelte +84 -0
- package/template-starter/src/lib/components/Footer.svelte +78 -0
- package/template-starter/src/lib/components/Image.svelte +100 -0
- package/template-starter/src/lib/components/Image.test.ts +15 -0
- package/template-starter/src/lib/components/Navbar.svelte +141 -0
- package/template-starter/src/lib/components/Search.svelte +248 -0
- package/template-starter/src/lib/components/Sidebar.svelte +110 -0
- package/template-starter/src/lib/components/Tabs.svelte +48 -0
- package/template-starter/src/lib/components/Tabs.test.ts +17 -0
- package/template-starter/src/lib/index.ts +15 -0
- package/template-starter/src/routes/+layout.svelte +28 -0
- package/template-starter/src/routes/+page.svelte +92 -0
- package/template-starter/svelte.config.js +17 -0
- package/template-starter/tailwind.config.ts +17 -0
- package/template-starter/tsconfig.json +13 -0
- package/template-starter/vite.config.ts +6 -0
- package/tests/e2e/example.spec.ts +345 -0
- package/tsconfig.json +20 -0
- package/vite.config.ts +6 -0
- package/vitest.config.ts +34 -0
- package/vitest.setup.ts +21 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# 📚 Svelte Documentation Starter
|
|
2
|
+
|
|
3
|
+
A professional, production-ready documentation site template built with SvelteKit and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- ⚡ **Lightning Fast** - Pre-rendered static site with Vite
|
|
8
|
+
- 🎨 **Beautiful Design** - Professional theme with light/dark mode
|
|
9
|
+
- 🔍 **Full-Text Search** - Powered by Pagefind
|
|
10
|
+
- 📱 **Responsive** - Mobile-friendly documentation
|
|
11
|
+
- ♿ **Accessible** - WCAG compliant
|
|
12
|
+
- 🚀 **Easy Deployment** - Deploy to Vercel, Netlify, GitHub Pages, or anywhere
|
|
13
|
+
- 📝 **Markdown-Based** - Write docs in simple Markdown
|
|
14
|
+
- 🎯 **Zero Config** - Folder structure becomes navigation automatically
|
|
15
|
+
|
|
16
|
+
## 🚀 Quick Start
|
|
17
|
+
|
|
18
|
+
### Prerequisites
|
|
19
|
+
|
|
20
|
+
- Node.js 18+
|
|
21
|
+
- npm or pnpm
|
|
22
|
+
|
|
23
|
+
### Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Clone this repository
|
|
27
|
+
git clone <your-repo>
|
|
28
|
+
cd docs-starter
|
|
29
|
+
|
|
30
|
+
# Install dependencies
|
|
31
|
+
npm install
|
|
32
|
+
|
|
33
|
+
# Start development server
|
|
34
|
+
npm run dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Open `http://localhost:5173` in your browser.
|
|
38
|
+
|
|
39
|
+
## 📖 Project Structure
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
docs-starter/
|
|
43
|
+
├── docs/ # Your documentation files
|
|
44
|
+
│ ├── index.md # Home page
|
|
45
|
+
│ ├── setup.md # Setup guide
|
|
46
|
+
│ ├── guides/ # Guide documentation
|
|
47
|
+
│ │ ├── configuration.md
|
|
48
|
+
│ │ ├── vercel-deployment.md
|
|
49
|
+
│ │ ├── netlify-deployment.md
|
|
50
|
+
│ │ └── github-pages-deployment.md
|
|
51
|
+
│ ├── api/ # API reference
|
|
52
|
+
│ │ ├── overview.md
|
|
53
|
+
│ │ └── components.md
|
|
54
|
+
│ └── _config.json # Navigation configuration
|
|
55
|
+
├── src/ # Source code
|
|
56
|
+
│ ├── routes/ # SvelteKit routes
|
|
57
|
+
│ ├── lib/ # Reusable components
|
|
58
|
+
│ └── app.css # Global styles
|
|
59
|
+
├── .github/
|
|
60
|
+
│ └── workflows/ # CI/CD workflows
|
|
61
|
+
├── static/ # Static assets
|
|
62
|
+
└── package.json # Project dependencies
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 📝 Adding Documentation
|
|
66
|
+
|
|
67
|
+
1. Create a markdown file in the `docs/` folder:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
---
|
|
71
|
+
title: My Guide
|
|
72
|
+
description: A guide to something amazing
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
# My Guide
|
|
76
|
+
|
|
77
|
+
Your content here...
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. File structure becomes navigation:
|
|
81
|
+
- `docs/setup.md` → `/docs/setup`
|
|
82
|
+
- `docs/guides/intro.md` → `/docs/guides/intro`
|
|
83
|
+
- Nested folders work at any depth
|
|
84
|
+
|
|
85
|
+
3. Customize navigation in `docs/_config.json`
|
|
86
|
+
|
|
87
|
+
## 🎨 Customization
|
|
88
|
+
|
|
89
|
+
### Colors and Styling
|
|
90
|
+
|
|
91
|
+
Edit `tailwind.config.ts`:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
theme: {
|
|
95
|
+
extend: {
|
|
96
|
+
colors: {
|
|
97
|
+
primary: '#3b82f6',
|
|
98
|
+
secondary: '#8b5cf6'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Navigation Structure
|
|
105
|
+
|
|
106
|
+
Configure `docs/_config.json`:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"name": "My Docs",
|
|
111
|
+
"sections": [
|
|
112
|
+
{
|
|
113
|
+
"title": "Getting Started",
|
|
114
|
+
"pages": [
|
|
115
|
+
{ "label": "Setup", "path": "/docs/setup" }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Environment Variables
|
|
123
|
+
|
|
124
|
+
Create `.env` file:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
VITE_API_URL=https://api.example.com
|
|
128
|
+
VITE_SITE_NAME=My Documentation
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 🔨 Available Scripts
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npm run dev # Start development server
|
|
135
|
+
npm run build # Build for production
|
|
136
|
+
npm run preview # Preview production build
|
|
137
|
+
npm run check # Type check and lint
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 🚀 Deployment
|
|
141
|
+
|
|
142
|
+
### GitHub Pages (Free)
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
git push origin main
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Workflow defined in `.github/workflows/deploy-github-pages.yml`
|
|
149
|
+
|
|
150
|
+
See the [GitHub Pages Deployment Guide](./docs/guides/github-pages-deployment.md)
|
|
151
|
+
|
|
152
|
+
### Vercel
|
|
153
|
+
|
|
154
|
+
1. Push to GitHub
|
|
155
|
+
2. Import project at https://vercel.com/new
|
|
156
|
+
3. Select this repository
|
|
157
|
+
4. Deploy!
|
|
158
|
+
|
|
159
|
+
See the [Vercel Deployment Guide](./docs/guides/vercel-deployment.md)
|
|
160
|
+
|
|
161
|
+
### Netlify
|
|
162
|
+
|
|
163
|
+
1. Push to GitHub
|
|
164
|
+
2. Connect at https://app.netlify.com
|
|
165
|
+
3. Select this repository
|
|
166
|
+
4. Deploy!
|
|
167
|
+
|
|
168
|
+
See the [Netlify Deployment Guide](./docs/guides/netlify-deployment.md)
|
|
169
|
+
|
|
170
|
+
## 📚 Built-in Components
|
|
171
|
+
|
|
172
|
+
### Callout
|
|
173
|
+
|
|
174
|
+
```svelte
|
|
175
|
+
<Callout variant="info" title="Note">
|
|
176
|
+
This is important information.
|
|
177
|
+
</Callout>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### CodeBlock
|
|
181
|
+
|
|
182
|
+
```svelte
|
|
183
|
+
<CodeBlock code="const x = 42;" language="javascript" />
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Tabs
|
|
187
|
+
|
|
188
|
+
```svelte
|
|
189
|
+
<Tabs items={[
|
|
190
|
+
{ label: 'JS', content: '<code>const x = 42;</code>' },
|
|
191
|
+
{ label: 'TS', content: '<code>const x: number = 42;</code>' }
|
|
192
|
+
]} />
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### APITable
|
|
196
|
+
|
|
197
|
+
```svelte
|
|
198
|
+
<APITable
|
|
199
|
+
columns={[
|
|
200
|
+
{ key: 'name', label: 'Name' },
|
|
201
|
+
{ key: 'type', label: 'Type' }
|
|
202
|
+
]}
|
|
203
|
+
rows={[
|
|
204
|
+
{ name: 'param', type: 'string' }
|
|
205
|
+
]}
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
See [Components Documentation](./docs/api/components.md) for all available components.
|
|
210
|
+
|
|
211
|
+
## 🔍 Search
|
|
212
|
+
|
|
213
|
+
Full-text search is automatically enabled:
|
|
214
|
+
- Press `Cmd+K` or `Ctrl+K` to search
|
|
215
|
+
- Search across all documentation
|
|
216
|
+
- Results update in real-time
|
|
217
|
+
|
|
218
|
+
## 🌙 Dark Mode
|
|
219
|
+
|
|
220
|
+
Dark mode toggle is built-in:
|
|
221
|
+
- Click the moon/sun icon in the header
|
|
222
|
+
- Respects system preference
|
|
223
|
+
- Smooth transitions between themes
|
|
224
|
+
|
|
225
|
+
## 🧪 Testing
|
|
226
|
+
|
|
227
|
+
Add your test files alongside component files:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
src/
|
|
231
|
+
├── lib/
|
|
232
|
+
│ ├── components/
|
|
233
|
+
│ │ ├── Callout.svelte
|
|
234
|
+
│ │ └── Callout.test.ts
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Run tests:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
npm run test
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## 📖 Documentation Structure
|
|
244
|
+
|
|
245
|
+
See guides for more details:
|
|
246
|
+
|
|
247
|
+
- [Setup Guide](./docs/setup.md) - Installation and getting started
|
|
248
|
+
- [Configuration Guide](./docs/guides/configuration.md) - Customize your docs
|
|
249
|
+
- [Components Guide](./docs/api/components.md) - Available components
|
|
250
|
+
|
|
251
|
+
## 🎯 Best Practices
|
|
252
|
+
|
|
253
|
+
### Writing Documentation
|
|
254
|
+
|
|
255
|
+
- Use clear, concise headings
|
|
256
|
+
- Include code examples for every feature
|
|
257
|
+
- Use Callout components for important notes
|
|
258
|
+
- Add screenshots for visual features
|
|
259
|
+
- Link to related documentation
|
|
260
|
+
|
|
261
|
+
### Organization
|
|
262
|
+
|
|
263
|
+
- Group related docs in folders
|
|
264
|
+
- Use consistent naming (kebab-case)
|
|
265
|
+
- Update `_config.json` when adding sections
|
|
266
|
+
- Keep folder depth reasonable (2-3 levels)
|
|
267
|
+
|
|
268
|
+
### Deployment
|
|
269
|
+
|
|
270
|
+
- Test build locally: `npm run build`
|
|
271
|
+
- Use preview deployment for PRs
|
|
272
|
+
- Monitor build logs for errors
|
|
273
|
+
- Keep dependencies updated
|
|
274
|
+
|
|
275
|
+
## 🐛 Troubleshooting
|
|
276
|
+
|
|
277
|
+
### Build fails
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Clear cache and rebuild
|
|
281
|
+
rm -rf .svelte-kit
|
|
282
|
+
npm run build
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Port already in use
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Change port in vite.config.ts
|
|
289
|
+
# Or kill process: lsof -ti:5173 | xargs kill -9
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Search not working
|
|
293
|
+
|
|
294
|
+
- Run build: `npm run build`
|
|
295
|
+
- Search is only available in production builds
|
|
296
|
+
|
|
297
|
+
## 📦 Tech Stack
|
|
298
|
+
|
|
299
|
+
- **Framework:** SvelteKit 2.x
|
|
300
|
+
- **UI Framework:** Svelte 5
|
|
301
|
+
- **Styling:** Tailwind CSS
|
|
302
|
+
- **Build Tool:** Vite
|
|
303
|
+
- **Search:** Pagefind
|
|
304
|
+
- **Deployment:** Static adapter (adapter-static)
|
|
305
|
+
|
|
306
|
+
## 📄 License
|
|
307
|
+
|
|
308
|
+
This template is provided as-is for your use.
|
|
309
|
+
|
|
310
|
+
## 🤝 Contributing
|
|
311
|
+
|
|
312
|
+
Feel free to customize this template for your needs!
|
|
313
|
+
|
|
314
|
+
## 📞 Support
|
|
315
|
+
|
|
316
|
+
For detailed guides and documentation, see the `docs/` folder.
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
**Happy documenting!** 📚✨
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Documentation Starter",
|
|
3
|
+
"baseUrl": "/docs",
|
|
4
|
+
"description": "A documentation site built with Svelte Docs System",
|
|
5
|
+
"logo": "/logo.svg",
|
|
6
|
+
"sections": [
|
|
7
|
+
{
|
|
8
|
+
"title": "Getting Started",
|
|
9
|
+
"pages": [
|
|
10
|
+
{ "label": "Home", "path": "/docs" },
|
|
11
|
+
{ "label": "Setup", "path": "/docs/setup" }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"title": "Guides",
|
|
16
|
+
"pages": [
|
|
17
|
+
{ "label": "Configuration", "path": "/docs/guides/configuration" },
|
|
18
|
+
{ "label": "Vercel Deployment", "path": "/docs/guides/vercel-deployment" },
|
|
19
|
+
{ "label": "Netlify Deployment", "path": "/docs/guides/netlify-deployment" },
|
|
20
|
+
{ "label": "GitHub Pages", "path": "/docs/guides/github-pages-deployment" }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"title": "API Reference",
|
|
25
|
+
"pages": [
|
|
26
|
+
{ "label": "Overview", "path": "/docs/api/overview" },
|
|
27
|
+
{ "label": "Components", "path": "/docs/api/components" }
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"sidebar": {
|
|
32
|
+
"collapsible": true,
|
|
33
|
+
"showToc": true
|
|
34
|
+
},
|
|
35
|
+
"footer": {
|
|
36
|
+
"showLastUpdated": true,
|
|
37
|
+
"showEditLink": false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Available Components
|
|
3
|
+
description: Built-in Svelte components for documentation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Available Components
|
|
7
|
+
|
|
8
|
+
This documentation site includes several pre-built Svelte components for enhanced documentation experiences.
|
|
9
|
+
|
|
10
|
+
## Callout
|
|
11
|
+
|
|
12
|
+
Display informational messages with different variants.
|
|
13
|
+
|
|
14
|
+
```svelte
|
|
15
|
+
<Callout variant="info" title="Information">
|
|
16
|
+
This is an informational message.
|
|
17
|
+
</Callout>
|
|
18
|
+
|
|
19
|
+
<Callout variant="warning" title="Warning">
|
|
20
|
+
This is a warning message.
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
23
|
+
<Callout variant="success" title="Success">
|
|
24
|
+
This is a success message.
|
|
25
|
+
</Callout>
|
|
26
|
+
|
|
27
|
+
<Callout variant="error" title="Error">
|
|
28
|
+
This is an error message.
|
|
29
|
+
</Callout>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Props
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Required | Description |
|
|
35
|
+
|------|------|----------|-------------|
|
|
36
|
+
| variant | 'info' \| 'warning' \| 'success' \| 'error' | true | Style variant |
|
|
37
|
+
| title | string | false | Optional title |
|
|
38
|
+
| children | HTMLContent | true | Message content |
|
|
39
|
+
|
|
40
|
+
## CodeBlock
|
|
41
|
+
|
|
42
|
+
Syntax-highlighted code blocks with copy functionality.
|
|
43
|
+
|
|
44
|
+
```svelte
|
|
45
|
+
<CodeBlock
|
|
46
|
+
code={`const greeting = 'Hello, World!';
|
|
47
|
+
console.log(greeting);`}
|
|
48
|
+
language="javascript"
|
|
49
|
+
filename="example.js"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Props
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Required | Description |
|
|
56
|
+
|------|------|----------|-------------|
|
|
57
|
+
| code | string | true | Code content |
|
|
58
|
+
| language | string | true | Language (js, ts, python, etc) |
|
|
59
|
+
| filename | string | false | Optional filename display |
|
|
60
|
+
|
|
61
|
+
## Tabs
|
|
62
|
+
|
|
63
|
+
Display tabbed content with easy switching.
|
|
64
|
+
|
|
65
|
+
```svelte
|
|
66
|
+
<Tabs items={[
|
|
67
|
+
{ label: 'JavaScript', content: '<code>const x = 42;</code>' },
|
|
68
|
+
{ label: 'Python', content: '<code>x = 42</code>' },
|
|
69
|
+
{ label: 'Rust', content: '<code>let x = 42;</code>' }
|
|
70
|
+
]} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Props
|
|
74
|
+
|
|
75
|
+
| Prop | Type | Required | Description |
|
|
76
|
+
|------|------|----------|-------------|
|
|
77
|
+
| items | Tab[] | true | Array of tab items |
|
|
78
|
+
|
|
79
|
+
### Tab Object
|
|
80
|
+
|
|
81
|
+
| Property | Type | Description |
|
|
82
|
+
|----------|------|-------------|
|
|
83
|
+
| label | string | Tab title |
|
|
84
|
+
| content | string | HTML content |
|
|
85
|
+
|
|
86
|
+
## APITable
|
|
87
|
+
|
|
88
|
+
Display API reference tables with consistent formatting.
|
|
89
|
+
|
|
90
|
+
```svelte
|
|
91
|
+
<APITable
|
|
92
|
+
title="Function Parameters"
|
|
93
|
+
columns={[
|
|
94
|
+
{ key: 'name', label: 'Parameter Name' },
|
|
95
|
+
{ key: 'type', label: 'Type' },
|
|
96
|
+
{ key: 'description', label: 'Description' }
|
|
97
|
+
]}
|
|
98
|
+
rows={[
|
|
99
|
+
{ name: 'input', type: 'string', description: 'The input text' },
|
|
100
|
+
{ name: 'options', type: 'object', description: 'Configuration options' }
|
|
101
|
+
]}
|
|
102
|
+
/>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Props
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Required | Description |
|
|
108
|
+
|------|------|----------|-------------|
|
|
109
|
+
| title | string | false | Optional table title |
|
|
110
|
+
| columns | Column[] | true | Column definitions |
|
|
111
|
+
| rows | any[] | true | Table data rows |
|
|
112
|
+
|
|
113
|
+
## Image
|
|
114
|
+
|
|
115
|
+
Optimized image display with optional captions and zoom.
|
|
116
|
+
|
|
117
|
+
```svelte
|
|
118
|
+
<Image
|
|
119
|
+
src="/images/screenshot.png"
|
|
120
|
+
alt="Screenshot"
|
|
121
|
+
caption="Figure 1: Main dashboard"
|
|
122
|
+
zoomable={true}
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Props
|
|
127
|
+
|
|
128
|
+
| Prop | Type | Required | Description |
|
|
129
|
+
|------|------|----------|-------------|
|
|
130
|
+
| src | string | true | Image URL |
|
|
131
|
+
| alt | string | true | Alt text for accessibility |
|
|
132
|
+
| caption | string | false | Optional caption |
|
|
133
|
+
| zoomable | boolean | false | Enable click to zoom |
|
|
134
|
+
|
|
135
|
+
## Breadcrumbs
|
|
136
|
+
|
|
137
|
+
Navigation breadcrumbs showing current page location.
|
|
138
|
+
|
|
139
|
+
```svelte
|
|
140
|
+
<Breadcrumbs items={[
|
|
141
|
+
{ label: 'Home', href: '/' },
|
|
142
|
+
{ label: 'Guides', href: '/guides' },
|
|
143
|
+
{ label: 'Setup' }
|
|
144
|
+
]} />
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Props
|
|
148
|
+
|
|
149
|
+
| Prop | Type | Required | Description |
|
|
150
|
+
|------|------|----------|-------------|
|
|
151
|
+
| items | BreadcrumbItem[] | true | Breadcrumb items |
|
|
152
|
+
|
|
153
|
+
### BreadcrumbItem
|
|
154
|
+
|
|
155
|
+
| Property | Type | Description |
|
|
156
|
+
|----------|------|-------------|
|
|
157
|
+
| label | string | Display text |
|
|
158
|
+
| href | string | Optional link URL |
|
|
159
|
+
|
|
160
|
+
## Search
|
|
161
|
+
|
|
162
|
+
Full-text search component (automatically included in layout).
|
|
163
|
+
|
|
164
|
+
### Features
|
|
165
|
+
|
|
166
|
+
- Type to search across all documentation
|
|
167
|
+
- Keyboard shortcut: `Cmd+K` / `Ctrl+K`
|
|
168
|
+
- Highlight matching results
|
|
169
|
+
- Fast client-side search
|
|
170
|
+
|
|
171
|
+
## Navbar
|
|
172
|
+
|
|
173
|
+
Top navigation bar (automatically included).
|
|
174
|
+
|
|
175
|
+
### Features
|
|
176
|
+
|
|
177
|
+
- Logo and site title
|
|
178
|
+
- Theme toggle (light/dark mode)
|
|
179
|
+
- Language switcher (if configured)
|
|
180
|
+
- Search access
|
|
181
|
+
- Mobile menu
|
|
182
|
+
|
|
183
|
+
## Sidebar
|
|
184
|
+
|
|
185
|
+
Documentation navigation sidebar.
|
|
186
|
+
|
|
187
|
+
### Features
|
|
188
|
+
|
|
189
|
+
- Folder structure navigation
|
|
190
|
+
- Active page highlighting
|
|
191
|
+
- Collapsible sections
|
|
192
|
+
- Mobile-friendly collapse
|
|
193
|
+
- Custom section ordering
|
|
194
|
+
|
|
195
|
+
## Footer
|
|
196
|
+
|
|
197
|
+
Site footer with links and information.
|
|
198
|
+
|
|
199
|
+
### Features
|
|
200
|
+
|
|
201
|
+
- Copyright information
|
|
202
|
+
- Social media links
|
|
203
|
+
- Documentation links
|
|
204
|
+
- Last updated timestamp
|
|
205
|
+
|
|
206
|
+
## Custom Components
|
|
207
|
+
|
|
208
|
+
Create your own components and use them in markdown:
|
|
209
|
+
|
|
210
|
+
```svelte
|
|
211
|
+
<!-- Save as src/lib/components/MyComponent.svelte -->
|
|
212
|
+
<script lang="ts">
|
|
213
|
+
export let title: string;
|
|
214
|
+
export let items: string[];
|
|
215
|
+
</script>
|
|
216
|
+
|
|
217
|
+
<div class="my-component">
|
|
218
|
+
<h3>{title}</h3>
|
|
219
|
+
<ul>
|
|
220
|
+
{#each items as item}
|
|
221
|
+
<li>{item}</li>
|
|
222
|
+
{/each}
|
|
223
|
+
</ul>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<style>
|
|
227
|
+
.my-component {
|
|
228
|
+
padding: 1rem;
|
|
229
|
+
border: 1px solid #ddd;
|
|
230
|
+
}
|
|
231
|
+
</style>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Then import and use in your markdown:
|
|
235
|
+
|
|
236
|
+
```markdown
|
|
237
|
+
---
|
|
238
|
+
title: Example Page
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
<script>
|
|
242
|
+
import MyComponent from '$lib/components/MyComponent.svelte';
|
|
243
|
+
</script>
|
|
244
|
+
|
|
245
|
+
# My Page
|
|
246
|
+
|
|
247
|
+
<MyComponent title="Items" items={['Item 1', 'Item 2']} />
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Best Practices
|
|
251
|
+
|
|
252
|
+
- Use Callout for important notes and warnings
|
|
253
|
+
- Use CodeBlock with language highlighting for code examples
|
|
254
|
+
- Use Tabs for language/framework variations
|
|
255
|
+
- Use APITable for API reference documentation
|
|
256
|
+
- Use Image for screenshots and diagrams
|
|
257
|
+
- Keep components simple and focused on content
|