Skip to content

Commit 29a4ce2

Browse files
committed
Update README.md
1 parent be142a7 commit 29a4ce2

File tree

1 file changed

+99
-67
lines changed

1 file changed

+99
-67
lines changed

README.md

Lines changed: 99 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<!-- PROJECT TITLE -->
44
<h3>
55
<img src="https://github.com/docmd-io/docmd/blob/main/packages/ui/assets/images/docmd-logo-dark.png?raw=true" alt="docmd logo" width="210" />
6-
<!-- docmd -->
76
</h3>
87

98
<!-- ONE LINE SUMMARY -->
@@ -43,75 +42,70 @@
4342
## Features
4443

4544
- **Zero Config**: Intelligent auto-routing scans your folders and builds navigation trees instantly.
46-
- **Versioning**: Enterprise-grade versioning (v1, v2) with sticky context switching.
47-
- **Super Fast**: Generates pure static HTML. No hydration gap. No heavy frameworks.
48-
- **AI-Ready**: Automatically generates `llms.txt` context for AI agents.
49-
- **Smart Search**: Built-in, privacy-friendly full-text search with deep-linking.
50-
- **Isomorphic**: Runs seamlessly in Node.js (CLI) or directly in the browser.
51-
- **Rich Content**: Native support for Tabs, Steps, Callouts, and Mermaid diagrams.
52-
- **SEO Optimized**: Native sitemaps, canonical tags, and static HTML redirects.
45+
- **Versioning**: Enterprise-grade versioning (v1, v2) with sticky context switching and smart routing.
46+
- **Super Fast**: Generates pure static HTML. No hydration gap. No heavy React/Vue overhead.
47+
- **AI-Ready**: Automatically generates `llms.txt` and `llms-full.txt` context for AI agents.
48+
- **PWA**: Native Progressive Web App support for offline access and smart background caching.
49+
- **Smart Search**: Built-in, privacy-friendly offline search with deep-linking to exact headers.
50+
- **Isomorphic**: Runs seamlessly in Node.js (CLI) or directly in the browser via Live Editor.
51+
- **Rich Content**: Native Markdown support for Tabs, Steps, Callouts, and Mermaid diagrams.
52+
- **SEO Optimized**: Auto-generates sitemaps, canonical tags, 404 pages, and static HTML redirects.
5353

54-
## Installation
54+
## Getting Started
5555

56-
```bash
57-
npm install -g @docmd/core
58-
```
59-
60-
## Usage
61-
62-
### CLI
63-
64-
The Command Line Interface is the primary way to interact with `docmd`.
56+
You can run `docmd` on-the-fly without installing, or add it permanently to your long term projects.
6557

58+
### Option 1: Zero-Config (Try it instantly)
59+
Run `docmd` inside any folder containing markdown files. It will automatically extract your headers and build a nested navigation sidebar.
6660
```bash
67-
docmd init # Initialize a new project with V3 config
68-
docmd dev -z # ⚡️ Start Zero-Config mode (no setup required)
69-
docmd dev # Start local server with config
70-
docmd build # Generate production static site
71-
docmd live # Launch the browser-based Live Editor
72-
docmd migrate # Upgrade legacy configs to V3 structure
73-
```
61+
# Start local dev server
62+
npx @docmd/core dev -z
7463

75-
### API
64+
# Generate production static site
65+
npx @docmd/core build -z
66+
```
67+
> **Note:** Zero-Config (`-z`) is currently in `beta`. It is fantastic for quick previews, but for production sites, we recommend initializing a standard configuration file for maximum control.
7668
77-
`docmd` exports its core engine, allowing you to build documentation programmatically within your own Node.js scripts or build tools.
69+
### Option 2: Project Installation (Recommended)
70+
For permanent projects, install `docmd` as dependency to lock your versions.
7871

79-
```javascript
80-
const { build, buildLive } = require('@docmd/core');
72+
```bash
73+
# 1. Install locally
74+
npm install @docmd/core
8175

82-
// Trigger a standard documentation build
83-
await build('./docmd.config.js', {
84-
isDev: false,
85-
preserve: true
86-
});
76+
# 2. Initialize your configuration
77+
npx docmd init
8778

88-
// Trigger a Live Editor bundle build
89-
await buildLive();
79+
# 3. Start developing
80+
npx docmd dev
9081
```
9182

