@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,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Deploy to Vercel
|
|
3
|
+
description: Deploy your documentation site to Vercel in minutes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vercel Deployment
|
|
7
|
+
|
|
8
|
+
Deploy your documentation site to Vercel with automatic updates from Git.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
- GitHub account and repository with your docs
|
|
13
|
+
- Vercel account (free at https://vercel.com)
|
|
14
|
+
|
|
15
|
+
## Step-by-Step Guide
|
|
16
|
+
|
|
17
|
+
### 1. Push Your Code to GitHub
|
|
18
|
+
|
|
19
|
+
If you haven't already:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git add .
|
|
23
|
+
git commit -m "Initial commit"
|
|
24
|
+
git push origin main
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Import Project to Vercel
|
|
28
|
+
|
|
29
|
+
1. Go to https://vercel.com/new
|
|
30
|
+
2. Select "Import Git Repository"
|
|
31
|
+
3. Find and select your docs repository
|
|
32
|
+
4. Click "Import"
|
|
33
|
+
|
|
34
|
+
### 3. Configure Build Settings
|
|
35
|
+
|
|
36
|
+
Vercel should auto-detect settings. Verify:
|
|
37
|
+
|
|
38
|
+
- **Framework Preset:** SvelteKit
|
|
39
|
+
- **Build Command:** `npm run build`
|
|
40
|
+
- **Output Directory:** `build`
|
|
41
|
+
- **Environment Variables:** Add any needed `.env` variables
|
|
42
|
+
|
|
43
|
+
### 4. Deploy
|
|
44
|
+
|
|
45
|
+
Click "Deploy" and wait for the build to complete.
|
|
46
|
+
|
|
47
|
+
Your site will be available at `https://your-project.vercel.app`
|
|
48
|
+
|
|
49
|
+
## Custom Domain
|
|
50
|
+
|
|
51
|
+
1. Go to project settings → Domains
|
|
52
|
+
2. Add your custom domain
|
|
53
|
+
3. Follow DNS configuration instructions
|
|
54
|
+
4. Wait for DNS to propagate (usually 24 hours)
|
|
55
|
+
|
|
56
|
+
## Automatic Deployments
|
|
57
|
+
|
|
58
|
+
Every push to your main branch automatically triggers a new deployment.
|
|
59
|
+
|
|
60
|
+
Create a preview deployment by pushing to any other branch.
|
|
61
|
+
|
|
62
|
+
## Environment Variables
|
|
63
|
+
|
|
64
|
+
Add secrets in Project Settings → Environment Variables:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
VITE_API_URL=https://api.example.com
|
|
68
|
+
VITE_PUBLIC_KEY=your_public_key
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Monitoring Deployments
|
|
72
|
+
|
|
73
|
+
Check deployment status in the Vercel dashboard:
|
|
74
|
+
- View logs
|
|
75
|
+
- See performance metrics
|
|
76
|
+
- Rollback to previous versions
|
|
77
|
+
|
|
78
|
+
## Troubleshooting
|
|
79
|
+
|
|
80
|
+
### Build Fails
|
|
81
|
+
|
|
82
|
+
Check the build logs in Vercel dashboard for errors.
|
|
83
|
+
|
|
84
|
+
Common issues:
|
|
85
|
+
- Missing dependencies: Run `npm install` locally first
|
|
86
|
+
- TypeScript errors: Run `npm run check` locally
|
|
87
|
+
- Node version mismatch: Add `.nvmrc` file with Node version
|
|
88
|
+
|
|
89
|
+
### Site Not Found
|
|
90
|
+
|
|
91
|
+
- Wait a few minutes for DNS propagation
|
|
92
|
+
- Clear browser cache (Ctrl+Shift+Del)
|
|
93
|
+
- Check domain settings in Vercel dashboard
|
|
94
|
+
|
|
95
|
+
### Performance Issues
|
|
96
|
+
|
|
97
|
+
- Review Core Web Vitals in Vercel Analytics
|
|
98
|
+
- Optimize images using the Image component
|
|
99
|
+
- Enable caching in Vercel settings
|
|
100
|
+
|
|
101
|
+
## Advanced Configuration
|
|
102
|
+
|
|
103
|
+
### Vercel Configuration File
|
|
104
|
+
|
|
105
|
+
Create `vercel.json` for advanced settings:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"buildCommand": "npm run build",
|
|
110
|
+
"outputDirectory": "build",
|
|
111
|
+
"env": {
|
|
112
|
+
"VITE_API_URL": "@vite_api_url"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Environment Variables from Secrets
|
|
118
|
+
|
|
119
|
+
Use Vercel Secrets for sensitive data:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
vercel env add VITE_API_KEY
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Then reference in deployment settings.
|
|
126
|
+
|
|
127
|
+
## Next Steps
|
|
128
|
+
|
|
129
|
+
- Set up analytics to track documentation usage
|
|
130
|
+
- Configure custom error pages
|
|
131
|
+
- Enable preview deployments for pull requests
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Documentation Home
|
|
3
|
+
description: Welcome to your documentation site
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Welcome to Your Documentation
|
|
7
|
+
|
|
8
|
+
This is the main landing page for your documentation. Edit this file at `docs/index.md` to customize your documentation home page.
|
|
9
|
+
|
|
10
|
+
## Getting Started
|
|
11
|
+
|
|
12
|
+
1. **Add documentation files** - Create `.md` files in the `docs/` folder
|
|
13
|
+
2. **Organize with folders** - Use folders to organize documentation by topic (e.g., `docs/guides/`, `docs/api/`)
|
|
14
|
+
3. **Update configuration** - Edit `docs/_config.json` to customize navigation and branding
|
|
15
|
+
4. **Deploy** - Build and deploy your docs site
|
|
16
|
+
|
|
17
|
+
## Documentation Structure
|
|
18
|
+
|
|
19
|
+
Your documentation can be organized like this:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
docs/
|
|
23
|
+
├── index.md → Home page (/docs)
|
|
24
|
+
├── setup.md → /docs/setup
|
|
25
|
+
├── guides/
|
|
26
|
+
│ ├── getting-started.md → /docs/guides/getting-started
|
|
27
|
+
│ └── configuration.md → /docs/guides/configuration
|
|
28
|
+
├── api/
|
|
29
|
+
│ ├── overview.md → /docs/api/overview
|
|
30
|
+
│ └── reference.md → /docs/api/reference
|
|
31
|
+
└── _config.json → Navigation configuration
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- **Markdown Support** - Write docs in simple markdown
|
|
37
|
+
- **Folder-Based Routing** - Folder structure automatically becomes navigation
|
|
38
|
+
- **Dark Mode** - Built-in light/dark theme support
|
|
39
|
+
- **Search** - Full-text search across all documentation
|
|
40
|
+
- **Responsive Design** - Mobile-friendly documentation site
|
|
41
|
+
- **Custom Components** - Use interactive Svelte components in your docs
|
|
42
|
+
|
|
43
|
+
## Next Steps
|
|
44
|
+
|
|
45
|
+
- Check out the [Setup Guide](./setup.md) for installation instructions
|
|
46
|
+
- Read the [Configuration Guide](./guides/configuration.md) to customize your docs
|
|
47
|
+
- Explore [Components](./api/components.md) to learn about available UI elements
|
|
48
|
+
|
|
49
|
+
Happy documenting! 📚
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Setup Guide
|
|
3
|
+
description: Get started with your documentation site in minutes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Guide
|
|
7
|
+
|
|
8
|
+
Get your documentation site up and running in just a few minutes.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
- Node.js 18+ installed
|
|
13
|
+
- npm or pnpm package manager
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
1. **Clone or create from template**
|
|
18
|
+
```bash
|
|
19
|
+
git clone <your-repo>
|
|
20
|
+
cd docs-starter
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Install dependencies**
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
# or
|
|
27
|
+
pnpm install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **Start the development server**
|
|
31
|
+
```bash
|
|
32
|
+
npm run dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
4. **Open in browser**
|
|
36
|
+
Visit `http://localhost:5173` to see your documentation site
|
|
37
|
+
|
|
38
|
+
## Project Structure
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
docs-starter/
|
|
42
|
+
├── docs/ # Your documentation files
|
|
43
|
+
│ ├── index.md # Home page
|
|
44
|
+
│ ├── setup.md # This file
|
|
45
|
+
│ ├── guides/ # Guide documentation
|
|
46
|
+
│ ├── api/ # API reference
|
|
47
|
+
│ └── _config.json # Navigation configuration
|
|
48
|
+
├── src/ # Source code
|
|
49
|
+
│ ├── routes/ # SvelteKit routes
|
|
50
|
+
│ ├── lib/ # Reusable components
|
|
51
|
+
│ └── app.css # Global styles
|
|
52
|
+
└── package.json # Project dependencies
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Development
|
|
56
|
+
|
|
57
|
+
### Running the dev server
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm run dev
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The site will hot-reload when you edit files.
|
|
64
|
+
|
|
65
|
+
### Building for production
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This creates an optimized production build in the `build/` folder.
|
|
72
|
+
|
|
73
|
+
### Preview production build
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run preview
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Type checking
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm run check
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Customization
|
|
86
|
+
|
|
87
|
+
### Add documentation
|
|
88
|
+
|
|
89
|
+
Create new markdown files in the `docs/` folder:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
docs/
|
|
93
|
+
├── guides/
|
|
94
|
+
│ ├── getting-started.md
|
|
95
|
+
│ ├── advanced-usage.md
|
|
96
|
+
│ └── troubleshooting.md
|
|
97
|
+
└── api/
|
|
98
|
+
├── overview.md
|
|
99
|
+
└── reference.md
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Configure navigation
|
|
103
|
+
|
|
104
|
+
Edit `docs/_config.json` to customize the sidebar navigation:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"name": "My Docs",
|
|
109
|
+
"sections": [
|
|
110
|
+
{
|
|
111
|
+
"title": "Getting Started",
|
|
112
|
+
"pages": [
|
|
113
|
+
{ "label": "Setup", "path": "/docs/setup" },
|
|
114
|
+
{ "label": "Quick Start", "path": "/docs/guides/getting-started" }
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Customize styling
|
|
122
|
+
|
|
123
|
+
Edit `tailwind.config.ts` and `src/app.css` to match your brand colors and typography.
|
|
124
|
+
|
|
125
|
+
## Deployment
|
|
126
|
+
|
|
127
|
+
Your documentation site can be deployed to:
|
|
128
|
+
|
|
129
|
+
- **Vercel** - See [Vercel Deployment Guide](./guides/vercel-deployment.md)
|
|
130
|
+
- **Netlify** - See [Netlify Deployment Guide](./guides/netlify-deployment.md)
|
|
131
|
+
- **GitHub Pages** - See [GitHub Pages Deployment Guide](./guides/github-pages-deployment.md)
|
|
132
|
+
|
|
133
|
+
## Troubleshooting
|
|
134
|
+
|
|
135
|
+
### Build fails
|
|
136
|
+
- Clear `.svelte-kit/` folder and rebuild: `rm -rf .svelte-kit/ && npm run build`
|
|
137
|
+
- Check for TypeScript errors: `npm run check`
|
|
138
|
+
|
|
139
|
+
### Port already in use
|
|
140
|
+
- Change port in `vite.config.ts`
|
|
141
|
+
- Or kill existing process: `lsof -ti:5173 | xargs kill -9`
|
|
142
|
+
|
|
143
|
+
### Dependencies issue
|
|
144
|
+
- Delete `node_modules/` and `package-lock.json`
|
|
145
|
+
- Reinstall: `npm install`
|
|
146
|
+
|
|
147
|
+
## Need Help?
|
|
148
|
+
|
|
149
|
+
Check the guides and API reference in the documentation, or consult the official SvelteKit documentation at https://kit.svelte.dev
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docs-starter",
|
|
3
|
+
"description": "A documentation site built with Svelte Docs System",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite dev",
|
|
8
|
+
"build": "vite build && pagefind --site build || echo 'Pagefind indexing skipped'",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
11
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
12
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@sveltejs/adapter-static": "^3.0.10",
|
|
16
|
+
"@sveltejs/kit": "^2.50.1",
|
|
17
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
18
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
19
|
+
"pagefind": "^1.4.0",
|
|
20
|
+
"postcss": "^8.5.6",
|
|
21
|
+
"svelte": "^5.48.2",
|
|
22
|
+
"svelte-check": "^4.3.5",
|
|
23
|
+
"tailwindcss": "^4.1.18",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vite": "^7.3.1"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"gray-matter": "^4.0.3",
|
|
29
|
+
"marked": "^17.0.1"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@layer base {
|
|
4
|
+
:root {
|
|
5
|
+
color-scheme: light;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:root.dark {
|
|
9
|
+
color-scheme: dark;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
html {
|
|
13
|
+
@apply antialiased scroll-smooth;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
@apply bg-white dark:bg-slate-950 text-slate-900 dark:text-slate-100 transition-colors;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@layer components {
|
|
22
|
+
.doc-container {
|
|
23
|
+
@apply max-w-7xl mx-auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.doc-content {
|
|
27
|
+
@apply max-w-none;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Smooth transitions */
|
|
32
|
+
* {
|
|
33
|
+
@apply transition-colors duration-200;
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
2
|
+
// for information about these interfaces
|
|
3
|
+
declare global {
|
|
4
|
+
namespace App {
|
|
5
|
+
// interface Error {}
|
|
6
|
+
// interface Locals {}
|
|
7
|
+
// interface PageData {}
|
|
8
|
+
// interface PageState {}
|
|
9
|
+
// interface Platform {}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
%sveltekit.head%
|
|
7
|
+
</head>
|
|
8
|
+
<body data-sveltekit-preload-data="hover">
|
|
9
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* API Reference Table component
|
|
4
|
+
* Displays API documentation in a clean, organized table format
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface Column {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
width?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Row {
|
|
14
|
+
[key: string]: string | number | boolean | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
columns: Column[];
|
|
19
|
+
rows: Row[];
|
|
20
|
+
title?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let { columns, rows, title, description }: Props = $props();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div class="my-6">
|
|
28
|
+
{#if title}
|
|
29
|
+
<h3 class="mb-2 text-lg font-bold text-gray-900 dark:text-white">{title}</h3>
|
|
30
|
+
{/if}
|
|
31
|
+
|
|
32
|
+
{#if description}
|
|
33
|
+
<p class="mb-4 text-gray-600 dark:text-gray-400">{description}</p>
|
|
34
|
+
{/if}
|
|
35
|
+
|
|
36
|
+
<div class="overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-700">
|
|
37
|
+
<table class="w-full text-sm">
|
|
38
|
+
<thead class="bg-gray-100 dark:bg-gray-800">
|
|
39
|
+
<tr>
|
|
40
|
+
{#each columns as column}
|
|
41
|
+
<th
|
|
42
|
+
class="px-4 py-3 text-left font-semibold text-gray-900 dark:text-gray-100"
|
|
43
|
+
style={column.width ? `width: ${column.width}` : ''}
|
|
44
|
+
>
|
|
45
|
+
{column.label}
|
|
46
|
+
</th>
|
|
47
|
+
{/each}
|
|
48
|
+
</tr>
|
|
49
|
+
</thead>
|
|
50
|
+
<tbody>
|
|
51
|
+
{#each rows as row, rowIndex}
|
|
52
|
+
<tr class="border-t border-gray-200 dark:border-gray-700 {rowIndex % 2 === 0 ? 'bg-white dark:bg-gray-900' : 'bg-gray-50 dark:bg-gray-800/50'}">
|
|
53
|
+
{#each columns as column}
|
|
54
|
+
<td class="px-4 py-3 text-gray-800 dark:text-gray-300">
|
|
55
|
+
<div class="break-words font-mono text-xs">
|
|
56
|
+
{#if typeof row[column.key] === 'boolean'}
|
|
57
|
+
<span class="inline-block rounded bg-gray-200 px-2 py-1 dark:bg-gray-700">
|
|
58
|
+
{row[column.key] ? 'true' : 'false'}
|
|
59
|
+
</span>
|
|
60
|
+
{:else if row[column.key] === null}
|
|
61
|
+
<span class="text-gray-400 dark:text-gray-500">null</span>
|
|
62
|
+
{:else}
|
|
63
|
+
{row[column.key]}
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
|
+
</td>
|
|
67
|
+
{/each}
|
|
68
|
+
</tr>
|
|
69
|
+
{/each}
|
|
70
|
+
</tbody>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{#if rows.length === 0}
|
|
75
|
+
<div class="py-8 text-center text-gray-500 dark:text-gray-400">
|
|
76
|
+
No data available
|
|
77
|
+
</div>
|
|
78
|
+
{/if}
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
table {
|
|
83
|
+
width: 100%;
|
|
84
|
+
border-collapse: collapse;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
thead {
|
|
88
|
+
background-color: #f3f4f6;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:global(.dark) thead {
|
|
92
|
+
background-color: #1f2937;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
th {
|
|
96
|
+
border-bottom: 1px solid #e5e7eb;
|
|
97
|
+
padding: 0.75rem 1rem;
|
|
98
|
+
text-align: left;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
color: #111827;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:global(.dark) th {
|
|
104
|
+
border-bottom-color: #374151;
|
|
105
|
+
color: #f3f4f6;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
td {
|
|
109
|
+
border-bottom: 1px solid #e5e7eb;
|
|
110
|
+
padding: 0.75rem 1rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:global(.dark) td {
|
|
114
|
+
border-bottom-color: #374151;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
tbody tr:last-child td {
|
|
118
|
+
border-bottom: none;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render, screen } from '@testing-library/svelte';
|
|
3
|
+
import APITable from './APITable.svelte';
|
|
4
|
+
|
|
5
|
+
describe('APITable Component', () => {
|
|
6
|
+
it('renders table with columns', () => {
|
|
7
|
+
const columns = [
|
|
8
|
+
{ key: 'name', label: 'Name' },
|
|
9
|
+
{ key: 'type', label: 'Type' }
|
|
10
|
+
];
|
|
11
|
+
const rows = [{ name: 'param1', type: 'string' }];
|
|
12
|
+
|
|
13
|
+
const { container } = render(APITable, { props: { columns, rows } });
|
|
14
|
+
|
|
15
|
+
expect(container.querySelector('table')).toBeTruthy();
|
|
16
|
+
expect(screen.getByText('Name')).toBeTruthy();
|
|
17
|
+
expect(screen.getByText('Type')).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumbs navigation component
|
|
4
|
+
* Shows the current page path for easy navigation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface BreadcrumbItem {
|
|
8
|
+
label: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
items: BreadcrumbItem[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { items }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<nav aria-label="Breadcrumb" class="mb-6">
|
|
20
|
+
<ol class="flex items-center gap-2 text-sm">
|
|
21
|
+
{#each items as item, index}
|
|
22
|
+
<li class="flex items-center gap-2">
|
|
23
|
+
{#if item.href && index < items.length - 1}
|
|
24
|
+
<a
|
|
25
|
+
href={item.href}
|
|
26
|
+
class="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
|
|
27
|
+
>
|
|
28
|
+
{item.label}
|
|
29
|
+
</a>
|
|
30
|
+
{:else}
|
|
31
|
+
<span class={index === items.length - 1 ? 'font-semibold text-gray-900 dark:text-white' : 'text-gray-600 dark:text-gray-400'}>
|
|
32
|
+
{item.label}
|
|
33
|
+
</span>
|
|
34
|
+
{/if}
|
|
35
|
+
|
|
36
|
+
{#if index < items.length - 1}
|
|
37
|
+
<i class="fa-solid fa-chevron-right text-gray-400 dark:text-gray-500"></i>
|
|
38
|
+
{/if}
|
|
39
|
+
</li>
|
|
40
|
+
{/each}
|
|
41
|
+
</ol>
|
|
42
|
+
</nav>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
nav {
|
|
46
|
+
margin-bottom: 1.5rem;
|
|
47
|
+
font-size: 0.875rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ol {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 0.5rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
li {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 0.5rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a {
|
|
63
|
+
color: #2563eb;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a:hover {
|
|
67
|
+
color: #1d4ed8;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:global(.dark) a {
|
|
71
|
+
color: #60a5fa;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:global(.dark) a:hover {
|
|
75
|
+
color: #93c5fd;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
span {
|
|
79
|
+
color: #4b5563;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:global(.dark) span {
|
|
83
|
+
color: #9ca3af;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render, screen } from '@testing-library/svelte';
|
|
3
|
+
import Breadcrumbs from './Breadcrumbs.svelte';
|
|
4
|
+
|
|
5
|
+
describe('Breadcrumbs Component', () => {
|
|
6
|
+
it('renders all breadcrumb items', () => {
|
|
7
|
+
const items = [
|
|
8
|
+
{ label: 'Home', href: '/' },
|
|
9
|
+
{ label: 'Docs', href: '/docs' },
|
|
10
|
+
{ label: 'API' }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
render(Breadcrumbs, { props: { items } });
|
|
14
|
+
|
|
15
|
+
expect(screen.getByText('Home')).toBeTruthy();
|
|
16
|
+
expect(screen.getByText('Docs')).toBeTruthy();
|
|
17
|
+
expect(screen.getByText('API')).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
});
|