Get Started: How to Create a KitBook
Warning: This is alpha software and not ready. Watch the updating [Roadmap] for clues on when that will be.
Install the
kitbookpackage:npm i -D kitbook@alphaorpnpm add -D kitbook@alphaAdd the
kitbook()Vite plugin before yoursveltekit()plugin:
vite.config.jsjsimport { defineConfig } from 'vite'import { sveltekit } from '@sveltejs/kit/vite';import { kitbook } from 'kitbook/plugins/vite';export default defineConfig({plugins: [kitbook(),sveltekit(),],});
- Add the necessary MDSvex imports and configuration into your 
svelte.config.js: 
svelte.config.jsjsimport { vitePreprocess } from '@sveltejs/kit/vite';import { mdsvex, MDSVEX_EXTENSIONS, KITBOOK_MDSVEX_CONFIG } from 'kitbook/plugins/vite';const config = {extensions: ['.svelte', ...MDSVEX_EXTENSIONS],preprocess: [mdsvex(KITBOOK_MDSVEX_CONFIG),vitePreprocess(),],// ...};export default config;
- Place your app inside of a (group) folder named anything and add a 
kitbookfolder tosrc/routes: 
txtsrc/routes/│ (app)/│ ├ dashboard/│ ├ item/│ └ +layout.svelte <-- initialize app only items, like db connections (refers to all layout files like +layout.ts)│ kitbook/└ +layout.svelte <-- initialize everything both your app and Kitbook need, like i18n
- Run your dev server as normal (
npm run dev,pnpm dev, etc…) - Kitbook will automatically copy its routing files to 
src/routes/kitbook. Please edit the settings found insrc/routes/kitbook/+layout.sveltefor your app, but don’t touch the other files as they will be overridden in future updates as needed. 
At this point you can navigate to the /kitbook route and see all your Svelte components, including +page.svelte and +layout.svelte files as they are also just plain Svelte components with a very important data prop.
Next you could…