Docs dev & build
The GazePlotter documentation is integrated directly into the main application codebase. The files are written in Markdown (.md) and preprocessed using MDsveX, allowing them to be compiled as Svelte components and prerendered by SvelteKit at build time.
More about the dev & build process of the main app can be found in the App dev & build section.
File Locations
- Content files: All documentation pages are located in the
docs/directory at the root of the project (e.g.,docs/setup/workspace.md). - Sidebar Configuration: The sidebar menu and descriptions are managed in
src/routes/docs/sidebarConfig.ts. - Routing: SvelteKit dynamic routing is configured in
src/routes/docs/[...slug].
Quick Start
To preview the documentation locally:
- In the terminal, make sure you are in the project’s root directory.
- Run the main development server:
npm run dev - Open
http://localhost:5173/docs(or the port specified by Vite) in your browser. The documentation pages will reload automatically as you edit the.mdfiles.
Adding or Modifying Pages
When adding a new documentation page:
- Create a new
.mdfile inside the appropriate subfolder under the rootdocs/directory. - Add standard Markdown headers and content.
- Open
src/routes/docs/sidebarConfig.tsand add the page to theSIDEBARarray under the correct section, specifying itsname,href(matching/docs/...), and a shortdescription.
Building the Docs
Since the documentation is part of the SvelteKit app, it is built automatically when compiling the main application:
npm run build The production assets, including the prerendered HTML for all documentation routes, will be placed in the build/ directory. To preview the production build locally, run:
npm run preview