@alliance-droid/svelte-docs-system 0.0.2 → 0.1.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/README.md +155 -23
- package/dist/components/APITable.svelte.d.ts +21 -0
- package/dist/components/Breadcrumbs.svelte.d.ts +14 -0
- package/dist/components/Callout.svelte.d.ts +15 -0
- package/dist/components/CodeBlock.svelte.d.ts +12 -0
- package/{src/lib → dist}/components/DocLayout.svelte +18 -6
- package/dist/components/DocLayout.svelte.d.ts +18 -0
- package/dist/components/DocsPage.svelte +39 -0
- package/dist/components/DocsPage.svelte.d.ts +8 -0
- package/dist/components/Documentation.svelte +639 -0
- package/dist/components/Footer.svelte.d.ts +10 -0
- package/dist/components/Image.svelte.d.ts +15 -0
- package/{src/lib → dist}/components/Navbar.svelte +4 -4
- package/dist/components/Navbar.svelte.d.ts +10 -0
- package/{src/lib → dist}/components/Search.svelte +2 -2
- package/dist/components/Search.svelte.d.ts +6 -0
- package/{template-starter/src/lib → dist}/components/Sidebar.svelte +2 -2
- package/dist/components/Sidebar.svelte.d.ts +9 -0
- package/dist/components/Tabs.svelte.d.ts +16 -0
- package/dist/config.d.ts +93 -0
- package/dist/config.js +89 -0
- package/dist/configLoader.d.ts +48 -0
- package/dist/configLoader.js +187 -0
- package/dist/configParser.d.ts +27 -0
- package/dist/configParser.js +208 -0
- package/{template-starter/src/lib/index.ts → dist/index.d.ts} +6 -7
- package/dist/index.js +18 -0
- package/dist/navigationBuilder.d.ts +64 -0
- package/dist/navigationBuilder.js +225 -0
- package/dist/plugin.d.ts +30 -0
- package/dist/plugin.js +172 -0
- package/dist/routing.d.ts +48 -0
- package/dist/routing.js +92 -0
- package/dist/stores/i18n.d.ts +20 -0
- package/dist/stores/i18n.js +119 -0
- package/dist/stores/nav.d.ts +20 -0
- package/dist/stores/nav.js +15 -0
- package/dist/stores/search.d.ts +49 -0
- package/dist/stores/search.js +127 -0
- package/dist/stores/theme.d.ts +7 -0
- package/dist/stores/theme.js +152 -0
- package/dist/stores/version.d.ts +18 -0
- package/dist/stores/version.js +93 -0
- package/dist/themeCustomization.d.ts +46 -0
- package/dist/themeCustomization.js +188 -0
- package/dist/utils/highlight.d.ts +13 -0
- package/dist/utils/highlight.js +83 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/markdown.d.ts +40 -0
- package/dist/utils/markdown.js +165 -0
- package/package.json +44 -23
- package/COMPONENTS.md +0 -365
- package/COVERAGE_REPORT.md +0 -663
- package/SEARCH_VERIFICATION.md +0 -229
- package/TEST_SUMMARY.md +0 -344
- package/bin/init.js +0 -821
- package/docs/COMPONENT_LIBRARY_INTEGRATION_REPORT.md +0 -153
- package/docs/DARK_MODE_AUDIT_REPORT.md +0 -403
- package/docs/E2E_TESTS.md +0 -354
- package/docs/TESTING.md +0 -754
- package/docs/THEME_INHERITANCE.md +0 -192
- package/docs/de/index.md +0 -41
- package/docs/en/COMPONENTS.md +0 -443
- package/docs/en/api/examples.md +0 -100
- package/docs/en/api/overview.md +0 -69
- package/docs/en/components/index.md +0 -622
- package/docs/en/config/navigation.md +0 -505
- package/docs/en/config/theme-and-colors.md +0 -395
- package/docs/en/getting-started/integration.md +0 -406
- package/docs/en/guides/common-setups.md +0 -651
- package/docs/en/index.md +0 -243
- package/docs/en/markdown.md +0 -102
- package/docs/en/routing.md +0 -64
- package/docs/en/setup.md +0 -52
- package/docs/en/troubleshooting.md +0 -704
- package/docs/es/index.md +0 -41
- package/docs/fr/index.md +0 -41
- package/docs/ja/index.md +0 -41
- package/pagefind.toml +0 -8
- package/postcss.config.js +0 -5
- package/src/app.css +0 -119
- package/src/app.d.ts +0 -13
- package/src/app.html +0 -11
- package/src/lib/components/APITable.test.ts +0 -153
- package/src/lib/components/Breadcrumbs.test.ts +0 -148
- package/src/lib/components/Callout.test.ts +0 -100
- package/src/lib/components/CodeBlock.test.ts +0 -133
- package/src/lib/components/Image.test.ts +0 -163
- package/src/lib/components/Sidebar.svelte +0 -110
- package/src/lib/components/Tabs.test.ts +0 -102
- package/src/lib/config.test.ts +0 -140
- package/src/lib/config.ts +0 -179
- package/src/lib/configIntegration.test.ts +0 -272
- package/src/lib/configLoader.ts +0 -231
- package/src/lib/configParser.test.ts +0 -217
- package/src/lib/configParser.ts +0 -234
- package/src/lib/index.ts +0 -37
- package/src/lib/integration.test.ts +0 -426
- package/src/lib/navigationBuilder.test.ts +0 -338
- package/src/lib/navigationBuilder.ts +0 -268
- package/src/lib/performance.test.ts +0 -369
- package/src/lib/routing.test.ts +0 -202
- package/src/lib/routing.ts +0 -127
- package/src/lib/search-functionality.test.ts +0 -493
- package/src/lib/stores/i18n.test.ts +0 -180
- package/src/lib/stores/i18n.ts +0 -143
- package/src/lib/stores/nav.ts +0 -36
- package/src/lib/stores/search.test.ts +0 -140
- package/src/lib/stores/search.ts +0 -162
- package/src/lib/stores/theme.test.ts +0 -117
- package/src/lib/stores/theme.ts +0 -167
- package/src/lib/stores/version.test.ts +0 -139
- package/src/lib/stores/version.ts +0 -111
- package/src/lib/themeCustomization.test.ts +0 -223
- package/src/lib/themeCustomization.ts +0 -212
- package/src/lib/utils/highlight.test.ts +0 -136
- package/src/lib/utils/highlight.ts +0 -100
- package/src/lib/utils/index.ts +0 -7
- package/src/lib/utils/markdown.test.ts +0 -357
- package/src/lib/utils/markdown.ts +0 -77
- package/src/routes/+layout.server.ts +0 -1
- package/src/routes/+layout.svelte +0 -29
- package/src/routes/+page.svelte +0 -165
- package/src/routes/quote-demo/+page.svelte +0 -141
- package/static/robots.txt +0 -3
- package/svelte.config.js +0 -15
- package/tailwind.config.ts +0 -55
- package/template-starter/.github/workflows/build.yml +0 -40
- package/template-starter/.github/workflows/deploy-github-pages.yml +0 -47
- package/template-starter/.github/workflows/deploy-netlify.yml +0 -41
- package/template-starter/.github/workflows/deploy-vercel.yml +0 -64
- package/template-starter/NPM-PACKAGE-SETUP.md +0 -233
- package/template-starter/README.md +0 -320
- package/template-starter/docs/_config.json +0 -39
- package/template-starter/docs/api/components.md +0 -257
- package/template-starter/docs/api/overview.md +0 -169
- package/template-starter/docs/guides/configuration.md +0 -145
- package/template-starter/docs/guides/github-pages-deployment.md +0 -254
- package/template-starter/docs/guides/netlify-deployment.md +0 -159
- package/template-starter/docs/guides/vercel-deployment.md +0 -131
- package/template-starter/docs/index.md +0 -49
- package/template-starter/docs/setup.md +0 -149
- package/template-starter/package.json +0 -31
- package/template-starter/pagefind.toml +0 -3
- package/template-starter/postcss.config.js +0 -5
- package/template-starter/src/app.css +0 -34
- package/template-starter/src/app.d.ts +0 -13
- package/template-starter/src/app.html +0 -11
- package/template-starter/src/lib/components/APITable.svelte +0 -120
- package/template-starter/src/lib/components/APITable.test.ts +0 -96
- package/template-starter/src/lib/components/Breadcrumbs.svelte +0 -85
- package/template-starter/src/lib/components/Breadcrumbs.test.ts +0 -82
- package/template-starter/src/lib/components/Callout.svelte +0 -60
- package/template-starter/src/lib/components/Callout.test.ts +0 -91
- package/template-starter/src/lib/components/CodeBlock.svelte +0 -68
- package/template-starter/src/lib/components/CodeBlock.test.ts +0 -62
- package/template-starter/src/lib/components/DocLayout.svelte +0 -84
- package/template-starter/src/lib/components/Footer.svelte +0 -78
- package/template-starter/src/lib/components/Image.svelte +0 -100
- package/template-starter/src/lib/components/Image.test.ts +0 -81
- package/template-starter/src/lib/components/Navbar.svelte +0 -141
- package/template-starter/src/lib/components/Search.svelte +0 -248
- package/template-starter/src/lib/components/Tabs.svelte +0 -48
- package/template-starter/src/lib/components/Tabs.test.ts +0 -89
- package/template-starter/src/routes/+layout.svelte +0 -28
- package/template-starter/src/routes/+page.svelte +0 -92
- package/template-starter/svelte.config.js +0 -17
- package/template-starter/tailwind.config.ts +0 -17
- package/template-starter/tsconfig.json +0 -13
- package/template-starter/vite.config.ts +0 -6
- package/tests/e2e/example.spec.ts +0 -345
- package/tsconfig.json +0 -20
- package/vite.config.ts +0 -6
- package/vitest.config.ts +0 -33
- package/vitest.setup.ts +0 -21
- /package/{src/lib → dist}/assets/favicon.svg +0 -0
- /package/{src/lib → dist}/components/APITable.svelte +0 -0
- /package/{src/lib → dist}/components/Breadcrumbs.svelte +0 -0
- /package/{src/lib → dist}/components/Callout.svelte +0 -0
- /package/{src/lib → dist}/components/CodeBlock.svelte +0 -0
- /package/{src/lib → dist}/components/Footer.svelte +0 -0
- /package/{src/lib → dist}/components/Image.svelte +0 -0
- /package/{src/lib → dist}/components/Tabs.svelte +0 -0
- /package/{src/lib → dist}/svelte-component-library.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,42 +1,174 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @alliance-droid/svelte-docs-system
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Drop-in documentation system for SvelteKit. Just add markdown files.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### 1. Install
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
npx sv create my-app
|
|
9
|
+
```bash
|
|
10
|
+
npm install @alliance-droid/svelte-docs-system
|
|
12
11
|
```
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
### 2. Add the Vite plugin
|
|
15
14
|
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
```ts
|
|
16
|
+
// vite.config.ts
|
|
17
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
18
|
+
import { svelteDocsPlugin } from '@alliance-droid/svelte-docs-system/plugin';
|
|
19
|
+
import { defineConfig } from 'vite';
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
plugins: [
|
|
23
|
+
svelteDocsPlugin({
|
|
24
|
+
docsPath: './docs', // Where your markdown files live
|
|
25
|
+
route: '/documentation' // URL route for docs
|
|
26
|
+
}),
|
|
27
|
+
sveltekit()
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Create the route
|
|
33
|
+
|
|
34
|
+
```svelte
|
|
35
|
+
<!-- src/routes/documentation/[...slug]/+page.svelte -->
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import { Documentation } from '@alliance-droid/svelte-docs-system';
|
|
38
|
+
import { docsStructure } from 'virtual:svelte-docs';
|
|
39
|
+
import { page } from '$app/stores';
|
|
40
|
+
|
|
41
|
+
// Get slug from URL params
|
|
42
|
+
const slug = $derived($page.params.slug || '');
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<Documentation
|
|
46
|
+
structure={docsStructure}
|
|
47
|
+
currentSlug={slug}
|
|
48
|
+
baseRoute="/documentation"
|
|
49
|
+
/>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 4. Add markdown files
|
|
53
|
+
|
|
54
|
+
Create a `docs/` folder in your project root:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
docs/
|
|
58
|
+
├── getting-started.md
|
|
59
|
+
├── installation.md
|
|
60
|
+
├── guides/
|
|
61
|
+
│ ├── basics.md
|
|
62
|
+
│ └── advanced.md
|
|
63
|
+
└── api/
|
|
64
|
+
├── overview.md
|
|
65
|
+
└── reference.md
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 5. Done!
|
|
69
|
+
|
|
70
|
+
Visit `/documentation` to see your docs. The sidebar auto-generates from your folder structure.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Markdown Frontmatter
|
|
75
|
+
|
|
76
|
+
Add metadata to your markdown files:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
---
|
|
80
|
+
title: Getting Started
|
|
81
|
+
description: Learn how to get started
|
|
82
|
+
order: 1
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
# Getting Started
|
|
86
|
+
|
|
87
|
+
Your content here...
|
|
19
88
|
```
|
|
20
89
|
|
|
21
|
-
|
|
90
|
+
- `title` - Page title (falls back to first H1 or filename)
|
|
91
|
+
- `description` - Meta description
|
|
92
|
+
- `order` - Sort order in sidebar (lower = higher)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Customization
|
|
97
|
+
|
|
98
|
+
### Using your project's layout
|
|
22
99
|
|
|
23
|
-
|
|
100
|
+
The `Documentation` component is just a regular Svelte component. It inherits your project's `+layout.svelte` automatically.
|
|
24
101
|
|
|
25
|
-
|
|
26
|
-
npm run dev
|
|
102
|
+
### Custom styling
|
|
27
103
|
|
|
28
|
-
|
|
29
|
-
|
|
104
|
+
Override CSS variables:
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
:root {
|
|
108
|
+
--color-surface: #ffffff;
|
|
109
|
+
--color-surface-hover: #f3f4f6;
|
|
110
|
+
--color-foreground: #111827;
|
|
111
|
+
--color-foreground-secondary: #374151;
|
|
112
|
+
--color-foreground-tertiary: #6b7280;
|
|
113
|
+
--color-border: #e5e7eb;
|
|
114
|
+
--color-primary: #0ea5e9;
|
|
115
|
+
}
|
|
30
116
|
```
|
|
31
117
|
|
|
32
|
-
|
|
118
|
+
### Static file serving
|
|
119
|
+
|
|
120
|
+
Make sure your `docs/` folder is served as static files. Add to `svelte.config.js`:
|
|
33
121
|
|
|
34
|
-
|
|
122
|
+
```js
|
|
123
|
+
import adapter from '@sveltejs/adapter-static';
|
|
35
124
|
|
|
36
|
-
|
|
37
|
-
|
|
125
|
+
export default {
|
|
126
|
+
kit: {
|
|
127
|
+
adapter: adapter({
|
|
128
|
+
fallback: 'index.html'
|
|
129
|
+
}),
|
|
130
|
+
prerender: {
|
|
131
|
+
handleMissingId: 'warn'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
38
135
|
```
|
|
39
136
|
|
|
40
|
-
|
|
137
|
+
Or configure Vite to serve the docs folder:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
// vite.config.ts
|
|
141
|
+
export default defineConfig({
|
|
142
|
+
server: {
|
|
143
|
+
fs: {
|
|
144
|
+
allow: ['docs']
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## API
|
|
153
|
+
|
|
154
|
+
### `Documentation` component
|
|
155
|
+
|
|
156
|
+
| Prop | Type | Default | Description |
|
|
157
|
+
|------|------|---------|-------------|
|
|
158
|
+
| `structure` | `DocFolder` | required | Docs structure from `virtual:svelte-docs` |
|
|
159
|
+
| `currentSlug` | `string` | `''` | Current page slug |
|
|
160
|
+
| `baseRoute` | `string` | `'/documentation'` | Base URL route |
|
|
161
|
+
| `class` | `string` | `''` | Additional CSS classes |
|
|
162
|
+
|
|
163
|
+
### `svelteDocsPlugin` options
|
|
164
|
+
|
|
165
|
+
| Option | Type | Default | Description |
|
|
166
|
+
|--------|------|---------|-------------|
|
|
167
|
+
| `docsPath` | `string` | `'./docs'` | Path to docs folder |
|
|
168
|
+
| `route` | `string` | `'/documentation'` | URL route |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## License
|
|
41
173
|
|
|
42
|
-
|
|
174
|
+
MIT
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Reference Table component
|
|
3
|
+
* Displays API documentation in a clean, organized table format
|
|
4
|
+
*/
|
|
5
|
+
interface Column {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
width?: string;
|
|
9
|
+
}
|
|
10
|
+
interface Row {
|
|
11
|
+
[key: string]: string | number | boolean | null;
|
|
12
|
+
}
|
|
13
|
+
interface Props {
|
|
14
|
+
columns: Column[];
|
|
15
|
+
rows: Row[];
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const APITable: import("svelte").Component<Props, {}, "">;
|
|
20
|
+
type APITable = ReturnType<typeof APITable>;
|
|
21
|
+
export default APITable;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breadcrumbs navigation component
|
|
3
|
+
* Shows the current page path for easy navigation
|
|
4
|
+
*/
|
|
5
|
+
interface BreadcrumbItem {
|
|
6
|
+
label: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
items: BreadcrumbItem[];
|
|
11
|
+
}
|
|
12
|
+
declare const Breadcrumbs: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
|
|
14
|
+
export default Breadcrumbs;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callout component for documentation
|
|
3
|
+
* Displays alert boxes with different variants: info, warning, success, error
|
|
4
|
+
*/
|
|
5
|
+
type Variant = 'info' | 'warning' | 'success' | 'error';
|
|
6
|
+
interface Props {
|
|
7
|
+
variant?: Variant;
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
type $$ComponentProps = Props & {
|
|
11
|
+
children?: any;
|
|
12
|
+
};
|
|
13
|
+
declare const Callout: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
|
+
type Callout = ReturnType<typeof Callout>;
|
|
15
|
+
export default Callout;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeBlock component with copy button
|
|
3
|
+
* Shows code with optional language label
|
|
4
|
+
*/
|
|
5
|
+
interface Props {
|
|
6
|
+
code: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
filename?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CodeBlock: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type CodeBlock = ReturnType<typeof CodeBlock>;
|
|
12
|
+
export default CodeBlock;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
-
import { theme } from '
|
|
3
|
+
import { theme } from '../stores/theme';
|
|
4
4
|
import Navbar from './Navbar.svelte';
|
|
5
5
|
import Sidebar from './Sidebar.svelte';
|
|
6
6
|
import Footer from './Footer.svelte';
|
|
7
|
-
import type { NavSection } from '
|
|
7
|
+
import type { NavSection } from '../stores/nav';
|
|
8
8
|
|
|
9
9
|
let {
|
|
10
10
|
title = 'Documentation',
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
sections = [] as NavSection[],
|
|
13
13
|
copyright = '© 2026 Documentation System',
|
|
14
14
|
footerLinks = [] as { label: string; href: string }[],
|
|
15
|
+
showNavbar = true,
|
|
16
|
+
showSidebar = true,
|
|
17
|
+
showFooter = true,
|
|
15
18
|
children,
|
|
16
19
|
}: {
|
|
17
20
|
title?: string;
|
|
@@ -19,6 +22,9 @@
|
|
|
19
22
|
sections?: NavSection[];
|
|
20
23
|
copyright?: string;
|
|
21
24
|
footerLinks?: { label: string; href: string }[];
|
|
25
|
+
showNavbar?: boolean;
|
|
26
|
+
showSidebar?: boolean;
|
|
27
|
+
showFooter?: boolean;
|
|
22
28
|
children: any;
|
|
23
29
|
} = $props();
|
|
24
30
|
|
|
@@ -62,16 +68,20 @@
|
|
|
62
68
|
|
|
63
69
|
<div class="min-h-screen flex flex-col bg-white dark:bg-claude-dark-bg text-claude-text dark:text-claude-dark-text transition-colors">
|
|
64
70
|
<!-- Navbar -->
|
|
65
|
-
|
|
71
|
+
{#if showNavbar}
|
|
72
|
+
<Navbar {title} {logo} onLogoClick={handleLogoClick} />
|
|
73
|
+
{/if}
|
|
66
74
|
|
|
67
75
|
<!-- Main Content Area -->
|
|
68
76
|
<div class="flex flex-1 overflow-hidden">
|
|
69
77
|
<!-- Sidebar -->
|
|
70
|
-
|
|
78
|
+
{#if showSidebar}
|
|
79
|
+
<Sidebar {sections} {currentPath} onNavigate={handleNavigate} />
|
|
80
|
+
{/if}
|
|
71
81
|
|
|
72
82
|
<!-- Main Content -->
|
|
73
83
|
<main class="flex-1 overflow-y-auto">
|
|
74
|
-
<div class="doc-container max-w-4xl mx-auto px-4 sm:px-6 py-8">
|
|
84
|
+
<div class="doc-container max-w-4xl mx-auto px-4 sm:px-6 py-8 {!showSidebar ? 'max-w-full' : ''}">
|
|
75
85
|
<article class="doc-content">
|
|
76
86
|
{@render children()}
|
|
77
87
|
</article>
|
|
@@ -80,5 +90,7 @@
|
|
|
80
90
|
</div>
|
|
81
91
|
|
|
82
92
|
<!-- Footer -->
|
|
83
|
-
|
|
93
|
+
{#if showFooter}
|
|
94
|
+
<Footer {copyright} links={footerLinks} />
|
|
95
|
+
{/if}
|
|
84
96
|
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NavSection } from '../stores/nav';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
title?: string;
|
|
4
|
+
logo?: string | null;
|
|
5
|
+
sections?: NavSection[];
|
|
6
|
+
copyright?: string;
|
|
7
|
+
footerLinks?: {
|
|
8
|
+
label: string;
|
|
9
|
+
href: string;
|
|
10
|
+
}[];
|
|
11
|
+
showNavbar?: boolean;
|
|
12
|
+
showSidebar?: boolean;
|
|
13
|
+
showFooter?: boolean;
|
|
14
|
+
children: any;
|
|
15
|
+
};
|
|
16
|
+
declare const DocLayout: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
17
|
+
type DocLayout = ReturnType<typeof DocLayout>;
|
|
18
|
+
export default DocLayout;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { goto } from '$app/navigation';
|
|
3
|
+
import { page } from '$app/stores';
|
|
4
|
+
import Sidebar from './Sidebar.svelte';
|
|
5
|
+
import type { NavSection } from '../stores/nav';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
sections = [] as NavSection[],
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
sections?: NavSection[];
|
|
12
|
+
children: any;
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
15
|
+
let currentPath = $state('/');
|
|
16
|
+
|
|
17
|
+
$effect(() => {
|
|
18
|
+
currentPath = $page.url.pathname;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
async function handleNavigate(path: string) {
|
|
22
|
+
await goto(path);
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- Sidebar + Content Area (no outer layout) -->
|
|
27
|
+
<div class="flex flex-1 overflow-hidden">
|
|
28
|
+
<!-- Sidebar Navigation -->
|
|
29
|
+
<Sidebar {sections} {currentPath} onNavigate={handleNavigate} />
|
|
30
|
+
|
|
31
|
+
<!-- Main Content -->
|
|
32
|
+
<main class="flex-1 overflow-y-auto">
|
|
33
|
+
<div class="doc-container max-w-4xl mx-auto px-4 sm:px-6 py-8">
|
|
34
|
+
<article class="doc-content">
|
|
35
|
+
{@render children()}
|
|
36
|
+
</article>
|
|
37
|
+
</div>
|
|
38
|
+
</main>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavSection } from '../stores/nav';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
sections?: NavSection[];
|
|
4
|
+
children: any;
|
|
5
|
+
};
|
|
6
|
+
declare const DocsPage: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type DocsPage = ReturnType<typeof DocsPage>;
|
|
8
|
+
export default DocsPage;
|