From 2dc2085d0dec5dae73e440d70d41da6331cad3b1 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 4 Jun 2024 12:20:12 +0200 Subject: [PATCH] docs: svelte 5 structure wip --- .../src/routes/docs-new/+layout.server.js | 108 +++++++++++++++++ .../src/routes/docs-new/+layout.svelte | 111 ++++++++++++++++++ .../src/routes/docs-new/+page.js | 5 + .../routes/docs-new/[slug]/+page.server.js | 19 +++ .../src/routes/docs-new/[slug]/+page.svelte | 76 ++++++++++++ .../content/01-introduction/01-overview.md | 7 ++ .../01-introduction/02-getting-started.md | 8 ++ .../content/01-introduction/meta.json | 3 + .../01-component-fundamentals.md | 6 + .../02-template-syntax/02-basic-markup.md | 5 + .../02-template-syntax/03-control-flow.md | 8 ++ .../content/02-template-syntax/04-snippets.md | 10 ++ .../05-styles-and-classes.md | 9 ++ .../06-transitions-and-animations.md | 10 ++ .../content/02-template-syntax/07-actions.md | 7 ++ .../content/02-template-syntax/08-bindings.md | 7 ++ .../02-template-syntax/09-special-elements.md | 5 + .../content/02-template-syntax/meta.json | 3 + .../docs-new/content/03-runes/01-state.md | 9 ++ .../content/03-runes/02-side-effects.md | 6 + .../docs-new/content/03-runes/meta.json | 3 + .../docs-new/content/04-runtime/01-stores.md | 6 + .../docs-new/content/04-runtime/02-context.md | 6 + .../content/04-runtime/03-lifecycle-hooks.md | 8 ++ .../04-runtime/04-imperative-component-api.md | 11 ++ .../docs-new/content/04-runtime/meta.json | 3 + .../docs-new/content/05-misc/01-debugging.md | 6 + .../docs-new/content/05-misc/02-testing.md | 8 ++ .../docs-new/content/05-misc/03-typescript.md | 9 ++ .../content/05-misc/04-custom-elements-api.md | 5 + .../content/05-misc/05-reactivity-indepth.md | 6 + .../05-misc/06-svelte-5-migration-guide.md | 5 + .../routes/docs-new/content/05-misc/meta.json | 3 + .../src/routes/docs/render.js | 4 +- 34 files changed, 503 insertions(+), 2 deletions(-) create mode 100644 sites/svelte-5-preview/src/routes/docs-new/+layout.server.js create mode 100644 sites/svelte-5-preview/src/routes/docs-new/+layout.svelte create mode 100644 sites/svelte-5-preview/src/routes/docs-new/+page.js create mode 100644 sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.server.js create mode 100644 sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.svelte create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/01-overview.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/02-getting-started.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/meta.json create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/01-component-fundamentals.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/02-basic-markup.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/03-control-flow.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/04-snippets.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/05-styles-and-classes.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/06-transitions-and-animations.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/07-actions.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/08-bindings.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/09-special-elements.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/meta.json create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/03-runes/01-state.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/03-runes/02-side-effects.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/03-runes/meta.json create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/01-stores.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/02-context.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/03-lifecycle-hooks.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/04-imperative-component-api.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/meta.json create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/01-debugging.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/02-testing.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/03-typescript.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/04-custom-elements-api.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/05-reactivity-indepth.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/06-svelte-5-migration-guide.md create mode 100644 sites/svelte-5-preview/src/routes/docs-new/content/05-misc/meta.json diff --git a/sites/svelte-5-preview/src/routes/docs-new/+layout.server.js b/sites/svelte-5-preview/src/routes/docs-new/+layout.server.js new file mode 100644 index 0000000000..87add6ade9 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/+layout.server.js @@ -0,0 +1,108 @@ +export async function load({ url }) { + if (url.pathname === '/docs') { + return { + sections: [] + }; + } + + const { get_docs_data, get_docs_list } = await import('../docs/render.js'); + + const sections = get_docs_list(await get_docs_data('./src/routes/docs-new/content', 'docs-new')); + sections.push( + { + title: 'Reference - Runes', + pages: [ + { title: '$state' }, + { title: '$derived' }, + { title: '$effect' }, + { title: '$props' }, + { title: '$inspect' }, + { title: '$host' } + ] + }, + { + title: 'Reference - Imports', + pages: [ + { title: 'svelte' }, + { title: 'svelte/reactivity' }, + { title: 'svelte/server' }, + { title: `svelte/elements` }, + { title: `svelte/store` }, + { title: `svelte/actions` }, + { title: `svelte/transition` }, + { title: `svelte/animate` }, + { title: `svelte/motion` }, + { title: `svelte/easing` }, + { title: `svelte/compiler` } + ] + }, + { + title: 'Reference - Other', + pages: [{ title: 'Warnings' }, { title: 'Errors' }] + } + ); + + return { + sections + // sections: /** @type {Array<{title: string; pages: Array<{title: string }>}>} */ ([ + // { title: 'Introduction', pages: [{ title: 'Overview' }, { title: 'Getting started' }] }, + // { + // title: 'Template syntax', + // pages: [ + // { title: 'Component fundamentals' }, + // { title: 'Basic markup' }, + // { title: 'Control flow' }, + // { title: 'Snippets' }, + // { title: 'Styles & Classes' }, + // { title: 'Transitions & Animations' }, + // { title: 'Bindings' }, + // { title: 'Actions' }, + // { title: 'Special elements' } + // ] + // }, + // { + // title: 'Runes', + // pages: [{ title: 'State' }, { title: 'Side effects' }] + // }, + // { + // title: 'Runtime', + // pages: [ + // { title: 'Stores' }, + // { title: 'Context' }, + // { title: 'Lifecycle hooks' }, + // { title: 'Imperative component API' } + // ] + // }, + // { + // title: 'Misc', + // pages: [ + // { title: 'Debugging' }, + // { title: 'Testing' }, + // { title: 'TypeScript' }, + // { title: 'Custom elements API' }, + // { title: 'Legacy syntax' }, + // { title: 'Reactivity indepth' }, + // { title: 'Svelte 5 migration guide' } + // ] + // }, + // // { + // // title: 'Reference', + // // pages: [ + // // { title: 'Runes' }, + // // { title: 'svelte' }, + // // { title: 'svelte/reactivity' }, + // // { title: 'svelte/server' }, + // // { title: `svelte/elements` }, + // // { title: `svelte/store` }, + // // { title: `svelte/actions` }, + // // { title: `svelte/transition` }, + // // { title: `svelte/animate` }, + // // { title: `svelte/motion` }, + // // { title: `svelte/easing` }, + // // { title: `svelte/compiler` }, + // // { title: 'Warnings' } + // // ] + // // }, + // ]) + }; +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/+layout.svelte b/sites/svelte-5-preview/src/routes/docs-new/+layout.svelte new file mode 100644 index 0000000000..eb12ba00cd --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/+layout.svelte @@ -0,0 +1,111 @@ + + +
+
+ +
+ +
+ {#if category} +

{category}

+ {/if} + {#if title} +

{title}

+ {/if} + + +
+
+ + diff --git a/sites/svelte-5-preview/src/routes/docs-new/+page.js b/sites/svelte-5-preview/src/routes/docs-new/+page.js new file mode 100644 index 0000000000..81fd0bcb87 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/+page.js @@ -0,0 +1,5 @@ +import { redirect } from '@sveltejs/kit'; + +export function load() { + redirect(307, '/docs-new/overview'); +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.server.js b/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.server.js new file mode 100644 index 0000000000..f261757d91 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.server.js @@ -0,0 +1,19 @@ +import { error } from '@sveltejs/kit'; + +export async function entries() { + const { get_docs_data } = await import('../../docs/render.js'); + + const data = await get_docs_data('./src/routes/docs-new/content', 'docs-new'); + return data[0].pages.map((page) => ({ slug: page.slug })); +} + +export async function load({ params }) { + const { get_docs_data, get_parsed_docs } = await import('../../docs/render.js'); + + const data = await get_docs_data('./src/routes/docs-new/content', 'docs-new'); + const processed_page = await get_parsed_docs(data, params.slug); + + if (!processed_page) error(404); + + return { page: processed_page }; +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.svelte b/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.svelte new file mode 100644 index 0000000000..7aa2ee78c6 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/[slug]/+page.svelte @@ -0,0 +1,76 @@ + + + + {data.page?.title} • Docs • Svelte 5 preview + + + + + + +
+ + + {@html data.page.content} +
+ +
+
+ previous + + {#if prev} + {prev.title} + {/if} +
+ +
+ next + {#if next} + {next.title} + {/if} +
+
+ + diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/01-overview.md b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/01-overview.md new file mode 100644 index 0000000000..7454035af8 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/01-overview.md @@ -0,0 +1,7 @@ +--- +title: Overview +--- + +- Short intro to what Svelte is and why it's the best ever +- A few code examples to have a very rough understanding of how Svelte code looks like +- Jump off points to tutorial, SvelteKit etc diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/02-getting-started.md b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/02-getting-started.md new file mode 100644 index 0000000000..2ec873317c --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/02-getting-started.md @@ -0,0 +1,8 @@ +--- +title: Getting started +--- + +- `npm create svelte@latest`, describe that it scaffolds SvelteKit project +- `npm create vite@latest`, describe that it scaffolds Svelte SPA powered by Vite +- mention `svelte-add` +- Jump off points to tutorial, SvelteKit etc diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/meta.json b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/meta.json new file mode 100644 index 0000000000..fd70acd694 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/01-introduction/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Introduction" +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/01-component-fundamentals.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/01-component-fundamentals.md new file mode 100644 index 0000000000..049ad6386e --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/01-component-fundamentals.md @@ -0,0 +1,6 @@ +--- +title: Component fundamentals +--- + +- script (module) / template / style (rough overview) +- `$props` / `$state` (in the context of components) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/02-basic-markup.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/02-basic-markup.md new file mode 100644 index 0000000000..012eb4ea32 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/02-basic-markup.md @@ -0,0 +1,5 @@ +--- +title: Basic markup +--- + +- [basically what we have in the Svelte docs today](https://svelte.dev/docs/basic-markup) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/03-control-flow.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/03-control-flow.md new file mode 100644 index 0000000000..4558c1d9d1 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/03-control-flow.md @@ -0,0 +1,8 @@ +--- +title: Control flow +--- + +- if +- each +- await (or move that into some kind of data loading section?) +- NOT: key (move into transition section, because that's the common use case) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/04-snippets.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/04-snippets.md new file mode 100644 index 0000000000..dbf8a69875 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/04-snippets.md @@ -0,0 +1,10 @@ +--- +title: Snippets +--- + +Better title needed? + +- `#snippet` +- `@render` +- how they can be used to reuse markup +- how they can be used to pass UI content to components diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/05-styles-and-classes.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/05-styles-and-classes.md new file mode 100644 index 0000000000..c483cc3c8e --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/05-styles-and-classes.md @@ -0,0 +1,9 @@ +--- +title: Styles & Classes +--- + +- style scoping +- `:global` +- `style:` +- `class:` +- `--css` props diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/06-transitions-and-animations.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/06-transitions-and-animations.md new file mode 100644 index 0000000000..8479ad8714 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/06-transitions-and-animations.md @@ -0,0 +1,10 @@ +--- +title: Transitions & Animations +--- + +- how to use (template syntax) +- when to use +- global vs local +- easing & motion +- mention imports +- key block diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/07-actions.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/07-actions.md new file mode 100644 index 0000000000..3f237b5ce8 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/07-actions.md @@ -0,0 +1,7 @@ +--- +title: Actions +--- + +- template syntax +- how to write +- typings diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/08-bindings.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/08-bindings.md new file mode 100644 index 0000000000..6af0b7e99e --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/08-bindings.md @@ -0,0 +1,7 @@ +--- +title: Bindings +--- + +- how for dom elements +- list of all bindings +- how for components diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/09-special-elements.md b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/09-special-elements.md new file mode 100644 index 0000000000..7770ef3369 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/09-special-elements.md @@ -0,0 +1,5 @@ +--- +title: Special elements +--- + +- [basically what we have in the docs today](https://svelte.dev/docs/special-elements) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/meta.json b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/meta.json new file mode 100644 index 0000000000..c0f33c89fd --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/02-template-syntax/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Template syntax" +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/01-state.md b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/01-state.md new file mode 100644 index 0000000000..6e5bfc53be --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/01-state.md @@ -0,0 +1,9 @@ +--- +title: State +--- + +- `$state` (.frozen) +- `$derived` (.by) +- using classes +- getters/setters (what to do to keep reactivity "alive") +- universal reactivity diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/02-side-effects.md b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/02-side-effects.md new file mode 100644 index 0000000000..398a767886 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/02-side-effects.md @@ -0,0 +1,6 @@ +--- +title: Side effects +--- + +- `$effect` (.pre) +- when not to use it, better patterns for what to do instead diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/meta.json b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/meta.json new file mode 100644 index 0000000000..e2853f5c35 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/03-runes/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Runes" +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/01-stores.md b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/01-stores.md new file mode 100644 index 0000000000..86d3568e17 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/01-stores.md @@ -0,0 +1,6 @@ +--- +title: Stores +--- + +- how to use +- how to write diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/02-context.md b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/02-context.md new file mode 100644 index 0000000000..c93c015920 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/02-context.md @@ -0,0 +1,6 @@ +--- +title: Context +--- + +- get/set/hasContext +- how to use, best practises (like encapsulating them) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/03-lifecycle-hooks.md b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/03-lifecycle-hooks.md new file mode 100644 index 0000000000..8fe1a1f962 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/03-lifecycle-hooks.md @@ -0,0 +1,8 @@ +--- +title: Lifecycle hooks +--- + +- onMount/onDestroy +- mention that `$effect` might be better for your use case +- beforeUpdate/afterUpdate with deprecation notice? +- or skip this entirely and only have it in the reference docs? diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/04-imperative-component-api.md b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/04-imperative-component-api.md new file mode 100644 index 0000000000..298a511c82 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/04-imperative-component-api.md @@ -0,0 +1,11 @@ +--- +title: Imperative component API +--- + +better title needed? + +- mount +- unmount +- render +- hydrate +- how they interact with each other diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/meta.json b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/meta.json new file mode 100644 index 0000000000..729784bc2b --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/04-runtime/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Runtime" +} diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/01-debugging.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/01-debugging.md new file mode 100644 index 0000000000..7e4a72de1b --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/01-debugging.md @@ -0,0 +1,6 @@ +--- +title: Debugging +--- + +- `@debug` +- `$inspect` diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/02-testing.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/02-testing.md new file mode 100644 index 0000000000..caf0b694ed --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/02-testing.md @@ -0,0 +1,8 @@ +--- +title: Testing +--- + +- component testing basics +- rune testing basics +- vitest setup +- e2e diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/03-typescript.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/03-typescript.md new file mode 100644 index 0000000000..a4f5c3d10d --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/03-typescript.md @@ -0,0 +1,9 @@ +--- +title: TypeScript +--- + +- [basically what we have today](https://svelte.dev/docs/typescript) +- built-in support, but only for type-only features +- generics +- using `Component` and the other helper types +- using `svelte-check` diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/04-custom-elements-api.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/04-custom-elements-api.md new file mode 100644 index 0000000000..c147503edb --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/04-custom-elements-api.md @@ -0,0 +1,5 @@ +--- +title: Custom elements API +--- + +- [basically what we have today](https://svelte.dev/docs/custom-elements-api) diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/05-reactivity-indepth.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/05-reactivity-indepth.md new file mode 100644 index 0000000000..abd917c021 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/05-reactivity-indepth.md @@ -0,0 +1,6 @@ +--- +title: Reactivity indepth +--- + +- how to think about Runes ("just JavaScript" with added reactivity, what this means for keeping reactivity alive across boundaries) +- signals diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/06-svelte-5-migration-guide.md b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/06-svelte-5-migration-guide.md new file mode 100644 index 0000000000..cd400d8ec2 --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/06-svelte-5-migration-guide.md @@ -0,0 +1,5 @@ +--- +title: Svelte 5 migration guide +--- + +- the stuff from the preview docs and possibly more diff --git a/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/meta.json b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/meta.json new file mode 100644 index 0000000000..c4f984c9ac --- /dev/null +++ b/sites/svelte-5-preview/src/routes/docs-new/content/05-misc/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Misc" +} diff --git a/sites/svelte-5-preview/src/routes/docs/render.js b/sites/svelte-5-preview/src/routes/docs/render.js index 5d44f48bad..54e76766fd 100644 --- a/sites/svelte-5-preview/src/routes/docs/render.js +++ b/sites/svelte-5-preview/src/routes/docs/render.js @@ -28,7 +28,7 @@ export async function get_parsed_docs(docs_data, slug) { } /** @return {Promise} */ -export async function get_docs_data(base = './src/routes/docs/content') { +export async function get_docs_data(base = './src/routes/docs/content', path = '/docs') { const { readdir, readFile } = await import('node:fs/promises'); /** @type {import('./types').DocsData} */ @@ -76,7 +76,7 @@ export async function get_docs_data(base = './src/routes/docs/content') { content: page_content, category: category_title, sections: await get_sections(page_content), - path: `${app_base}/docs/${page_slug}`, + path: `${app_base}/${path}/${page_slug}`, file: `${category_dir}/${filename}` }); }