-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move settings to kitbook.config.ts file
- Loading branch information
Showing
23 changed files
with
202 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { KitbookSettings } from "."; | ||
|
||
export function defineConfig(config: Omit<KitbookSettings, 'viewports'> & Partial<Pick<KitbookSettings, 'viewports'>>): KitbookSettings { | ||
return { | ||
viewports: [ | ||
{name: 'mobile', width: 320, height: 568}, | ||
// {name: 'tablet', width: 768, height: 1024}, | ||
{name: 'desktop', width: 1024, height: 768}, | ||
], | ||
...config | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineConfig } from "./defineConfig"; | ||
|
||
export default defineConfig({ | ||
title: 'Kitbook', | ||
description: 'Svelte Component Documentation and Prototyping Workbench built using SvelteKit', | ||
viewports: [ | ||
{ | ||
name: 'Mobile', | ||
width: 320, | ||
height: 568, | ||
}, | ||
{ | ||
name: 'Desktop', | ||
width: 1024, | ||
height: 768, | ||
}, | ||
{ | ||
name: 'Tablet', | ||
width: 768, | ||
height: 1024, | ||
}, | ||
], | ||
// languages: [ | ||
// { | ||
// name: 'English', | ||
// code: 'en', | ||
// }, | ||
// { | ||
// name: 'Spanish', | ||
// code: 'es', | ||
// }, | ||
// ], | ||
githubURL: 'https://github.com/jacob-8/kitbook/tree/main/packages/kitbook', | ||
expandTree: true, | ||
isKitbookItself: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,10 @@ | ||
<script> | ||
import { pagesStore } from 'kitbook'; | ||
import { settings } from 'virtual:kitbook-settings'; | ||
import { setContext } from 'svelte'; | ||
setContext('pages-store', pagesStore); | ||
/** @type {import('kitbook').KitbookSettings} */ | ||
const kitbookSettings = { | ||
title: 'Kitbook', | ||
description: 'Svelte Component Documentation and Prototyping Workbench built using SvelteKit', | ||
viewports: [ | ||
{ | ||
name: 'Mobile', | ||
width: 320, | ||
height: 568, | ||
}, | ||
{ | ||
name: 'Desktop', | ||
width: 1024, | ||
height: 768, | ||
}, | ||
{ | ||
name: 'Tablet', | ||
width: 768, | ||
height: 1024, | ||
}, | ||
], | ||
// languages: [ | ||
// { | ||
// name: 'English', | ||
// code: 'en', | ||
// }, | ||
// { | ||
// name: 'Spanish', | ||
// code: 'es', | ||
// }, | ||
// ], | ||
githubURL: 'https://github.com/jacob-8/kitbook/tree/main/packages/kitbook', | ||
expandTree: true, | ||
}; | ||
setContext('kitbook-settings', kitbookSettings); | ||
setContext('pages-store', pagesStore); | ||
setContext('kitbook-settings', settings); | ||
</script> | ||
|
||
<slot /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import type { LayoutLoad } from './$types'; | ||
import { layoutLoad } from 'kitbook'; | ||
// @ts-expect-error virtual module | ||
import { pages } from 'virtual:kitbook-modules'; | ||
export const load = layoutLoad({ pages }) satisfies LayoutLoad; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare module 'virtual:kitbook-modules' { | ||
import type { GroupedPageMap } from "kitbook"; | ||
export const pages: GroupedPageMap; | ||
} | ||
|
||
declare module 'virtual:kitbook-settings' { | ||
import type { KitbookSettings } from "kitbook"; | ||
export const settings: KitbookSettings; | ||
} |
6 changes: 2 additions & 4 deletions
6
packages/kitbook/vite.config.js → packages/kitbook/vite.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export { kitbookPlugin as kitbook } from './plugin'; | ||
export { config as KITBOOK_MDSVEX_CONFIG } from './mdsvex/mdsvex.config'; | ||
export { MDSVEX_EXTENSIONS } from './constants'; | ||
export { mdsvex } from 'mdsvex'; | ||
export { mdsvex } from 'mdsvex'; | ||
|
||
export type { KitbookSettings, Viewport, Language } from './types'; |
Oops, something went wrong.