# sdocs — full reference > sdocs is a documentation tool for Svelte 5 components. It renders `.sdoc` > files into a documentation site: a `.sdoc` file is a documentation format that > *contains* Svelte — the file's structure is sdoc, and Svelte lives inside > designated blocks. This is a complete, self-contained reference — setup, > configuration, the CLI/build, and the full `.sdoc` authoring format — for > developers and coding assistants. Live docs: https://gabilungu.github.io/sdocs/ ## Requirements - **Node 22 or newer** (what the package declares and CI verifies). A `.ts` config additionally needs a Node with native type stripping. - Svelte 5 - Vite with `@sveltejs/vite-plugin-svelte` Install `@sveltejs/vite-plugin-svelte` in the project even when running via `npx`. sdocs takes the compiler from the project's plugin and pins the browser runtime to the project's `svelte`, so both halves come from ONE copy. Without the plugin, sdocs must compile with its own bundled svelte while your components run against yours; mismatched versions then break generated-code contracts (blank pages, `is not a function` from svelte internals). sdocs warns when it detects that split. ## Setup Install into a Svelte 5 project: ```bash npm install sdocs ``` Or skip installing entirely — with `.sdoc` files present, `npx sdocs run` fetches sdocs into the npx cache and serves them, resolving your components' dependencies (and your project's own `svelte`) from the project. Scaffold a config (optional — the defaults work with zero config): ```bash npx sdocs init ``` This writes a config with every option present but commented out. The file is `sdocs.config.js` when the project's package.json says `"type": "module"`, and `sdocs.config.mjs` otherwise — the config is an ES module, and Node reads a bare `.js` as a CommonJS script. Write a first doc next to a component (`src/lib/Button.svelte` → `src/lib/Button.sdoc`): ```sdoc [SHOWCASE title="Components / Button" description="A flexible button."] [COMPONENT component={Button} args={{ label: 'Click me', disabled: false }}]