diff --git a/.gitignore b/.gitignore index fec5ebe..d4f0858 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,7 @@ generated-assets .idea/ .velite +docs/public +docs/.wrangler +start/.wrangler +start/public \ No newline at end of file diff --git a/docs/src/content/getting-started.md b/docs/src/content/getting-started.md index a34916c..5edd6da 100644 --- a/docs/src/content/getting-started.md +++ b/docs/src/content/getting-started.md @@ -44,7 +44,7 @@ export const siteConfig = defineSiteConfig({ description: "A SvelteKit docs starter template", keywords: "sveltekit, docs, starter, template", ogImage: { - url: "https://docs.svecosystem.com/og.png", + url: "https://docs.sveco.dev/og.png", height: 630, width: 1200, }, diff --git a/docs/src/lib/site-config.ts b/docs/src/lib/site-config.ts index cc91063..02473eb 100644 --- a/docs/src/lib/site-config.ts +++ b/docs/src/lib/site-config.ts @@ -2,9 +2,9 @@ import { defineSiteConfig } from "@svecodocs/kit"; export const siteConfig = defineSiteConfig({ name: "Svecodocs", - url: "https://docs.svecosystem.com", + url: "https://docs.sveco.dev", ogImage: { - url: "https://docs.svecosystem.com/og.png", + url: "https://docs.sveco.dev/og.png", height: "630", width: "1200", }, diff --git a/docs/src/routes/api/search.json/search.json b/docs/src/routes/api/search.json/search.json index 269e220..1b5729a 100644 --- a/docs/src/routes/api/search.json/search.json +++ b/docs/src/routes/api/search.json/search.json @@ -3,7 +3,7 @@ "title": "Getting Started", "href": "/docs/getting-started", "description": "A quick guide to get started using Svecodocs", - "content": " import { Callout } from \"@svecodocs/kit\"; The following guide will walk you through the process of getting a Svecodocs project up and running. Clone the starter template Clone the Svecodocs starter template: pnpx degit svecosystem/svecodocs/starter Navigation The starter template comes with a basic navigation structure to get your started. To customize the navigation, adjust the src/lib/navigation.ts file. import { createNavigation } from \"@svecodocs/kit\"; export const navigation = createNavigation({ // Customize the navigation here }); Site config The site config is used to configure site-wide settings, such as the title, description, keywords, ogImage, and other metadata. The config is located in the src/lib/site-config.ts file. import { defineSiteConfig } from \"@svecodocs/kit\"; export const siteConfig = defineSiteConfig({ title: \"Svecodocs\", description: \"A SvelteKit docs starter template\", keywords: \"sveltekit, docs, starter, template\", ogImage: { url: \"https://docs.svecosystem.com/og.png\", height: 630, width: 1200, }, }); Per-Route Site Config You can override any part of the site config on a per-route basis using the useSiteConfig hook. This feature is still being worked on. Theme The starter template comes with the default Svecodocs theme (orange). To customize the theme, adjust the import in the src/app.css file to reflect the color scheme you want to use for your project. Each theme has been designed to work well in both light and dark mode. /* @import \"@svecodocs/kit/themes/orange.css\"; */ @import \"@svecodocs/kit/themes/emerald.css\"; @import \"@svecodocs/kit/globals.css\"; Logo To customize the logo displayed in the sidebar header, head to the src/routes/(docs)/+layout.svelte file and adjust the contents of the logo snippet. If the logo has a light and dark version, ensure to handle those similarly to the default Svecosystem logo. {#snippet logo()} The project name here {/snippet} `" + "content": " import { Callout } from \"@svecodocs/kit\"; The following guide will walk you through the process of getting a Svecodocs project up and running. Clone the starter template Clone the Svecodocs starter template: pnpx degit svecosystem/svecodocs/starter Navigation The starter template comes with a basic navigation structure to get your started. To customize the navigation, adjust the src/lib/navigation.ts file. import { createNavigation } from \"@svecodocs/kit\"; export const navigation = createNavigation({ // Customize the navigation here }); Site config The site config is used to configure site-wide settings, such as the title, description, keywords, ogImage, and other metadata. The config is located in the src/lib/site-config.ts file. import { defineSiteConfig } from \"@svecodocs/kit\"; export const siteConfig = defineSiteConfig({ title: \"Svecodocs\", description: \"A SvelteKit docs starter template\", keywords: \"sveltekit, docs, starter, template\", ogImage: { url: \"https://docs.sveco.dev/og.png\", height: 630, width: 1200, }, }); Per-Route Site Config You can override any part of the site config on a per-route basis using the useSiteConfig hook. This feature is still being worked on. Theme The starter template comes with the default Svecodocs theme (orange). To customize the theme, adjust the import in the src/app.css file to reflect the color scheme you want to use for your project. Each theme has been designed to work well in both light and dark mode. /* @import \"@svecodocs/kit/themes/orange.css\"; */ @import \"@svecodocs/kit/themes/emerald.css\"; @import \"@svecodocs/kit/globals.css\"; Logo To customize the logo displayed in the sidebar header, head to the src/routes/(docs)/+layout.svelte file and adjust the contents of the logo snippet. If the logo has a light and dark version, ensure to handle those similarly to the default Svecosystem logo. {#snippet logo()} The project name here {/snippet} `" }, { "title": "Introduction", diff --git a/docs/static/fonts/cascadia-mono-italic.woff2 b/docs/static/fonts/cascadia-mono-italic.woff2 deleted file mode 100644 index 7309104..0000000 Binary files a/docs/static/fonts/cascadia-mono-italic.woff2 and /dev/null differ diff --git a/docs/static/fonts/cascadia-mono-regular.woff2 b/docs/static/fonts/cascadia-mono-regular.woff2 deleted file mode 100644 index 45d8bc4..0000000 Binary files a/docs/static/fonts/cascadia-mono-regular.woff2 and /dev/null differ diff --git a/eslint.config.js b/eslint.config.js index adb6168..f582433 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -44,10 +44,13 @@ export default tseslint.config( ".svelte-kit/", "dist/", ".svelte-kit/**/*", - "sites/docs/.svelte-kit/**/*", + "docs/.svelte-kit/**/*", ".svelte-kit", - "playgrounds/**/*", - "packages/cli/dist/**/*", + "start/.svelte-kit/**/*", + "start/node_modules/**/*", + "start/build/**/*", + "packages/kit/dist/**/*", + "packages/kit/.svelte-kit/**/*", ], } ); diff --git a/package.json b/package.json index eb82e6c..16a8717 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "MIT", "type": "module", "scripts": { - "build": "pnpm -r build", + "build": "pnpm build:packages && pnpm build:docs", "build:packages": "pnpm -F \"./packages/**\" --parallel build", "build:docs": "pnpm -F \"./docs/**\" build", "check": "pnpm build:packages && pnpm -r check", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e33e77e..0c9859a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -214,6 +214,51 @@ importers: specifier: ^5.0.11 version: 5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0) + start: + devDependencies: + '@svecodocs/kit': + specifier: workspace:* + version: link:../packages/kit + '@sveltejs/adapter-cloudflare': + specifier: ^4.8.0 + version: 4.8.0(@sveltejs/kit@2.9.0(@sveltejs/vite-plugin-svelte@4.0.2(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)))(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)))(wrangler@3.91.0(@cloudflare/workers-types@4.20241127.0)) + '@sveltejs/kit': + specifier: ^2.0.0 + version: 2.9.0(@sveltejs/vite-plugin-svelte@4.0.2(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)))(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)) + '@sveltejs/vite-plugin-svelte': + specifier: ^4.0.0 + version: 4.0.2(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)) + '@tailwindcss/vite': + specifier: 4.0.0-beta.4 + version: 4.0.0-beta.4(postcss-load-config@3.1.4(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)) + mdsx: + specifier: ^0.0.6 + version: 0.0.6(svelte@5.2.11) + phosphor-svelte: + specifier: ^3.0.0 + version: 3.0.0(svelte@5.2.11)(vite@5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)) + svelte: + specifier: ^5.2.11 + version: 5.2.11 + svelte-check: + specifier: ^4.0.0 + version: 4.1.0(picomatch@3.0.1)(svelte@5.2.11)(typescript@5.7.2) + svelte-preprocess: + specifier: ^6.0.3 + version: 6.0.3(postcss-load-config@3.1.4(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.7.2) + tailwindcss: + specifier: 4.0.0-beta.4 + version: 4.0.0-beta.4 + typescript: + specifier: ^5.0.0 + version: 5.7.2 + velite: + specifier: ^0.2.1 + version: 0.2.1(acorn@8.14.0) + vite: + specifier: ^5.0.11 + version: 5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0) + packages: '@ampproject/remapping@2.3.0': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4d848b6..b1788c2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - "packages/*" - "docs" + - "start" diff --git a/start/.gitignore b/start/.gitignore new file mode 100644 index 0000000..79518f7 --- /dev/null +++ b/start/.gitignore @@ -0,0 +1,21 @@ +node_modules + +# Output +.output +.vercel +/.svelte-kit +/build + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/start/.npmrc b/start/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/start/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/start/README.md b/start/README.md new file mode 100644 index 0000000..b5b2950 --- /dev/null +++ b/start/README.md @@ -0,0 +1,38 @@ +# sv + +Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```bash +# create a new project in the current directory +npx sv create + +# create a new project in my-app +npx sv create my-app +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```bash +npm run build +``` + +You can preview the production build with `npm run preview`. + +> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. diff --git a/start/mdsx.config.js b/start/mdsx.config.js new file mode 100644 index 0000000..8f56fdf --- /dev/null +++ b/start/mdsx.config.js @@ -0,0 +1,18 @@ +import { defineConfig } from "mdsx"; +import { baseRemarkPlugins, baseRehypePlugins } from "@svecodocs/kit/mdsxConfig"; +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); + +export default defineConfig({ + remarkPlugins: [...baseRemarkPlugins], + // @ts-expect-error shh + rehypePlugins: [...baseRehypePlugins], + blueprints: { + default: { + path: resolve(__dirname, "./src/lib/components/blueprint.svelte"), + }, + }, + extensions: [".md"], +}); diff --git a/start/package.json b/start/package.json new file mode 100644 index 0000000..1091c1f --- /dev/null +++ b/start/package.json @@ -0,0 +1,31 @@ +{ + "name": "@svecodocs/docs", + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "pnpm \"/dev:/\"", + "dev:content": "velite dev --watch", + "dev:svelte": "vite dev", + "build": "velite && node ./scripts/update-velite-output.js && pnpm build:search && vite build", + "build:search": "node ./scripts/build-search-data.js", + "preview": "vite preview", + "check": "velite && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "pnpm build:content && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" + }, + "devDependencies": { + "@svecodocs/kit": "workspace:*", + "@sveltejs/adapter-cloudflare": "^4.8.0", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "@tailwindcss/vite": "4.0.0-beta.4", + "mdsx": "^0.0.6", + "phosphor-svelte": "^3.0.0", + "svelte": "^5.2.11", + "svelte-check": "^4.0.0", + "svelte-preprocess": "^6.0.3", + "tailwindcss": "4.0.0-beta.4", + "typescript": "^5.0.0", + "velite": "^0.2.1", + "vite": "^5.0.11" + } +} diff --git a/start/scripts/build-search-data.js b/start/scripts/build-search-data.js new file mode 100644 index 0000000..377c0ef --- /dev/null +++ b/start/scripts/build-search-data.js @@ -0,0 +1,24 @@ +import { fileURLToPath } from "node:url"; +import { writeFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { docs } from "../.velite/index.js"; +import { cleanMarkdown } from "../node_modules/@svecodocs/kit/dist/utils.js"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); + +export function buildDocsSearchIndex() { + return docs.map((doc) => ({ + title: doc.title, + href: `/docs/${doc.slug}`, + description: doc.description, + content: cleanMarkdown(doc.raw), + })); +} + +const searchData = buildDocsSearchIndex(); + +writeFileSync( + resolve(__dirname, "../src/routes/api/search.json/search.json"), + JSON.stringify(searchData), + { flag: "w" } +); diff --git a/start/scripts/update-velite-output.js b/start/scripts/update-velite-output.js new file mode 100644 index 0000000..2ff0a62 --- /dev/null +++ b/start/scripts/update-velite-output.js @@ -0,0 +1,38 @@ +import { readFile, writeFile } from "node:fs/promises"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); +const dtsPath = join(__dirname, "../.velite/index.d.ts"); +const indexPath = join(__dirname, "../.velite/index.js"); + +async function replaceContents() { + const data = await readFile(dtsPath, "utf8").catch((err) => { + console.error("Error reading file:", err); + }); + if (!data) return; + + const updatedContent = data.replace("'../velite.config'", "'../velite.config.js'"); + if (updatedContent === data) return; + + await writeFile(dtsPath, updatedContent, "utf8").catch((err) => { + console.error("Error writing file:", err); + }); +} + +async function replaceIndexContents() { + const data = await readFile(indexPath, "utf8").catch((err) => { + console.error("Error reading file:", err); + }); + if (!data) return; + + const updatedContent = data.replaceAll(".json'", ".json' with { type: 'json' }"); + if (updatedContent === data) return; + + await writeFile(indexPath, updatedContent, "utf8").catch((err) => { + console.error("Error writing file:", err); + }); +} + +await replaceContents(); +await replaceIndexContents(); diff --git a/start/src/app.css b/start/src/app.css new file mode 100644 index 0000000..d55a847 --- /dev/null +++ b/start/src/app.css @@ -0,0 +1,2 @@ +@import "@svecodocs/kit/theme-blue.css"; +@import "@svecodocs/kit/globals.css"; diff --git a/start/src/app.d.ts b/start/src/app.d.ts new file mode 100644 index 0000000..da08e6d --- /dev/null +++ b/start/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://svelte.dev/docs/kit/types#app.d.ts +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/start/src/app.html b/start/src/app.html new file mode 100644 index 0000000..a2beb95 --- /dev/null +++ b/start/src/app.html @@ -0,0 +1,12 @@ + + +
+ + + + %sveltekit.head% + + +Visit svelte.dev/docs/kit to read the documentation
diff --git a/start/src/routes/(landing)/+page.ts b/start/src/routes/(landing)/+page.ts new file mode 100644 index 0000000..0e4a734 --- /dev/null +++ b/start/src/routes/(landing)/+page.ts @@ -0,0 +1,5 @@ +import { redirect } from "@sveltejs/kit"; + +export function load() { + redirect(302, "/docs"); +} diff --git a/start/src/routes/+layout.svelte b/start/src/routes/+layout.svelte new file mode 100644 index 0000000..3a83746 --- /dev/null +++ b/start/src/routes/+layout.svelte @@ -0,0 +1,11 @@ + + +{@render children?.()} diff --git a/start/src/routes/api/search.json/+server.ts b/start/src/routes/api/search.json/+server.ts new file mode 100644 index 0000000..e05d41d --- /dev/null +++ b/start/src/routes/api/search.json/+server.ts @@ -0,0 +1,8 @@ +import type { RequestHandler } from "@sveltejs/kit"; +import search from "./search.json" assert { type: "json" }; + +export const prerender = true; + +export const GET: RequestHandler = () => { + return Response.json(search); +}; diff --git a/start/src/routes/api/search.json/search.json b/start/src/routes/api/search.json/search.json new file mode 100644 index 0000000..269e220 --- /dev/null +++ b/start/src/routes/api/search.json/search.json @@ -0,0 +1,86 @@ +[ + { + "title": "Getting Started", + "href": "/docs/getting-started", + "description": "A quick guide to get started using Svecodocs", + "content": " import { Callout } from \"@svecodocs/kit\"; The following guide will walk you through the process of getting a Svecodocs project up and running. Clone the starter template Clone the Svecodocs starter template: pnpx degit svecosystem/svecodocs/starter Navigation The starter template comes with a basic navigation structure to get your started. To customize the navigation, adjust the src/lib/navigation.ts file. import { createNavigation } from \"@svecodocs/kit\"; export const navigation = createNavigation({ // Customize the navigation here }); Site config The site config is used to configure site-wide settings, such as the title, description, keywords, ogImage, and other metadata. The config is located in the src/lib/site-config.ts file. import { defineSiteConfig } from \"@svecodocs/kit\"; export const siteConfig = defineSiteConfig({ title: \"Svecodocs\", description: \"A SvelteKit docs starter template\", keywords: \"sveltekit, docs, starter, template\", ogImage: { url: \"https://docs.svecosystem.com/og.png\", height: 630, width: 1200, }, }); Per-Route Site Config You can override any part of the site config on a per-route basis using the useSiteConfig hook. This feature is still being worked on. Theme The starter template comes with the default Svecodocs theme (orange). To customize the theme, adjust the import in the src/app.css file to reflect the color scheme you want to use for your project. Each theme has been designed to work well in both light and dark mode. /* @import \"@svecodocs/kit/themes/orange.css\"; */ @import \"@svecodocs/kit/themes/emerald.css\"; @import \"@svecodocs/kit/globals.css\"; Logo To customize the logo displayed in the sidebar header, head to the src/routes/(docs)/+layout.svelte file and adjust the contents of the logo snippet. If the logo has a light and dark version, ensure to handle those similarly to the default Svecosystem logo. {#snippet logo()} The project name here {/snippet} `" + }, + { + "title": "Introduction", + "href": "/docs/index", + "description": "What exactly is Svecodocs?", + "content": " import { Callout } from '@svecodocs/kit' After spending countless hours building documentation sites for various projects, we decided to build a docs package/starter template that we can use for future projects. This project is a result of that effort. Svecodocs is a starting point/utility library for building documentation sites under the $2 umbrella. The code is open source, but it's built and maintained for our own specific needs, so we won't be accepting any public feature requests. You are more than welcome to fork the project and customize it to your own needs. Features Markdown-based docs**. Write docs using Markdown and Svelte components Light and dark mode**. Toggle between light and dark mode Syntax highlighting**. Code blocks are automatically highlighted SEO-friendly**. Meta tags and Open Graph support out of the box Pre-built components**. Tabs, callouts, and more to use within the documentation Custom unified plugins**. Custom remark and rehype plugins to give more flexibility over the rendered HTML shadcn-svelte**. Beautifully designed Svelte components Tailwind v4**. Tailwind CSS v4 is used for styling" + }, + { + "title": "Button", + "href": "/docs/components/button", + "description": "A button component to use in examples and documentation.", + "content": " import { Button, DemoContainer } from \"@svecodocs/kit\"; Usage import { Button } from \"@svecodocs/kit\"; Default Brand Ghost Outline Subtle Link Example Default Size Default Brand Destructive Ghost Outline Subtle Link Small Size Default Brand Destructive Ghost Outline Subtle Link " + }, + { + "title": "Callout", + "href": "/docs/components/callout", + "description": "A callout component to highlight important information.", + "content": " import { Callout } from \"@svecodocs/kit\"; import Avocado from \"phosphor-svelte/lib/Avocado\"; Callouts (also known as admonitions) are used to highlight a block of text. There are five types of callouts available: 'note', 'warning', 'danger', 'tip', and 'success'. You can override the default icon for the callout by passing a component via the icon prop. Usage import { Callout } from \"$lib/components\"; This is a note, used to highlight important information or provide additional context. You can use markdown in here as well! Just ensure you include a space between the component and the content in your Markdown file. Examples Warning This is an example of a warning callout. Note This is an example of a note callout. Danger This is an example of a danger callout. Tip This is an example of a tip callout. Success This is an example of a success callout. Custom Icon This is an example of a note callout with a custom icon. Custom Title This is an example of a warning callout with a custom title. " + }, + { + "title": "Card Grid", + "href": "/docs/components/card-grid", + "description": "Display a grid of cards.", + "content": " import { CardGrid, Card } from \"@svecodocs/kit\"; import RocketLaunch from \"phosphor-svelte/lib/RocketLaunch\"; import Blueprint from \"phosphor-svelte/lib/Blueprint\"; import Binary from \"phosphor-svelte/lib/Binary\"; import CloudCheck from \"phosphor-svelte/lib/CloudCheck\"; Use the CardGrid component to display a grid of $2 components. Usage import { CardGrid, Card } from \"@svecodocs/ui\"; You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. Examples 2 Columns (default) You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. 3 Columns You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. " + }, + { + "title": "Card", + "href": "/docs/components/card", + "description": "Display a card with a title and optional icon.", + "content": " import { Card } from \"@svecodocs/kit\"; import RocketLaunch from \"phosphor-svelte/lib/RocketLaunch\"; You can use the Card component to display a card with a title and optional icon. Usage With Icon Pass an icon component to the icon prop to display an icon in the card. import { Card } from \"@svecodocs/ui\"; import RocketLaunch from \"phosphor-svelte/lib/RocketLaunch\"; You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. Link Card Pass the href prop to convert the card into a link. import { Card } from \"@svecodocs/ui\"; import RocketLaunch from \"phosphor-svelte/lib/RocketLaunch\"; You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. Without Icon If you don't want to use an icon, just don't pass the icon prop. import { Card } from \"@svecodocs/ui\"; You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. Horizontal You can use the horizontal prop to display the card horizontally. import { Card } from \"@svecodocs/ui\"; import RocketLaunch from \"phosphor-svelte/lib/RocketLaunch\"; You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. You can use markdown in here, just ensure to include a space between the component and the content in your Markdown file. " + }, + { + "title": "Demo Container", + "href": "/docs/components/demo-container", + "description": "Display a container with a border and a background color for examples/demos.", + "content": " import { DemoContainer, Button } from \"@svecodocs/kit\"; Often times you'll want to display some demo/example components in a container. The DemoContainer component is a great way to do this, as it aligns effortlessly with the rest of the docs theme. Usage import { DemoContainer, Button } from \"@svecodocs/ui\"; Default Brand Outline Ghost Subtle Link Example Default Brand Outline Ghost Subtle Link " + }, + { + "title": "Input", + "href": "/docs/components/input", + "description": "A form input component to use in examples and documentation.", + "content": " import { Input, Label, DemoContainer, Button } from \"@svecodocs/kit\"; When building documentation, it's often necessary to provide users with a form input to showcase a specific feature. The Input component is a great way to do this, as it aligns effortlessly with the rest of the docs theme. The Label component is also provided to help with accessibility. Usage import { Input, Label } from \"@svecodocs/kit\"; Your name Example First name Last name Update Profile " + }, + { + "title": "Native Select", + "href": "/docs/components/native-select", + "description": "A styled native select component to use in examples and documentation.", + "content": " import { NativeSelect, Label, DemoContainer } from \"@svecodocs/kit\"; The NativeSelect component is a styled native select component that you can use in your examples and documentation. Usage import { NativeSelect } from \"@svecodocs/kit\"; Option 1 Option 2 Option 3 Example Select an option Option 1 Option 2 Option 3 " + }, + { + "title": "Steps", + "href": "/docs/components/steps", + "description": "Display a series of series of steps.", + "content": " import { Step, Steps, Callout } from \"@svecodocs/kit\"; The Steps and Step components are used to display a series of steps, breaking down a process into more manageable chunks. Usage import { Steps, Step } from \"$lib/components\"; Install the package You can install the project via npm or pnpm. Start your engines You can start the project by running npm run dev or pnpm run dev. Example Install the package You can install the project via npm or pnpm. npm install @svecodocs/ui Start your engines You can start the project by running npm run dev or pnpm dev. npm run dev If you plan to use markdown-specific syntax in your steps, ensure you include a space between the component and the content in your Markdown file. " + }, + { + "title": "Tabs", + "href": "/docs/components/tabs", + "description": "Break content into multiple panes to reduce cognitive load.", + "content": " import { Tabs, TabItem, Callout } from \"@svecodocs/kit\"; You can use the Tabs and TabItem components to create tabbed interfaces. A label prop must be provided to each TabItem which will be used to display the label. Whichever tab should be active by default is specified by the value prop on the Tabs component. Usage import { Tabs, TabItem } from \"@svecodocs/kit\"; This is the first tab's content. This is the second tab's content. Examples Simple Text This is the first tab's content. This is the second tab's content. Markdown Syntax import { Button } from \"@svecodocs/kit\"; alert(\"Hello!\")}>Click me export async function load() { return { transactions: [], }; } If you plan to use markdown-specific syntax in your tabs, ensure you include a space between the component and the content in your Markdown file. " + }, + { + "title": "Textarea", + "href": "/docs/components/textarea", + "description": "A textarea component to use in examples and documentation.", + "content": " import { Textarea, Label, DemoContainer, Button } from \"@svecodocs/kit\"; When building documentation, it's often necessary to provide users with a textarea to showcase a specific feature. The Textarea component is a great way to do this, as it aligns effortlessly with the rest of the docs theme. The Label component is also provided to help with accessibility. Usage import { Textarea, Label } from \"@svecodocs/kit\"; Your bio Example Bio Update Profile " + }, + { + "title": "Navigation", + "href": "/docs/configuration/navigation", + "description": "Learn how to customize the navigation in your Svecodocs project.", + "content": "Navigation is a key component of every site, documenting the structure of your site and providing a clear path for users to navigate through your content. Svecodocs comes with a navigation structure that is designed to be flexible and customizable. Each page in your site should have a corresponding navigation item, and the navigation items should be nested according to their hierarchy. Navigation Structure Main You can think of the main navigation as the root navigation for your site. Links in the main navigation are used to navigation to different sections of your site, such as \"Documentation\", \"API Reference\", and \"Blog\". Anchors Anchors are links that are displayed at the top of the sidebar and typically used to either highlight important information or provide quick access to linked content. Sections Sections are used to group related navigation items together. They are typically used to organize content into different categories, such as \"Components\", \"Configuration\", and \"Utilities\"." + }, + { + "title": "Theme", + "href": "/docs/configuration/theme", + "description": "Learn how to customize the theme in your Svecodocs project.", + "content": "The theme determines the branded color scheme for your site. A theme for each of the TailwindCSS colors is provided by the @svecodocs/kit package. Each theme has been designed to present well in both light and dark mode. Using a theme To use a theme, import the theme file into your src/app.css file before importing the @svecodocs/kit/globals.css file. /* @import \"@svecodocs/kit/theme-orange.css\"; */ @import \"@svecodocs/kit/theme-emerald.css\"; @import \"@svecodocs/kit/globals.css\"; It's not recommended to customize the theme to maintain consistency across the UI components that are provided by Svecodocs and align with the provided themes. Available themes | Theme name | Import path | | ---------- | ---------------------------------- | | orange | @svecodocs/kit/theme-orange.css | | green | @svecodocs/kit/theme-green.css | | blue | @svecodocs/kit/theme-blue.css | | purple | @svecodocs/kit/theme-purple.css | | pink | @svecodocs/kit/theme-pink.css | | lime | @svecodocs/kit/theme-lime.css | | yellow | @svecodocs/kit/theme-yellow.css | | cyan | @svecodocs/kit/theme-cyan.css | | teal | @svecodocs/kit/theme-teal.css | | violet | @svecodocs/kit/theme-violet.css | | amber | @svecodocs/kit/theme-amber.css | | red | @svecodocs/kit/theme-red.css | | sky | @svecodocs/kit/theme-sky.css | | emerald | @svecodocs/kit/theme-emerald.css | | fuchsia | @svecodocs/kit/theme-fuchsia.css | | rose | @svecodocs/kit/theme-rose.css | Tailwind Variables Svecodocs uses TailwindCSS to style the UI components and provides a set of Tailwind variables that can be used to style your examples/custom components. Gray We override the TailwindCSS gray color scale to provide our own grays. Brand You can use the brand color to use the brand color of your project." + } +] diff --git a/start/static/android-chrome-192x192.png b/start/static/android-chrome-192x192.png new file mode 100644 index 0000000..e53e8d2 Binary files /dev/null and b/start/static/android-chrome-192x192.png differ diff --git a/start/static/android-chrome-512x512.png b/start/static/android-chrome-512x512.png new file mode 100644 index 0000000..455b234 Binary files /dev/null and b/start/static/android-chrome-512x512.png differ diff --git a/start/static/apple-touch-icon.png b/start/static/apple-touch-icon.png new file mode 100644 index 0000000..fa18f51 Binary files /dev/null and b/start/static/apple-touch-icon.png differ diff --git a/start/static/favicon copy.png b/start/static/favicon copy.png new file mode 100644 index 0000000..825b9e6 Binary files /dev/null and b/start/static/favicon copy.png differ diff --git a/start/static/favicon-16x16.png b/start/static/favicon-16x16.png new file mode 100644 index 0000000..cda11b3 Binary files /dev/null and b/start/static/favicon-16x16.png differ diff --git a/start/static/favicon-32x32.png b/start/static/favicon-32x32.png new file mode 100644 index 0000000..0296cc9 Binary files /dev/null and b/start/static/favicon-32x32.png differ diff --git a/start/static/favicon.ico b/start/static/favicon.ico new file mode 100644 index 0000000..c68eadc Binary files /dev/null and b/start/static/favicon.ico differ diff --git a/start/static/logo-dark.svg b/start/static/logo-dark.svg new file mode 100644 index 0000000..4cdde12 --- /dev/null +++ b/start/static/logo-dark.svg @@ -0,0 +1,17 @@ + diff --git a/start/static/logo-light.svg b/start/static/logo-light.svg new file mode 100644 index 0000000..5eff063 --- /dev/null +++ b/start/static/logo-light.svg @@ -0,0 +1,17 @@ + diff --git a/start/static/og.png b/start/static/og.png new file mode 100644 index 0000000..9f88f80 Binary files /dev/null and b/start/static/og.png differ diff --git a/start/static/site.webmanifest b/start/static/site.webmanifest new file mode 100644 index 0000000..52a2fe3 --- /dev/null +++ b/start/static/site.webmanifest @@ -0,0 +1,11 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/start/svelte.config.js b/start/svelte.config.js new file mode 100644 index 0000000..8b056c5 --- /dev/null +++ b/start/svelte.config.js @@ -0,0 +1,18 @@ +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import { mdsx } from "mdsx"; +import mdsxConfig from "./mdsx.config.js"; +import adapter from "@sveltejs/adapter-cloudflare"; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + preprocess: [mdsx(mdsxConfig), vitePreprocess()], + kit: { + alias: { + "$content/*": ".velite/*", + }, + adapter: adapter(), + }, + extensions: [".svelte", ".md"], +}; + +export default config; diff --git a/start/tsconfig.json b/start/tsconfig.json new file mode 100644 index 0000000..a8f10c8 --- /dev/null +++ b/start/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } +} diff --git a/start/velite.config.js b/start/velite.config.js new file mode 100644 index 0000000..beaa180 --- /dev/null +++ b/start/velite.config.js @@ -0,0 +1,31 @@ +import { defineConfig, s } from "velite"; + +const baseSchema = s.object({ + title: s.string(), + description: s.string(), + path: s.path(), + content: s.markdown(), + navLabel: s.string().optional(), + raw: s.raw(), + toc: s.toc(), + section: s.enum(["Overview", "Components", "Configuration", "Utilities"]), +}); + +const docSchema = baseSchema.transform((data) => { + return { + ...data, + slug: data.path, + slugFull: `/${data.path}`, + }; +}); + +export default defineConfig({ + root: "./src/content", + collections: { + docs: { + name: "Doc", + pattern: "./**/*.md", + schema: docSchema, + }, + }, +}); diff --git a/start/vite.config.ts b/start/vite.config.ts new file mode 100644 index 0000000..e3dc09b --- /dev/null +++ b/start/vite.config.ts @@ -0,0 +1,18 @@ +import { sveltekit } from "@sveltejs/kit/vite"; +import { defineConfig } from "vite"; +import tailwindcss from "@tailwindcss/vite"; +import { resolve } from "node:path"; + +const __dirname = new URL(".", import.meta.url).pathname; + +export default defineConfig({ + plugins: [sveltekit(), tailwindcss()], + optimizeDeps: { + exclude: ["@svecodocs/kit"], + }, + server: { + fs: { + allow: [resolve(__dirname, "./.velite")], + }, + }, +});