This directory contains the source files of the Fedify docs. The docs are written in Markdown format and are built with VitePress.
In order to build the docs locally, you need to install Node.js and pnpm first. Then you can run the following commands (assuming you are in the docs/ directory):
pnpm install
pnpm devOnce the development server is running, you can open your browser and navigate to http://localhost:5173/ to view the docs.
The docs/ directory uses VitePress with additional features beyond standard Markdown.
Use the twoslash modifier to enable TypeScript type checking and hover
information in code blocks:
~~~~ typescript twoslash
import { createFederation } from "@fedify/fedify";
const federation = createFederation({ kv: undefined! });
~~~~When code examples need variables that shouldn't be shown to readers,
declare them before the // ---cut-before--- directive. Content before
this directive is compiled but hidden from display:
~~~~ typescript twoslash
import type { KvStore } from "@fedify/fedify";
declare const kv: KvStore;
// ---cut-before---
import { createFederation } from "@fedify/fedify";
const federation = createFederation({ kv });
~~~~The reader sees only the code after ---cut-before---, but TypeScript
checks the entire block including the hidden fixture.
Use code groups to show the same content for different package managers or environments:
::: code-group
~~~~ bash [Deno]
deno add jsr:@fedify/fedify
~~~~
~~~~ bash [npm]
npm add @fedify/fedify
~~~~
~~~~ bash [pnpm]
pnpm add @fedify/fedify
~~~~
:::- When linking to other VitePress documents within the docs/ directory,
use inline link syntax (e.g.,
[text](./path/to/file.md)) instead of reference-style links. - Always use relative paths for internal links.
- Include the
.mdextension in internal link paths.
Prefer definition lists over bulleted lists for term-definition pairs. Descriptions should be written as full sentences (sentence case, ending with a period). List multiple terms for one description on separate lines:
Term 1
Term 2
: Description starts with a capital letter and ends with a period.mise run docs:build # Build for production (runs Twoslash type checking)
mise run docs # Start development serverAlways run mise run docs:build before committing to catch Twoslash type
errors.