Getting Started
Installation
Install Clearify as a dev dependency:
npm install @marlinjai/clearify --save-devScaffold your project
The fastest way to get started:
npx clearify initThis creates:
docs/public/index.md— your home pagedocs/public/getting-started.md— a starter guidedocs/internal/index.md— internal docs section (use--no-internalto skip)clearify.config.ts— project configuration with sectionsCHANGELOG.md— a Keep a Changelog formatted changelog
Start the dev server
npx clearify devOpen http://localhost:4747 to see your docs. The server hot-reloads on every file change.
Custom port
Override the port with --port or in your config:
npx clearify dev --port 9999Adding pages
Create .md or .mdx files in the docs/public/ folder. Each file becomes a page. Subfolders become navigation groups.
docs/
├── public/ # User-facing docs
│ ├── index.md # Home page (/)
│ ├── getting-started.md # /getting-started
│ └── guides/
│ ├── installation.md # /guides/installation
│ └── configuration.md
└── internal/ # Design docs, roadmaps (draft)
└── index.md
Frontmatter
Control page metadata with YAML frontmatter:
---
title: My Page Title
description: A brief description
order: 1
---title— page title (defaults to filename)description— meta description for searchorder— sort position in sidebar (lower = higher)
Configuration
Create a clearify.config.ts in your project root:
import { defineConfig } from '@marlinjai/clearify';
export default defineConfig({
name: 'My Project',
sections: [
{ label: 'Docs', docsDir: './docs/public' },
{ label: 'Internal', docsDir: './docs/internal', basePath: '/internal', draft: true },
],
theme: {
primaryColor: '#3B82F6',
mode: 'auto',
},
});Options
| Option | Default | Description |
|---|---|---|
name | Auto-detected from package.json | Site name shown in header |
port | 4747 | Dev server port |
docsDir | ./docs | Docs folder path (single-section mode) |
sections | — | Array of { label, docsDir, basePath?, draft? } for multi-section |
outDir | ./docs-dist | Build output path |
exclude | [] | Glob patterns to exclude from navigation |
theme.primaryColor | #3B82F6 | Accent color |
theme.mode | auto | light, dark, or auto |
Building for production
npx clearify buildOutputs a static site to docs-dist/ with a sitemap.xml. Deploy anywhere that serves static files.