A lightweight, zero-config documentation system for Next.js applications.
- 📝 Markdown & MDX Support: Write your documentation in Markdown or MDX
- 🔄 Zero Config: Works out of the box with sensible defaults
- 🎨 Customizable: Easily customize the appearance and behavior
- 🔍 Search: Built-in search functionality
- 🌙 Dark Mode: Support for light and dark modes
- 🧩 Code Highlighting: Syntax highlighting for code blocks
- 🌐 Internationalization: Support for multiple languages
- 📱 Responsive: Looks great on all devices
npm install @iambalance/cometdocs
# or
yarn add @iambalance/cometdocs
# or
pnpm add @iambalance/cometdocs
- Create a
docs
directory in your project root:
mkdir -p docs/en
- Add the required dependencies to your Next.js project:
# If you haven't already installed these
pnpm add next@latest react@latest react-dom@latest
- Create your first documentation file:
# Create a getting started page
echo "---
title: Getting Started
---
# Getting Started
Welcome to your documentation!" > docs/en/getting-started.md
- Create a page to display your documentation:
// app/docs/[...slug]/page.tsx
import { CometDocs } from '@iambalance/cometdocs';
export default function DocsPage({ params }: { params: { slug: string[] } }) {
return <CometDocs slug={params.slug.join('/')} />;
}
- Import the styles in your root layout:
// app/layout.tsx
import '@iambalance/cometdocs/styles.css';
- Start your Next.js development server:
npm run dev
# or
yarn dev
# or
pnpm dev
- Visit
http://localhost:3000/docs/getting-started
to see your documentation.
You can customize CometDocs by creating a cometdocs.config.js
file in your project root:
// cometdocs.config.js
module.exports = {
content: {
dir: './docs',
defaultLocale: 'en',
},
theme: {
colors: {
primary: '#3490dc',
secondary: '#718096',
accent: '#f6ad55',
},
layout: 'sidebar',
darkMode: 'system',
},
navigation: {
auto: true,
items: [
{
title: 'Getting Started',
path: '/docs/getting-started',
},
// Add more navigation items here
],
},
advanced: {
basePath: '/docs',
search: {
enabled: true,
type: 'local',
},
codeHighlighting: true,
},
};
CometDocs looks for Markdown or MDX files in the docs
directory. You can organize your documentation by locale:
docs/
en/
getting-started.md
guides/
installation.md
configuration.md
fr/
getting-started.md
guides/
installation.md
configuration.md
import { CometDocs } from '@iambalance/cometdocs';
<CometDocs
slug="getting-started"
config={{
// Optional custom configuration
}}
components={{
// Optional custom components
Layout: CustomLayout,
}}
/>
slug
(string, required): The slug of the document to displayconfig
(object, optional): Custom configuration to override the default configcomponents
(object, optional): Custom components to override the default components
MIT © CometDocs Team