92-
### Live Editor
83+
### Option 3: Global Installation
84+
Install once and use the `docmd` command anywhere on your machine.
9385

94-
`docmd` features a modular architecture that allows the core engine to run client-side.
86+
```bash
87+
npm install -g @docmd/core
9588

96-
Running `docmd live` builds a standalone web application where you can write Markdown and see the preview instantly without any server-side processing. You can embed the generated `docmd-live.js` bundle to add Markdown capabilities to your own applications.
89+
docmd dev # Start the local dev server
90+
docmd build # Generate the production static site
91+
```
9792

9893
## Project Structure
9994

100-
`docmd` keeps it simple. Your content lives in `docs/`, your config in `docmd.config.js`.
95+
`docmd` keeps your repository clean. Your content lives in `docs/`, your config in `docmd.config.js`.
10196

10297
```bash
10398
my-docs/
104-
├── docs/ # Your Markdown files
99+
├── docs/ # Your Markdown Files
105100
│ ├── index.md # Homepage
106-
│ └── guide.md # Content page
107-
├── assets/ # Images and custom CSS
108-
├── docmd.config.js # Configuration
109-
└── package.json
101+
│ └── guide.md # Content Page
102+
├── assets/ # Images and Custom JS/CSS
103+
├── docmd.config.js # The docmd Configuration
104+
└── package.json # Node.js Dependencies
110105
```
111106

112107
## Configuration
113-
114-
Customize your site in seconds via `docmd.config.js`. We use a type-safe helper for better DX:
108+
`docmd` provides a highly flexible API. Customize your site in seconds via `docmd.config.js`. Here is a robust example showing off our most powerful features:
115109

116110
```javascript
117111
const { defineConfig } = require('@docmd/core');
@@ -124,47 +118,86 @@ module.exports = defineConfig({
124118

125119
// Enterprise Versioning
126120
versions: {
127-
current: 'v2',
128-
all: [
129-
{ id: 'v2', dir: 'docs', label: 'v2.x' },
121+
current: 'v2', // Builds to root (/) for optimal SEO
122+
all:[
123+
{ id: 'v2', dir: 'docs', label: 'v2.x (Latest)' },
130124
{ id: 'v1', dir: 'docs-v1', label: 'v1.x' }
131125
]
132126
},
133127

134-
// Layout Architecture
128+
// Layout & UI Architecture
135129
layout: {
136-
spa: true, // Seamless page transitions
130+
spa: true, // Enable buttery-smooth page transitions
137131
header: { enabled: true },
138132
sidebar: { collapsible: true },
139133

140-
// Unified Options Menu
141134
optionsMenu: {
142135
position: 'header',
143136
components: {
144137
search: true,
145-
themeSwitch: true,
146-
sponsor: 'https://github.com/sponsors/me'
138+
themeSwitch: true
147139
}
148140
},
149141

150142
footer: {
151-
style: 'minimal',
152-
branding: false // Whitelabeling
143+
style: 'minimal'
153144
}
154145
},
155146

147+
// Custom Navigation (If not using Zero-Config)
148+
navigation:[
149+
{ title: 'Home', path: '/', icon: 'home' },
150+
{
151+
title: 'Guide',
152+
icon: 'book-open',
153+
children:[
154+
{ title: 'Installation', path: '/installation' },
155+
{ title: 'API Reference', path: '/api' },
156+
],
157+
}
158+
],
159+
156160
// Theme Settings
157161
theme: {
158-
name: 'sky',
159-
defaultMode: 'system'
162+
name: 'sky', // 'default', 'sky', 'ruby', 'retro'
163+
defaultMode: 'system', // 'light', 'dark', 'system'
160164
},
161165

162-
// SEO & Redirects
163-
redirects: { '/old-guide': '/new-guide' },
166+
// Powerful Plugins (Zero setup required)
167+
plugins: {
168+
search: {},
169+
pwa: { themeColor: '#0097ff' }, // Makes your docs installable!
170+
llms: { fullContext: true }, // Generates llms-full.txt
171+
mermaid: {}
172+
},
173+
174+
// SEO & Error Handling
175+
redirects: { '/old-guide': '/installation' },
164176
notFound: { title: 'Page Not Found', content: 'This page has moved.' }
165177
});
166178
```
167179

