@farming-labs/svelte-theme 0.2.49 → 0.2.52
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 +81 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @farming-labs/svelte-theme
|
|
2
|
+
|
|
3
|
+
The Svelte 5 UI layer and theme preset package for
|
|
4
|
+
[`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs) on SvelteKit.
|
|
5
|
+
|
|
6
|
+
It renders the docs shell, page content, sidebar, table of contents, search, AI dialogs, page
|
|
7
|
+
actions, and theme controls. Content loading and route handlers live in `@farming-labs/svelte`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @farming-labs/docs @farming-labs/svelte @farming-labs/svelte-theme @farming-labs/theme
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The CLI can scaffold the complete SvelteKit integration:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @farming-labs/docs@latest init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure the theme
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// src/lib/docs.config.ts
|
|
25
|
+
import { defineDocs } from "@farming-labs/docs";
|
|
26
|
+
import { fumadocs } from "@farming-labs/svelte-theme";
|
|
27
|
+
|
|
28
|
+
export default defineDocs({
|
|
29
|
+
entry: "docs",
|
|
30
|
+
contentDir: "docs",
|
|
31
|
+
theme: fumadocs(),
|
|
32
|
+
nav: { title: "Docs", url: "/docs" },
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Import the matching shared CSS in `src/app.css`:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
@import "@farming-labs/theme/default/css";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Render the docs UI
|
|
43
|
+
|
|
44
|
+
```svelte
|
|
45
|
+
<script>
|
|
46
|
+
import { DocsLayout } from "@farming-labs/svelte-theme";
|
|
47
|
+
import config from "$lib/docs.config";
|
|
48
|
+
|
|
49
|
+
let { data, children } = $props();
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<DocsLayout tree={data.tree} {config}>
|
|
53
|
+
{@render children()}
|
|
54
|
+
</DocsLayout>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Use `DocsContent` from the same package in the page component. The `data` passed to these
|
|
58
|
+
components comes from `@farming-labs/svelte/server`.
|
|
59
|
+
|
|
60
|
+
## Main exports
|
|
61
|
+
|
|
62
|
+
- `DocsLayout`, `DocsContent`, `DocsSidebar`, and `DocsPage`
|
|
63
|
+
- `TableOfContents`, `Breadcrumb`, `MobileNav`, and `ThemeToggle`
|
|
64
|
+
- `SearchDialog`, `AskAIDialog`, and `FloatingAIChat`
|
|
65
|
+
- `Callout` and theme preset factories
|
|
66
|
+
|
|
67
|
+
Preset subpaths are `fumadocs`, `pixel-border`, `darksharp`, `colorful`, `greentree`, `hardline`,
|
|
68
|
+
`concrete`, `command-grid`, and `ledger`. The `fumadocs` preset uses
|
|
69
|
+
`@farming-labs/theme/default/css`; the other presets use the matching
|
|
70
|
+
`@farming-labs/theme/<preset>/css` entrypoint.
|
|
71
|
+
|
|
72
|
+
## Learn more
|
|
73
|
+
|
|
74
|
+
- [Documentation](https://docs.farming-labs.dev/docs)
|
|
75
|
+
- [Themes](https://docs.farming-labs.dev/docs/themes)
|
|
76
|
+
- [SvelteKit example](https://github.com/farming-labs/docs/tree/main/examples/sveltekit)
|
|
77
|
+
- [GitHub repository](https://github.com/farming-labs/docs)
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/svelte-theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"description": "Svelte UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"gray-matter": "^4.0.3",
|
|
124
124
|
"sugar-high": "^0.9.5",
|
|
125
|
-
"@farming-labs/docs": "0.2.
|
|
126
|
-
"@farming-labs/svelte": "0.2.
|
|
125
|
+
"@farming-labs/docs": "0.2.52",
|
|
126
|
+
"@farming-labs/svelte": "0.2.52"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"svelte": ">=5.0.0"
|