A markdown-based documentation engine built on Vite + TypeScript.
docs.ts is a fast, dependency-free documentation engine that turns a folder of Markdown files into a fully featured documentation website.
No React. No Vue. No external markdown parser. No runtime dependencies.
- Zero runtime dependencies
- Custom Markdown parser written in TypeScript
- (Primitive) Syntax highlighting for:
- TypeScript
- JavaScript
- JSON
- CSS / SCSS
- HTML / XML / SVG
- Bash / Shell
- Callouts
- Spoilers
- Chips / badges
- Keyboard shortcut rendering
- File imports
- Dark and light themes
- Configurable navigation
- Theme customization
- Scroll progress indicator
- Responsive sidebar with search
- Runtime-loaded Markdown files
- GitHub Pages friendly
- Fully static output
- Node.js 18+
- npm, pnpm, yarn, or Bun
git clone https://github.com/thenolle/docs.ts.git
cd docs.ts
bun install # or npm install, pnpm install, yarn installbun run dev # or npm run dev, pnpm run dev, yarn devOpen:
http://localhost:5173
bun run build # or npm run build, pnpm run build, yarn buildProduction files are generated in:
dist/
Preview the production build:
bun run preview # or npm run preview, pnpm run preview, yarn previewpublic/
├── docs/
│ ├── config.json
│ ├── index.md
│ ├── guide/
│ ├── reference/
│ └── assets/
└── favicon.svg
src/
├── main.ts
├── globals.css
└── lib/
├── types.ts
├── config.ts
├── markdown.ts
├── importer.ts
├── router.ts
├── loader.ts
└── ui.ts
All configuration lives in:
public/docs/config.json
Example:
{
"title": "docs.ts",
"description": "A markdown-based documentation engine built on Vite + TypeScript",
"version": "v1.0.0",
"defaultTheme": "dark",
"themeToggle": true,
"scrollProgress": true,
"landing": "index.md",
"basePath": "/docs.ts",
}The documentation engine now supports hosting under a subdirectory.
If your site is deployed under a path such as:
https://example.com/docs/
you can configure it explicitly using:
{
"basePath": "/docs/"
}If basePath is not provided, the engine assumes:
/
This allows the documentation site to correctly resolve routes and assets when hosted either at the domain root or inside a subfolder.
{
"nav": [
{
"label": "Introduction",
"href": "index.md"
},
{
"group": "Guide",
"items": [
{
"label": "Getting Started",
"href": "guide/getting-started.md"
}
]
}
]
}{
"theme": {
"accent": "#ff88ff",
"accentHover": "#ff99ff"
}
}Markdown files live inside:
public/docs/
Example:
public/docs/
├── index.md
├── guide/
│ └── getting-started.md
└── api/
└── reference.md
Reference them from navigation using paths relative to public/docs/.
{
"label": "API Reference",
"href": "api/reference.md"
}**bold**
_italic_
~~strikethrough~~
`code`:::
Information
:::
:::
Warning
:::
:::
Danger
:::
:::
Success
:::::chip[stable]
::chip[beta]{yellow}
::chip[deprecated]{red}:::
Hidden content
:::Press [[Ctrl+S]] to save.==highlight==
::v[1.0.0]
::since[v0.5.0]Custom transformations can be defined in config.json.
Embed external files directly inside documentation pages.
!!import[./assets/logo.svg]Renders as inline SVG.
!!import[./assets/config.json]Renders as syntax-highlighted JSON.
!!import[./assets/example.ts]Renders as a syntax-highlighted code block.
Markdown files are loaded via fetch() at runtime.
This means:
- No Markdown bundling
- No rebuild required when editing documentation
- Add, rename, or remove pages freely
- Simply refresh the browser during development
docs.ts generates a fully static site and can be deployed anywhere.
A GitHub Actions workflow is included for automatic deployment.
vercel --prodUpload the dist/ directory.
cp -r dist/* /var/www/html/- TypeScript
- Vite
- Tailwind CSS v4
- Terser
- Bun
- Custom Markdown Engine
docs.ts focuses on:
- Simplicity
- Performance
- Minimal dependencies
- Predictable output
- Easy self-hosting
- Long-term maintainability
Everything is built around a lightweight TypeScript codebase rather than a large framework ecosystem.
Protect them dolls 🏳️⚧️