180+
## Advanced Usage
181+
182+
### Programmatic API
183+
`docmd` exports its core engine, allowing you to build documentation programmatically within your own Node.js scripts or CI/CD pipelines.
184+
185+
```javascript
186+
const { build, buildLive } = require('@docmd/core');
187+
188+
// Trigger a standard documentation build
189+
await build('./docmd.config.js', {
190+
isDev: false,
191+
offline: false
192+
});
193+
194+
// Build the Live Editor standalone bundle
195+
await buildLive();
196+
```
197+
198+
### Live Editor (`docmd live`)
199+
`docmd` features an isomorphic architecture. Running `npx @docmd/core live` builds a standalone web application where you can write Markdown and see the preview instantly without any server-side processing. You can also try our **[docmd live](https://live.docmd.io)** editor!
200+
168201
## Comparison
169202

170203
| Feature | docmd | Docusaurus | MkDocs | Mintlify |
@@ -174,19 +207,18 @@ module.exports = defineConfig({
174207
| **Output** | **Static HTML** | React Hydration | Static HTML | Hosted |
175208
| **JS Payload** | **Tiny (< 20kb)** | Heavy (> 200kb) | Minimal | Medium |
176209
| **Versioning** | **Easy (Config + Auto)** | Complex (FS) | Plugin (Mike) | Native |
210+
| **i18n Support** | **In Pipeline** | Native | Theme-based | Beta |
177211
| **Search** | **Built-in (Offline)** | Algolia (Cloud) | Built-in (Lunr) | Built-in (Cloud) |
178-
| **Setup** | **Instant (-z)** | ~15 mins | ~10 mins | Instant |
212+
| **PWA** | **Built-in (Plugin)** | Plugin | None | Hosted |
213+
| **AI Context** | **Built-in (llms.txt)** | Plugin | None | Proprietary |
214+
| **Setup** | **Instant (-z)** | ~15 mins | ~10 mins | ~5 mins |
179215
| **Cost** | **Free OSS** | Free OSS | Free OSS | Freemium |
180216

181217
## Community & Support
182-
183218
- **Contributing**: We welcome PRs! See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
184219
- **Support**: If you find `docmd` useful, please consider [sponsoring the project](https://github.com/sponsors/mgks) or giving it a star ⭐.
185220

186221
## License
187-
188222
Distributed under the MIT License. See `LICENSE` for more information.
189223

190-
> **{ github.com/mgks }**
191-
>
192-
> ![Website Badge](https://img.shields.io/badge/Visit-mgks.dev-blue?style=flat&link=https%3A%2F%2Fmgks.dev) ![Sponsor Badge](https://img.shields.io/badge/%20%20Become%20a%20Sponsor%20%20-red?style=flat&logo=github&link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fmgks)
224+
![Website Badge](https://img.shields.io/badge/.*%20mgks.dev-blue?style=flat&link=https%3A%2F%2Fmgks.dev) ![Sponsor Badge](https://img.shields.io/badge/%20%20Become%20a%20Sponsor%20%20-red?style=flat&logo=github&link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fmgks)

0 commit comments

Comments
 (0)