@openlaboratory/open-doc
v0.1.4
Published
A polished, GitBook-style documentation-site framework. Write Markdown, run one command, get a beautiful static site.
Maintainers
Readme
open-doc
A polished, GitBook-style documentation-site framework. Write Markdown, run one command, get a beautiful static site — sidebar navigation, full-text search, light/dark themes, and MDX components, all bundled.
Quick start
npm install -D @openlaboratory/open-doc
npx open-doc init # scaffolds a config + first page, adds npm scripts
npm run devinit creates this for you — or set it up by hand. Create open-doc.config.ts:
import { defineConfig } from '@openlaboratory/open-doc'
export default defineConfig({
title: 'My Docs',
nav: [{ label: 'Getting Started', dir: 'getting-started', pages: ['introduction'] }],
})Add content/getting-started/introduction.md:
---
title: Introduction
description: Welcome.
---
# Introduction
Hello, world!Add scripts and run:
{
"scripts": {
"dev": "open-doc dev",
"build": "open-doc build",
"preview": "open-doc preview",
},
}npm run dev # http://localhost:4321
npm run build # → ./distCLI
open-doc init— scaffold a starter config + first pageopen-doc dev— dev server (--port,--host)open-doc build— static build + search index →./distopen-doc preview— serve the built siteopen-doc check— type-check content, config, and components
Configuration
Set these in open-doc.config.ts:
| Option | Description |
| -------------- | ----------------------------------------------------------------- |
| title | Required. Site title. |
| description | Home-page tagline. |
| contentDir | Markdown folder. Default ./content. |
| base | Sub-path hosting, e.g. /docs. Default /. |
| site | Canonical URL — enables canonical tags, OpenGraph, and a sitemap. |
| lang | <html lang>. Default en. |
| logo | { text?, src?, href? } header logo. |
| social | { icon?, label?, href }[] header links. |
| defaultTheme | 'dark' \| 'light' \| 'auto'. Default dark. |
| theme | { light?, dark? } HSL color overrides. |
| editLinkBase | Base URL for "Edit this page" links. |
| nav | Required. { label, dir?, pages[] }[] — the sidebar. |
The full guide and a live example live in the project repository.
open-docprovides the React runtime for MDX components. TSX authoring andopen-doc checkstill need@types/reactand@types/react-domin your project.
License
MIT
