Introduction
Docvia is a documentation framework built on a compiler architecture. It parses Markdown into an Intermediate Representation (IR), then renders framework-optimized output for Svelte, React, or any target.
How it works
Markdown → Parser → IR → Renderer → Framework Output
- Parse — Micromark parses your
.mdfiles into an AST - Transform — The IR layer converts the AST into framework-agnostic nodes
- Render — A renderer adapter (Svelte, React) produces serialized output
- Deliver — SvelteKit renders the output with full SSR support
All heavy work happens at build time. At runtime, your pages are pre-compiled JSON trees — no markdown parsing, no syntax highlighting overhead.
Why Docvia
- Type-safe — Generated TypeScript types for routes and frontmatter
- Framework-native — SvelteKit SSR, Svelte 5 runes, not framework-agnostic wrappers
- Build-time compilation — Shiki syntax highlighting, IR transforms, and rendering happen once
- Interactive islands — Embed Svelte components in Markdown with selective hydration
- Zero client JS by default — Only interactive components ship JavaScript
Quick start
npm install -D @docvia/build @docvia/plugin-shiki
npm install @docvia/core
Add the docvia() Vite plugin and declare a source (see
Getting Started), then load pages in your SvelteKit
routes:
import { source } from "#lib/source.ts";
const page = source.getPage(["getting-started"]);
const { content } = await page.data.load();
Next steps
- Getting Started: set up Docvia with SvelteKit
- Source API: work with pages, navigation, and routes
- Rendering: render content with the Svelte Renderer