Getting Started
Install Folio and create your first documentation site.
Folio turns a directory of Markdown and MDX files into a file-based documentation site. Routes are derived from the content directory, and the default theme provides navigation, search, syntax highlighting, and responsive layouts. The files can document any project, library, API, or product.
Requirements
You need:
- Bun, npm, pnpm, or yarn;
- a directory containing Markdown or MDX files, or an empty directory for a new documentation project;
- Tailwind CSS v4 when using the generated default theme.
The commands below use the package manager selected for your project. The engine is not tied to Bun.
Create a documentation project
Install the engine in an existing project:
Then initialize the documentation structure:
The initializer creates the documentation structure and installs the
dependencies required by the generated theme. It merges the generated scripts
and dependencies into package.json, while existing docs.config.ts and
nikala.config.json files are preserved.
Dependencies the initializer adds, such as solid-js, tailwindcss, and the
packages the copied components import, use the version ranges that the running
Folio version is built and tested with, read from Folio's own package.json.
It never writes latest, so a new major release of a dependency cannot enter a
freshly generated project. Dependencies you already declare are left unchanged.
The generated project contains:
Every component, hook, and provider in src/ is copied from the Folio version
that ran the initializer, together with the helper files it imports, so the
copies always match the theme that Folio ships. The initializer never
overwrites a file that already exists. To pick up the components of a newer
Folio version in an existing project, delete the copies you have not changed
and run the initializer again.
It also configures the @/* TypeScript path alias and adds dev, build,
and preview scripts when they are not already defined.
The generated theme sources are regular files in your project. You can inspect and customize them as part of your own documentation site.
Start the development server
From the project root, run the generated development script:
The default development server is available at http://localhost:1862/.
The server watches the configured content directory and reloads routes and configuration changes during development.
Add your first page
Create an MDX file under docs/:
The file path becomes the route. For example:
Directories become sidebar categories automatically. Use frontmatter such as
order, categoryOrder, icon, badge, toc, prev, and next to control
page metadata and navigation.
Configure the site
The initializer creates docs.config.ts in the project root. A minimal
configuration looks like this:
The full configuration reference is available in Configuration.
Use Nikala UI with the documentation site
The default theme uses Nikala UI components. When you need additional UI components or theme capabilities, use the Nikala UI CLI from the generated project:
The CLI writes the selected source into the project so it can be used and customized locally.
Build and preview for production
Build the site and preview the generated production output:
The build writes the documentation site to dist/. The preview command
serves that production output locally. Use the production build before
deploying to catch SSR, routing, and asset-path issues that may not appear in
development mode.