diff --git a/.amp/services.yaml b/.amp/services.yaml index 77bb035..2b4b0b9 100644 --- a/.amp/services.yaml +++ b/.amp/services.yaml @@ -2,5 +2,5 @@ services: yawn-examples: command: npm run examples portal: - title: Yawn examples - description: Example index and WebGPU render graph studio with hot reload. + title: Yawn docs and playgrounds + description: VitePress package tutorials and isolated WebGPU playgrounds with hot reload. diff --git a/.gitignore b/.gitignore index 7328621..887b670 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ target/ # WASM build artifacts .rsw/ static/level-editor/ +docs/.vitepress/cache/ # Amp runtime artifacts .amp/in/ diff --git a/AGENTS.md b/AGENTS.md index 28ada97..8d60415 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,6 @@ # Build, Lint, and Test Commands -- `npm run examples`: Start the examples index with Vite and WASM hot reload +- `npm run examples`: Start VitePress docs and WebGPU playgrounds with WASM hot reload +- `npm run docs:build`: Build the VitePress documentation into `dist/docs/` - `npm run build`: Build optimized WASM and JS in `dist/` for development - `npm run build-release`: Build optimized WASM and JS for production - `cargo check`: Validate Rust sources quickly before full builds diff --git a/README.md b/README.md index a4fda61..115cc3b 100644 --- a/README.md +++ b/README.md @@ -43,13 +43,11 @@ loadouts, lifecycle, and transient resource management; conveniences live outsid - `addons/gltf-import` — glTF worker that writes format-neutral render-data packets directly to a fixed SOA. - `addons/mesh-handles` — conventional mesh, instance, camera, and material objects plus optional BVH picking. -The integration example in `examples/render-graph-studio` consumes every package -through its public API; no example source or shader lives in core. - -The focused recipes in `examples/cookbook` show each addon independently, including -AST/JSO/FXNode authoring, external render and compute programs, graph activation, -shared glTF import, mesh instances, custom SOA columns, SAB animation, picking, and -worker-to-worker use. +The editable playground and Render Graph Studio under `examples/` consume the +packages through their public APIs; no example source or shader lives in core. +Tutorial-style package guides and all focused recipes live under `docs/`, including +AST/JSO/FXNode authoring, render and compute programs, graph activation, shared glTF +import, mesh instances, custom SOA columns, SAB animation, picking, and worker use. Example graph authoring: diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js new file mode 100644 index 0000000..9af5242 --- /dev/null +++ b/docs/.vitepress/config.js @@ -0,0 +1,67 @@ +import { defineConfig } from "vitepress"; + +export default defineConfig({ + title: "Yawn", + description: "Worker-native WebGPU rendering with shared render data.", + base: "/docs/", + outDir: "../dist/docs", + cleanUrls: true, + head: [ + ["meta", { name: "theme-color", content: "#0d1117" }], + ["link", { rel: "icon", href: "data:image/svg+xml," }], + ], + themeConfig: { + logo: { + light: "data:image/svg+xml,", + dark: "data:image/svg+xml,", + }, + nav: [ + { text: "Learn", link: "/guide/first-scene" }, + { text: "Packages", link: "/packages/" }, + { text: "Recipes", link: "/recipes/" }, + { text: "Playground", link: "/../playground/" }, + ], + sidebar: [ + { + text: "Get started", + items: [ + { text: "Your first scene", link: "/guide/first-scene" }, + { text: "How Yawn fits together", link: "/guide/architecture" }, + ], + }, + { + text: "Package tutorials", + items: [ + { text: "Package map", link: "/packages/" }, + { text: "Core and render data", link: "/packages/core" }, + { text: "Render graph frontends", link: "/packages/render-graph" }, + { text: "glTF import worker", link: "/packages/gltf-import" }, + { text: "Conventional handles", link: "/packages/mesh-handles" }, + ], + }, + { + text: "Recipes", + items: [ + { text: "All recipes", link: "/recipes/" }, + { text: "Graph authoring", link: "/recipes/graph-authoring" }, + { text: "Pipelines and loadouts", link: "/recipes/pipelines" }, + { text: "Assets and render data", link: "/recipes/render-data" }, + { text: "Runtime interaction", link: "/recipes/runtime" }, + ], + }, + ], + socialLinks: [ + { icon: "github", link: "https://github.com/heaust-ops/yawn" }, + ], + search: { provider: "local" }, + outline: { level: [2, 3] }, + editLink: { + pattern: "https://github.com/heaust-ops/yawn/edit/feat/core/docs/:path", + text: "Edit this page on GitHub", + }, + footer: { + message: "Core owns render data and render graphs. Addons own conveniences.", + copyright: "Yawn is pre-1.0 software.", + }, + }, +}); diff --git a/docs/.vitepress/theme/Playground.vue b/docs/.vitepress/theme/Playground.vue new file mode 100644 index 0000000..dc21d5d --- /dev/null +++ b/docs/.vitepress/theme/Playground.vue @@ -0,0 +1,31 @@ + + +