docmedown 0.9.6 → 0.9.9-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +428 -402
  2. package/dist/cli.js +671 -370
  3. package/dist/dmd-locales-B0_mu21I.js +211 -0
  4. package/dist/dmd-locales-CEoK4SPg.mjs +25 -0
  5. package/dist/docmedown-mermaid.js +143 -3587
  6. package/dist/docmedown.cjs +7975 -7230
  7. package/dist/docmedown.iife.js +8549 -10781
  8. package/dist/docmedown.mjs +11747 -10724
  9. package/dist/docmedown.web.js +8183 -7228
  10. package/dist/embedded-dmd-locales.js +212 -0
  11. package/dist/mermaid-CDHlsVmo.mjs +26708 -0
  12. package/dist/mermaid-Dq2ydXvA.js +146 -0
  13. package/dist/types/runtime/config-schema.d.ts +120 -1
  14. package/dist/types/runtime/embedded-dmd-locales.d.ts +5 -0
  15. package/dist/types/runtime/embedded-dmd.d.ts +20 -0
  16. package/dist/types/runtime/i18n.d.ts +42 -0
  17. package/dist/types/runtime/markdown/mermaid-loader.d.ts +7 -8
  18. package/dist/types/runtime/markdown/mermaid.d.ts +41 -19
  19. package/dist/types/runtime/markdown/parser.d.ts +2 -2
  20. package/dist/types/runtime/router.d.ts +3 -0
  21. package/dist/types/runtime/search/search-index.d.ts +1 -0
  22. package/dist/types/runtime/types.d.ts +2 -0
  23. package/dist/types/ui/doc-context.svelte.d.ts +63 -1
  24. package/dist/types/ui/registry.d.ts +3 -2
  25. package/dist/types/ui/theme.svelte.d.ts +1 -1
  26. package/package.json +11 -6
  27. package/schemas/docs.schema.json +225 -186
  28. package/templates/README.md +68 -68
  29. package/templates/docs.json +12 -0
  30. package/dist/architecture-7GRP2DOG-B8Xs9IfY.mjs +0 -2
  31. package/dist/architecture-7GRP2DOG-Vdsw7WC7.js +0 -1
  32. package/dist/cynefin-OW5HDTMX-DU6kwwck.js +0 -1
  33. package/dist/cynefin-OW5HDTMX-F0P2M_lQ.mjs +0 -2
  34. package/dist/eventmodeling-NTZA5JFV-D58ICByZ.js +0 -1
  35. package/dist/eventmodeling-NTZA5JFV-SxxTo5cJ.mjs +0 -2
  36. package/dist/gitGraph-4MIJSDKK-C_R2a4aQ.mjs +0 -2
  37. package/dist/gitGraph-4MIJSDKK-CdMj8HJ8.js +0 -1
  38. package/dist/info-A6RAGUB7-CG4UBCfn.js +0 -1
  39. package/dist/info-A6RAGUB7-DmjQlHTj.mjs +0 -2
  40. package/dist/mermaid-BvOI3ZSW.js +0 -3334
  41. package/dist/mermaid-Cx9uSfoz.mjs +0 -116948
  42. package/dist/packet-AYTQ26CC-CMuoEJn0.js +0 -1
  43. package/dist/packet-AYTQ26CC-tdMo_iPL.mjs +0 -2
  44. package/dist/pie-WAS4IAKB-C1hjX8y0.js +0 -1
  45. package/dist/pie-WAS4IAKB-DG2Bio1G.mjs +0 -2
  46. package/dist/radar-RG4KPBEZ-DHxYOB0f.mjs +0 -2
  47. package/dist/radar-RG4KPBEZ-Dvyo3gdA.js +0 -1
  48. package/dist/railroad-74A4TZTK-1sb9Z_QQ.js +0 -1
  49. package/dist/railroad-74A4TZTK-CwztrSkE.mjs +0 -2
  50. package/dist/railroad-abnf-HS5TGJTU-4264fZjH.js +0 -1
  51. package/dist/railroad-abnf-HS5TGJTU-BKCsR9iC.mjs +0 -2
  52. package/dist/railroad-ebnf-LZEXJU2U-BXErl5kO.js +0 -1
  53. package/dist/railroad-ebnf-LZEXJU2U-DzDOfuxK.mjs +0 -2
  54. package/dist/railroad-peg-WCYAUIDC-B6gNHamV.mjs +0 -2
  55. package/dist/railroad-peg-WCYAUIDC-D7pSwRGa.js +0 -1
  56. package/dist/treeView-Q6P3EWNA-DArM8kFH.mjs +0 -2
  57. package/dist/treeView-Q6P3EWNA-JstiGzov.js +0 -1
  58. package/dist/treemap-WGGIJYW6-CMIcmEVN.mjs +0 -2
  59. package/dist/treemap-WGGIJYW6-Dq6fFckz.js +0 -1
  60. package/dist/wardley-WFR3VGLG-BK9BA6h6.mjs +0 -2
  61. package/dist/wardley-WFR3VGLG-Cbs7W-dU.js +0 -1
package/README.md CHANGED
@@ -1,402 +1,428 @@
1
- # DocMeDown ⚡
2
- ### *The simplest MarkDown documenter yet.*
3
-
4
- [![npm version](https://img.shields.io/npm/v/docmedown.svg?style=flat-square&color=6366f1)](https://www.npmjs.com/package/docmedown)
5
- [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
7
- [![CI](https://github.com/gabrielmsilva00/docmedown/actions/workflows/ci.yml/badge.svg)](https://github.com/gabrielmsilva00/docmedown/actions/workflows/ci.yml)
8
-
9
- **DocMeDown** is a zero-friction, ultra-lightweight documentation engine and CLI utility. Similar in visual elegance and features to **Docusaurus** and **VitePress**, but with **10x simpler setup** and zero build baggage.
10
-
11
- Source code, issues, and releases live at [github.com/gabrielmsilva00/docmedown](https://github.com/gabrielmsilva00/docmedown).
12
-
13
- Drop a single `index.html` file into any directory of `.md` files, and you have a fast, responsive documentation website with a complete reading interface.
14
-
15
- ---
16
-
17
- ## ✨ Features at a Glance
18
-
19
- - 🚀 **Zero-Config Auto-Discovery**: Automatically parses and indexes all `.md` files & subfolders into categories, builds navigation sidebars, and powers instant search out of the box.
20
- - 📁 **Unified Root & `./docs/` Discovery**: Automatically detects markdown files at your project root (`README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `ROADMAP.md`, etc.) and links both root and `./docs/` together by default without creating an artificial `./docs/` subdivision.
21
- - 🌐 **Dual Usage: CLI Tool & Web Script**:
22
- - Run via single-line CLI: `npx docmedown ./docs`
23
- - Or drop `<script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>` into an `index.html` on any static host.
24
- - ✍️ **2-Way In-Browser Editor & Live HMR**: Press `Ctrl+E` / `⌘E` to edit documents in a split-view editor modal with live keystroke rendering, instant disk save, zero-page-reload WebSocket HMR, and staged preview support (`--preview`).
25
- - ⚡ **Dynamic Remote GitHub / GitLab Mode**: Document any GitHub or GitLab repository *live* without hosting markdown files statically! Changes pushed to your repo dynamically update the documentation website immediately.
26
- - 📦 **Compressed Offline Copies**: Generate or download a minified, self-extracting `index.html` containing the complete documentation corpus, custom components, Mermaid renderer, styles, and runtime. Double-click it under `file:///` without a web server.
27
- - 🎨 **Four Complete Theme Families & Favicon Presets**: Atlas, Blueprint, Terminal, and Editorial each redefine surfaces, geometry, typography, spacing, and diagram palettes. Choose from 5 crisp SVG favicon presets with automatic offline inlining.
28
- - 📊 **Interactive Data Tables & Delimited Text Toolbar**: Fenced `csv`, `tsv`, and standard GFM tables automatically render as interactive data tables with column/row descriptors and one-click copy export (Markdown, HTML, CSV).
29
- - 🌐 **Static + SEO Output**: every build prerenders complete static pages per document with canonical URLs, Open Graph, Twitter cards, JSON-LD structured data, `sitemap.xml`, and `robots.txt` — crawlers see everything, no JS required.
30
- - 🤖 **AI-Native Distribution**: auto-generated `llms.txt` / `llms-full.txt` / `SKILL.md` / `okf.json`, plus a built-in MCP server (`docmedown mcp`) so Claude, Cursor, and Windsurf can read and search your docs directly.
31
- - 🔍 **Instant Fuzzy Search**: Keyboard-driven command palette (`⌘K` / `Ctrl+K`) with real-time in-browser indexing.
32
- - 🧩 **Multi-Framework Custom Components (.dmd)**: Author custom components in **native Svelte 5**, **React TSX**, or **Web Elements (Lit)** inside `.dmd/`, plus built-in components (`<Tabs>`, `<CardGrid>`, `<Media>`, `<Badge>`, `<Steps>`).
33
- - 🩺 **Built-in CLI Doctor & Link Validator**: Run `docmedown doctor` and `docmedown validate` for automated environment diagnostics, missing asset detection, ahead-of-time component verification, and deep link/anchor integrity.
34
- - 📊 **Mermaid Diagrams & KaTeX Math**: Theme-aware diagrams with automatic Fit, zoom, 1:1 view, SVG export, expanded review, and offline parity, plus native LaTeX equations.
35
- - 💡 **GitHub-Style Callouts**: Full support for `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, and `[!CAUTION]`.
36
-
37
- ---
38
-
39
- ## 🚀 10-Second Quickstart
40
-
41
- ### Option 1: Using the CLI Tool
42
-
43
- ```bash
44
- # Run at your project root: detects root *.md files (README, CONTRIBUTING, CHANGELOG, etc.)
45
- # and links both root and the ./docs/ folder by default!
46
- npx docmedown
47
- ```
48
-
49
- To configure branding, themes, or remote GitHub repository sources with an interactive terminal wizard:
50
-
51
- ```bash
52
- npx docmedown config
53
- ```
54
-
55
- ### Option 2: Pure Web Script (Zero CLI Required)
56
-
57
- Create an `index.html` inside your docs folder:
58
-
59
- ```html
60
- <!DOCTYPE html>
61
- <html lang="en">
62
- <head>
63
- <meta charset="UTF-8" />
64
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
65
- <title>My Docs</title>
66
- </head>
67
- <body>
68
- <div id="dmd-app"></div>
69
- <script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>
70
- </body>
71
- </html>
72
- ```
73
-
74
- Place your `README.md` alongside `index.html`, and you're done!
75
-
76
- ---
77
-
78
- ## 📁 Unified Root & `./docs/` Architecture
79
-
80
- Real-world repositories rarely store all documentation exclusively inside `./docs/`. Almost every project maintains essential Markdown files directly at root:
81
- - `README.md` (Project overview and introduction)
82
- - `CONTRIBUTING.md` (Contribution guidelines)
83
- - `CHANGELOG.md` (Release history and changelog)
84
- - `ROADMAP.md` (Project roadmap)
85
- - `SECURITY.md` (Vulnerability disclosure policies)
86
-
87
- Instead of forcing you to choose between root files or a `./docs/` folder, or duplicating files, **DocMeDown unifies both by default**.
88
-
89
- ### How It Works
90
-
91
- When you run `docmedown`, `docmedown serve`, or `docmedown build`:
92
-
93
- 1. **Auto-Detection**: Scans the current directory (`process.cwd()`) for all root `*.md` files.
94
- 2. **Unified Linking**: Transparently links each root Markdown file directly into `./docs/` (using relative symlinks, falling back to hard links or file copies if permissions require).
95
- 3. **Flat Top-Level Navigation**: Because root files are linked directly at `./docs/`, they sit at the root of the documentation tree alongside your `./docs/` pages (e.g. Overview, Contributing, Getting Started) **without creating an artificial `./docs/` category subdivision**.
96
- 4. **No Template Clobbering**: If a `README.md` already exists at your project root, `docmedown init` preserves it as the primary documentation Overview rather than generating a generic placeholder template.
97
- 5. **Bi-Directional Live Sync**:
98
- - The dev server (`docmedown serve`) watches both `./docs/` and root `*.md` files. Edits to root files trigger instantaneous WebSocket HMR in the browser without full page reloads.
99
- - The in-browser 2-Way Editor (`Ctrl+E` / `⌘E`) writes directly back to the target root files.
100
- 6. **Automatic Cleanup**: If a root Markdown file is deleted or renamed, stale links are pruned automatically on the next command run.
101
-
102
- ---
103
-
104
- ## 🔌 Embedding & Lifecycle Integration
105
-
106
- For a host application that controls when documentation mounts, opt out of automatic initialization before loading the script:
107
-
108
- ```html
109
- <script>
110
- window.__DOCMEDOWN_NO_AUTO_INIT__ = true;
111
- </script>
112
- <script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>
113
- ```
114
-
115
- Then mount it into a specific element. `init` resolves to an instance with a `destroy()` method, so single-page applications can cleanly replace the reader when routes change.
116
-
117
- ```html
118
- <div id="project-docs"></div>
119
- <script>
120
- async function showDocs() {
121
- const docs = await window.DocMeDown.init({
122
- el: '#project-docs',
123
- basePath: '/help',
124
- config: {
125
- name: 'Project help',
126
- theme: { family: 'terminal', density: 'compact', defaultMode: 'auto' }
127
- }
128
- });
129
-
130
- // Call docs.destroy() before removing #project-docs from the page.
131
- }
132
-
133
- showDocs();
134
- </script>
135
- ```
136
-
137
- The mount element emits `docmedown:ready` with the instance in `event.detail`, and `docmedown:destroyed` when it is unmounted. As an HTML-only alternative, add `data-docmedown-auto-init="false"` to the DocMeDown `<script>` tag.
138
-
139
- ---
140
-
141
- ## 🌐 Dynamic Remote GitHub / GitLab Mode
142
-
143
- Want to host your documentation on GitHub Pages or Vercel **without** committing your markdown files or setting up complex CI builds?
144
-
145
- Simply create `docs.json`:
146
-
147
- ```json title="docs.json"
148
- {
149
- "name": "Live Project Docs",
150
- "source": {
151
- "type": "github",
152
- "repo": "facebook/react",
153
- "branch": "main",
154
- "docsDir": "docs"
155
- },
156
- "theme": {
157
- "family": "blueprint",
158
- "density": "comfortable",
159
- "defaultMode": "auto"
160
- }
161
- }
162
- ```
163
-
164
- Host only the `index.html` and `docs.json` file. DocMeDown will dynamically discover and pull the markdown content directly from GitHub on demand!
165
-
166
- ---
167
-
168
- ## 📦 Single-File Offline Bundling
169
-
170
- Every standard build produces both your serveable documentation files and a **100% self-contained offline `index.html` file**:
171
-
172
- ```bash
173
- npx docmedown build ./docs
174
- ```
175
-
176
- The serveable manifest and runtime remain in `./docs`. The offline artifact is written to `./docs/.dist/index.html`; dot-prefixed directories are excluded from document discovery. The artifact stores compact JSON and the production runtime in a gzip-compressed, base64-encoded envelope with a minified self-extractor. Open that file directly in a browser (`file:///.../.dist/index.html`) on air-gapped machines, send it via email, or distribute it with offline desktop applications. Use `--no-single-file` to skip the offline artifact, or `--out-dir <path>` to place it elsewhere.
177
-
178
- Serveable DocMeDown sites also include a **Download** action in the navbar. It reads the already-loaded documentation corpus and current runtime, compresses them locally with the browser's native gzip stream, and downloads the same self-contained format without requesting `.dist/index.html`. In a downloaded or CLI-built offline copy, the control is greyed out as **Offline copy** because the page is already portable.
179
-
180
- `docmedown serve ./docs` and `docmedown dev ./docs` also run this standard build at startup. While the server is running, Markdown and `docs.json` changes are debounced, then rebuild the serveable artifacts and `./docs/.dist/index.html` before the browser reloads.
181
-
182
- To rebuild both outputs without starting a preview server, use watch mode:
183
-
184
- ```bash
185
- npx docmedown build ./docs --watch
186
- ```
187
-
188
- Within this repository, the equivalent command is `npm run build:docs:watch`.
189
-
190
- ---
191
-
192
- ## 🚢 GitHub Pages Hosting
193
-
194
- The repository includes `.github/workflows/pages.yml`, which builds the production runtime and generated documentation assets before publishing `./docs/` through GitHub Pages. This is required because `_docs.js`, `_manifest.json`, and `docmedown.web.js` are generated files and intentionally ignored by Git.
195
-
196
- To enable it for a repository fork or project site:
197
-
198
- 1. Push the workflow to the `main` branch.
199
- 2. In **Settings → Pages**, set the source to **GitHub Actions**.
200
- 3. Push documentation or runtime changes; the workflow runs `npm ci`, `npm run build`, and `npm run build:docs`, then uploads the complete `docs/` directory.
201
-
202
- The generated entrypoint uses same-directory relative URLs (`./_docs.js` and `./docmedown.web.js`), so it works at both a custom domain and a project URL such as `/repository-name/`. The Pages workflow verifies those generated files before upload and includes `.nojekyll` for direct static-file compatibility. Hash routing keeps document navigation client-side without requiring server rewrites.
203
-
204
- ---
205
-
206
- ## 🧩 Custom Components (.dmd)
207
-
208
- DocMeDown provides a **Universal Component Compatibility Layer**. You can author custom widgets in **native Svelte 5**, **React with TypeScript (TSX)**, or standard **Web Elements (Lit)** with zero build setup:
209
-
210
- ### 1. Svelte 5 Component (`.dmd/CounterWidget.svelte`)
211
-
212
- ```svelte title=".dmd/CounterWidget.svelte"
213
- <script>
214
- let { title = "Interactive Counter" } = $props();
215
- let count = $state(0);
216
- </script>
217
-
218
- <div class="counter-widget">
219
- <strong>{title}: {count}</strong>
220
- <button onclick={() => count++}>+1</button>
221
- </div>
222
- ```
223
-
224
- ### 2. React TSX Component (`.dmd/ReactMetricCard.tsx`)
225
-
226
- ```tsx title=".dmd/ReactMetricCard.tsx"
227
- import React, { useState } from "react";
228
-
229
- export default function ReactMetricCard({ label = "Query Rate", initial = 100 }) {
230
- const [val, setVal] = useState(initial);
231
- return (
232
- <div className="metric-panel">
233
- <strong>{label}: {val} req/s</strong>
234
- <button onClick={() => setVal(val + 10)}>Boost</button>
235
- </div>
236
- );
237
- }
238
- ```
239
-
240
- Use `<CounterWidget />` or `<ReactMetricCard />` directly inside any Markdown document!
241
-
242
- - **Build-Time AOT Compilation**: Standard React TSX components are compiled Ahead-of-Time into native Svelte 5 custom elements during `docmedown build`, eliminating React runtime overhead.
243
- - **Runtime Bridge Fallback**: Complex React components mount cleanly via `ReactBridge` (`createRoot`), preserving hook fidelity.
244
- - **Offline Parity**: All `.dmd/` components are pre-compiled and embedded in `./docs/.dist/index.html` for 100% self-contained offline functionality.
245
- - **Legacy Compatibility**: Standard `.dmd/components.js` custom element modules remain fully supported.
246
-
247
- ### Ready-to-Use Built-in Markdown Components
248
-
249
- ```html
250
- <!-- Interactive Tabs -->
251
- <Tabs>
252
- <Tab label="npm">npm install docmedown</Tab>
253
- <Tab label="yarn">yarn add docmedown</Tab>
254
- <Tab label="pnpm">pnpm add docmedown</Tab>
255
- </Tabs>
256
-
257
- <!-- Feature Cards -->
258
- <CardGrid cols={2}>
259
- <Card
260
- title="Instant Setup"
261
- description="Zero configuration required."
262
- badge="Fast"
263
- badgeType="success"
264
- />
265
- <Card
266
- title="Complete Theme Families"
267
- description="Atlas, Blueprint, Terminal, and Editorial change the entire reading system."
268
- badge="New"
269
- badgeType="new"
270
- />
271
- </CardGrid>
272
-
273
- <!-- Step-by-Step Guide -->
274
- <Steps>
275
- <Step title="Install" step={1}>Install via npm or use standalone script.</Step>
276
- <Step title="Write Markdown" step={2}>Add your .md guides and tutorials.</Step>
277
- <Step title="Publish" step={3}>Deploy to any static web host or GitHub Pages.</Step>
278
- </Steps>
279
- ```
280
-
281
- ---
282
-
283
- ## ⚙️ Configuration Reference (`docs.json`)
284
-
285
- DocMeDown validates configuration from `docs.json`, `dmd.json`, inline `#dmd-config` JSON, and embedded manifests before applying defaults. Add the published JSON Schema reference for editor completion and immediate feedback:
286
-
287
- ```json
288
- {
289
- "$schema": "https://raw.githubusercontent.com/gabrielmsilva00/docmedown/main/schemas/docs.schema.json",
290
- "name": "My Documentation",
291
- "tagline": "The simplest Markdown documenter yet",
292
- "version": "1.0.0",
293
- "rootDoc": "README.md",
294
- "theme": {
295
- "family": "atlas",
296
- "density": "comfortable",
297
- "defaultMode": "auto",
298
- "codeTheme": "github"
299
- },
300
- "nav": [
301
- { "label": "Overview", "href": "#/README" },
302
- { "label": "Getting Started", "href": "#/getting-started" },
303
- { "label": "Guides", "href": "#/guides/custom-components" }
304
- ],
305
- "socials": [
306
- { "type": "github", "url": "https://github.com/my-org/my-repo" }
307
- ],
308
- "search": {
309
- "enabled": true,
310
- "placeholder": "Search docs..."
311
- },
312
- "footer": {
313
- "copyright": "© 2026 My Organization. All rights reserved.",
314
- "showBuiltWith": true
315
- }
316
- }
317
- ```
318
-
319
- Unknown keys are rejected. The npm package also ships the portable schema at `schemas/docs.schema.json`; TypeScript consumers can import `docConfigSchema` and `parseDocConfig` from `docmedown`. See the full [configuration reference](./docs/configuration.md) for every field and validation rule.
320
-
321
- ### Theme Families
322
-
323
- | Family | Best suited for | Visual system |
324
- | :--- | :--- | :--- |
325
- | `atlas` *(default)* | General product and API documentation | Neutral mineral canvas, cobalt actions, balanced spacing |
326
- | `blueprint` | Architecture and technical specifications | Squared geometry, drafting rules, coral signals |
327
- | `terminal` | CLI, operations, and infrastructure manuals | Dark-first console character, compact rhythm, monospace utilities |
328
- | `editorial` | Guides, handbooks, and long-form reading | Warm paper surfaces, serif display type, generous article rhythm |
329
-
330
- Use the **Appearance** menu to switch family, color mode, and reading density at runtime. Set `accentColor` and `accentColorDark` only when a brand color must override the family default. Legacy accent-only presets remain accepted temporarily for migration but should not be used in new configurations.
331
-
332
- ---
333
-
334
- ## 🛠️ CLI Command Reference
335
-
336
- | Command | Description |
337
- | :--- | :--- |
338
- | `docmedown [dir]` | Quickstart setup if empty (shows preview tree & prompts for confirmation), or starts local preview server |
339
- | `docmedown init [dir]` | Interactive setup wizard to configure and scaffold docs (shows preview tree & prompts for confirmation) |
340
- | `docmedown serve [dir]` (or `dev`) | Starts local live-reloading dev server with WebSocket HMR and in-browser editor (`Ctrl+E`) |
341
- | `docmedown serve [dir] --preview` | Starts dev server in staged `.preview/` overlay mode |
342
- | `docmedown build [dir]` | Builds serveable files, prerendered static pages with SEO metadata, AI context files (`llms.txt`, `llms-full.txt`, `SKILL.md`, `okf.json`), and `./<dir>/.dist/index.html` for offline use |
343
- | `docmedown build [dir] --no-single-file` | Builds serveable files only |
344
- | `docmedown build [dir] --no-static` | Skips static page prerendering and SEO/AI context files |
345
- | `docmedown mcp [dir]` | Serves documentation as an MCP (Model Context Protocol) server over stdio or SSE |
346
- | `docmedown validate [dir]` | Validates Markdown links, anchors, frontmatter, and `docs.json` schema |
347
- | `docmedown doctor [dir]` | Diagnoses Node environment, missing assets, and `.dmd` component compilation |
348
- | `docmedown config [path]` | Launches interactive TUI configuration wizard |
349
-
350
- ---
351
-
352
- ## 🚀 Maintainer release command
353
-
354
- Maintainers publish a prepared version with one command:
355
-
356
- ```bash
357
- npm run deploy
358
- ```
359
-
360
- It validates the release, pushes `main` and `v<version>` to GitHub, publishes to npm, and verifies the npm registry. Run `npm run deploy:dry-run` to validate without changing GitHub or npm.
361
-
362
- ## 🧹 Quality checks & local MCP testing
363
-
364
- DocMeDown uses [Biome](https://biomejs.dev/) for formatting, import organization, and linting, and Zod for runtime configuration validation.
365
-
366
- ```bash
367
- npm run lint # check formatting, imports, and lint rules
368
- npm run lint:fix # apply Biome fixes
369
- npm run format # format maintained source files
370
- npm run typecheck # static type analysis
371
- npm test # full unit test suite
372
- npm run test:mcp # dedicated MCP protocol test suite
373
- npm run dev:mcp # launch local MCP server over stdio
374
- npm run test:mcp:client # test MCP queries interactively from CLI
375
- ```
376
-
377
- `npm run test:release` runs all of these checks plus production, documentation, and package smoke builds.
378
-
379
- ---
380
-
381
- ## 📄 License
382
-
383
- DocMeDown is open-source software licensed under the [Apache License, Version 2.0](LICENSE).
384
-
385
- Copyright © 2026 Gabriel M. P. da Silva and DocMeDown Contributors.
386
-
387
- ### Rationale for Apache License 2.0
388
-
389
- DocMeDown is licensed under the **Apache License, Version 2.0**. While both MIT and Apache 2.0 are permissive open-source licenses granting full freedom to use, modify, distribute, and commercialize the software, Apache 2.0 provides key legal and practical advantages:
390
-
391
- 1. **Explicit Patent License Grant (Section 3)**:
392
- MIT provides a general copyright license but does not explicitly address software patents. Apache 2.0 includes an express, royalty-free, perpetual patent license granted by all contributors to any user, eliminating legal ambiguity and providing total confidence when adopting DocMeDown in enterprise environments.
393
-
394
- 2. **Defensive Patent Retaliation**:
395
- Apache 2.0 contains a mutual termination clause: if an entity files a patent infringement lawsuit against the project or its users claiming the work infringes their patents, any patent licenses granted to that entity under Apache 2.0 are automatically terminated. This prevents predatory patent litigation and protects the community.
396
-
397
- 3. **Trademark Protection (Section 6)**:
398
- Apache 2.0 explicitly clarifies that the license does not grant trademark rights to use the project’s name, logo, or branding without permission, preventing malicious or misleading impersonation of DocMeDown while keeping the code 100% open.
399
-
400
- 4. **Contributor Clarity & Enterprise Adoption**:
401
- Apache 2.0 standardizes intellectual property and contribution guidelines (Sections 4 & 5). It is the recognized standard across modern developer infrastructure (such as Kubernetes, Apache Software Foundation projects, LLVM runtimes, Android, and TypeScript components), ensuring frictionless compliance for corporate legal teams and independent developers alike.
402
-
1
+ # DocMeDown ⚡
2
+ ### *The simplest MarkDown documenter yet.*
3
+
4
+ [![npm version](https://img.shields.io/npm/v/docmedown.svg?style=flat-square&color=6366f1)](https://www.npmjs.com/package/docmedown)
5
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
7
+ [![CI](https://github.com/gabrielmsilva00/docmedown/actions/workflows/ci.yml/badge.svg)](https://github.com/gabrielmsilva00/docmedown/actions/workflows/ci.yml)
8
+
9
+ **DocMeDown** is a zero-friction, ultra-lightweight documentation engine and CLI utility. Similar in visual elegance and features to **Docusaurus** and **VitePress**, but with **10x simpler setup** and zero build baggage.
10
+
11
+ Source code, issues, and releases live at [github.com/gabrielmsilva00/docmedown](https://github.com/gabrielmsilva00/docmedown).
12
+
13
+ Drop a single `index.html` file into any directory of `.md` files, and you have a fast, responsive documentation website with a complete reading interface.
14
+
15
+ ---
16
+
17
+ ## ✨ Features at a Glance
18
+
19
+ ### Release deployment
20
+
21
+ Maintainers run `npm run deploy` from `main`. The command validates the release,
22
+ commits tracked changes, pushes the release, publishes npm, and explicitly requests
23
+ the GitHub Pages workflow (`pages.yml`) on `main`, even when the version is already
24
+ fully published. GitHub CLI (`gh`) must be installed and authenticated with permission
25
+ to run Actions (`gh auth login`); npm authentication is also required. Workflow errors
26
+ abort the command rather than silently skipping Pages. Dispatch acceptance does not
27
+ mean the asynchronous Pages build has finished; inspect `gh run list --workflow pages.yml`.
28
+ Ordinary pushes to `main` still trigger Pages, so a release can also produce a push run;
29
+ the workflow's existing concurrency group serializes/cancels superseded runs.
30
+ `npm run deploy:dry-run` validates the release without dispatching Pages or publishing.
31
+
32
+ ### Native multilingual projects
33
+
34
+ DocMeDown groups translations by filename (`guide.pt-br.md`), not language
35
+ directories. Project creation offers English, Brazilian Portuguese, Spanish,
36
+ French, German and Simplified Chinese, plus manually named language tags.
37
+ Choose the original language separately; missing document translations can fall
38
+ back to that original. The built-in `DMD` navigation and developer guides ship in
39
+ all six languages and use English when a custom language has no translation.
40
+ See [Internationalization](docs/guides/internationalization.md) for configuration,
41
+ export behavior and the current translation-coverage limitations.
42
+
43
+ - 🚀 **Zero-Config Auto-Discovery**: Automatically parses and indexes all `.md` files & subfolders into categories, builds navigation sidebars, and powers instant search out of the box.
44
+ - 📁 **Unified Root & `./docs/` Discovery**: Automatically detects markdown files at your project root (`README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `ROADMAP.md`, etc.) and links both root and `./docs/` together by default without creating an artificial `./docs/` subdivision.
45
+ - 🌐 **Dual Usage: CLI Tool & Web Script**:
46
+ - Run via single-line CLI: `npx docmedown ./docs`
47
+ - Or drop `<script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>` into an `index.html` on any static host.
48
+ - ✍️ **2-Way In-Browser Editor & Live HMR**: Press `Ctrl+E` / `⌘E` to edit documents in a split-view editor modal with live keystroke rendering, instant disk save, zero-page-reload WebSocket HMR, and staged preview support (`--preview`).
49
+ - ⚡ **Dynamic Remote GitHub / GitLab Mode**: Document any GitHub or GitLab repository *live* without hosting markdown files statically! Changes pushed to your repo dynamically update the documentation website immediately.
50
+ - 📦 **Compressed Offline Copies**: Generate or download a minified, self-extracting `index.html` containing the complete documentation corpus, custom components, Mermaid renderer, styles, and runtime. Double-click it under `file:///` without a web server.
51
+ - 🎨 **Six Complete Theme Families & Favicon Presets**: Atlas, Blueprint, Terminal, Editorial, Botanical, and Studio each redefine surfaces, geometry, typography, spacing, and diagram palettes. Choose from 5 crisp SVG favicon presets with automatic offline inlining.
52
+ - 📊 **Interactive Data Tables & Delimited Text Toolbar**: Fenced `csv`, `tsv`, and standard GFM tables automatically render as interactive data tables with column/row descriptors and one-click copy export (Markdown, HTML, CSV).
53
+ - 🌐 **Static + SEO Output**: every build prerenders complete static pages per document with canonical URLs, Open Graph, Twitter cards, JSON-LD structured data, `sitemap.xml`, and `robots.txt` — crawlers see everything, no JS required.
54
+ - 🤖 **AI-Native Distribution**: auto-generated `llms.txt` / `llms-full.txt` / `SKILL.md` / `okf.json`, plus a built-in MCP server (`docmedown mcp`) so Claude, Cursor, and Windsurf can read and search your docs directly.
55
+ - 🔍 **Instant Fuzzy Search**: Keyboard-driven command palette (`⌘K` / `Ctrl+K`) with real-time in-browser indexing.
56
+ - 🧩 **Multi-Framework Custom Components (.dmd)**: Author custom components in **native Svelte 5**, **React TSX**, or **Web Elements (Lit)** inside `.dmd/`, plus built-in components (`<Tabs>`, `<CardGrid>`, `<Media>`, `<Badge>`, `<Steps>`).
57
+ - 🩺 **Built-in CLI Doctor & Link Validator**: Run `docmedown doctor` and `docmedown validate` for automated environment diagnostics, missing asset detection, ahead-of-time component verification, and deep link/anchor integrity.
58
+ - 📊 **Mermaid Diagrams & KaTeX Math**: Theme-aware diagrams with automatic Fit, zoom, 1:1 view, SVG export, expanded review, and offline parity, plus native LaTeX equations.
59
+ - 💡 **GitHub-Style Callouts**: Full support for `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, and `[!CAUTION]`.
60
+
61
+ ---
62
+
63
+ ## 🚀 10-Second Quickstart
64
+
65
+ ### Option 1: Using the CLI Tool
66
+
67
+ ```bash
68
+ # Run at your project root: detects root *.md files (README, CONTRIBUTING, CHANGELOG, etc.)
69
+ # and links both root and the ./docs/ folder by default!
70
+ npx docmedown
71
+ ```
72
+
73
+ To configure branding, themes, or remote GitHub repository sources with an interactive terminal wizard:
74
+
75
+ ```bash
76
+ npx docmedown config
77
+ ```
78
+
79
+ ### Option 2: Pure Web Script (Zero CLI Required)
80
+
81
+ Create an `index.html` inside your docs folder:
82
+
83
+ ```html
84
+ <!DOCTYPE html>
85
+ <html lang="en">
86
+ <head>
87
+ <meta charset="UTF-8" />
88
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
89
+ <title>My Docs</title>
90
+ </head>
91
+ <body>
92
+ <div id="dmd-app"></div>
93
+ <script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>
94
+ </body>
95
+ </html>
96
+ ```
97
+
98
+ Place your `README.md` alongside `index.html`, and you're done!
99
+
100
+ ---
101
+
102
+ ## 📁 Unified Root & `./docs/` Architecture
103
+
104
+ Real-world repositories rarely store all documentation exclusively inside `./docs/`. Almost every project maintains essential Markdown files directly at root:
105
+ - `README.md` (Project overview and introduction)
106
+ - `CONTRIBUTING.md` (Contribution guidelines)
107
+ - `CHANGELOG.md` (Release history and changelog)
108
+ - `ROADMAP.md` (Project roadmap)
109
+ - `SECURITY.md` (Vulnerability disclosure policies)
110
+
111
+ Instead of forcing you to choose between root files or a `./docs/` folder, or duplicating files, **DocMeDown unifies both by default**.
112
+
113
+ ### How It Works
114
+
115
+ When you run `docmedown`, `docmedown serve`, or `docmedown build`:
116
+
117
+ 1. **Auto-Detection**: Scans the current directory (`process.cwd()`) for all root `*.md` files.
118
+ 2. **Unified Linking**: Transparently links each root Markdown file directly into `./docs/` (using relative symlinks, falling back to hard links or file copies if permissions require).
119
+ 3. **Flat Top-Level Navigation**: Because root files are linked directly at `./docs/`, they sit at the root of the documentation tree alongside your `./docs/` pages (e.g. Overview, Contributing, Getting Started) **without creating an artificial `./docs/` category subdivision**.
120
+ 4. **No Template Clobbering**: If a `README.md` already exists at your project root, `docmedown init` preserves it as the primary documentation Overview rather than generating a generic placeholder template.
121
+ 5. **Bi-Directional Live Sync**:
122
+ - The dev server (`docmedown serve`) watches both `./docs/` and root `*.md` files. Edits to root files trigger instantaneous WebSocket HMR in the browser without full page reloads.
123
+ - The in-browser 2-Way Editor (`Ctrl+E` / `⌘E`) writes directly back to the target root files.
124
+ 6. **Automatic Cleanup**: If a root Markdown file is deleted or renamed, stale links are pruned automatically on the next command run.
125
+
126
+ ---
127
+
128
+ ## 🔌 Embedding & Lifecycle Integration
129
+
130
+ For a host application that controls when documentation mounts, opt out of automatic initialization before loading the script:
131
+
132
+ ```html
133
+ <script>
134
+ window.__DOCMEDOWN_NO_AUTO_INIT__ = true;
135
+ </script>
136
+ <script src="https://cdn.jsdelivr.net/npm/docmedown@latest/dist/docmedown.iife.js"></script>
137
+ ```
138
+
139
+ Then mount it into a specific element. `init` resolves to an instance with a `destroy()` method, so single-page applications can cleanly replace the reader when routes change.
140
+
141
+ ```html
142
+ <div id="project-docs"></div>
143
+ <script>
144
+ async function showDocs() {
145
+ const docs = await window.DocMeDown.init({
146
+ el: '#project-docs',
147
+ basePath: '/help',
148
+ config: {
149
+ name: 'Project help',
150
+ theme: { family: 'terminal', density: 'compact', defaultMode: 'auto' }
151
+ }
152
+ });
153
+
154
+ // Call docs.destroy() before removing #project-docs from the page.
155
+ }
156
+
157
+ showDocs();
158
+ </script>
159
+ ```
160
+
161
+ The mount element emits `docmedown:ready` with the instance in `event.detail`, and `docmedown:destroyed` when it is unmounted. As an HTML-only alternative, add `data-docmedown-auto-init="false"` to the DocMeDown `<script>` tag.
162
+
163
+ ---
164
+
165
+ ## 🌐 Dynamic Remote GitHub / GitLab Mode
166
+
167
+ Want to host your documentation on GitHub Pages or Vercel **without** committing your markdown files or setting up complex CI builds?
168
+
169
+ Simply create `docs.json`:
170
+
171
+ ```json title="docs.json"
172
+ {
173
+ "name": "Live Project Docs",
174
+ "source": {
175
+ "type": "github",
176
+ "repo": "facebook/react",
177
+ "branch": "main",
178
+ "docsDir": "docs"
179
+ },
180
+ "theme": {
181
+ "family": "blueprint",
182
+ "density": "comfortable",
183
+ "defaultMode": "auto"
184
+ }
185
+ }
186
+ ```
187
+
188
+ Host only the `index.html` and `docs.json` file. DocMeDown will dynamically discover and pull the markdown content directly from GitHub on demand!
189
+
190
+ ---
191
+
192
+ ## 📦 Single-File Offline Bundling
193
+
194
+ Every standard build produces both your serveable documentation files and a **100% self-contained offline `index.html` file**:
195
+
196
+ ```bash
197
+ npx docmedown build ./docs
198
+ ```
199
+
200
+ The serveable site and runtime live in `./docs/.dmd/` (prerendered pages, `sitemap.xml`, `robots.txt`, per-page SEO head tags included). The `docs/index.html` symlink targets that serveable entrypoint (`.dmd/index.html`) — the ONLY distributable at the docs root — so crawlers and static hosts see the full site; dot-prefixed directories are excluded from document discovery. The offline artifact is written separately to `./docs/.dmd/.singlefile/index.html`. The artifact stores compact JSON and the production runtime in a gzip-compressed, base64-encoded envelope with a minified self-extractor. Open that file directly in a browser (`file:///.../index.html`) on air-gapped machines, send it via email, or distribute it with offline desktop applications. Use `--no-single-file` to skip the offline artifact, or `--out-dir <path>` to place it elsewhere.
201
+
202
+ Serveable DocMeDown sites also include a **Download** action in the navbar. It reads the already-loaded documentation corpus and current runtime, compresses them locally with the browser's native gzip stream, and downloads the same self-contained format without requesting `.dmd/.singlefile/index.html`. In a downloaded or CLI-built offline copy, the control is greyed out as **Offline copy** because the page is already portable.
203
+
204
+ `docmedown serve ./docs` and `docmedown dev ./docs` also run this standard build at startup. While the server is running, Markdown and `.dmd/.config/docs.json` changes are debounced, then rebuild the serveable artifacts and `./docs/.dmd/.singlefile/index.html` before the browser reloads.
205
+
206
+ To rebuild both outputs without starting a preview server, use watch mode:
207
+
208
+ ```bash
209
+ npx docmedown build ./docs --watch
210
+ ```
211
+
212
+ Within this repository, the equivalent command is `npm run build:docs:watch`.
213
+
214
+ ---
215
+
216
+ ## 🚢 GitHub Pages Hosting
217
+
218
+ The repository includes `.github/workflows/pages.yml`, which builds the production runtime and generated documentation assets before publishing `./docs/.dmd/` through GitHub Pages. This is required because `_docs.js`, `_manifest.json`, and `docmedown.web.js` are generated files and intentionally ignored by Git.
219
+
220
+ To enable it for a repository fork or project site:
221
+
222
+ 1. Push the workflow to the `main` branch.
223
+ 2. In **Settings → Pages**, set the source to **GitHub Actions**.
224
+ 3. Push documentation or runtime changes; the workflow runs `npm ci`, `npm run build`, and `npm run build:docs`, then uploads the hidden `docs/.dmd/` workspace (the `docs/index.html` symlink targets that same serveable entrypoint, so local `/docs/` serving matches Pages).
225
+
226
+ The generated entrypoint uses same-directory relative URLs (`./_docs.js` and `./docmedown.web.js`), so it works at both a custom domain and a project URL such as `/repository-name/`. The Pages workflow verifies those generated files before upload and includes `.nojekyll` for direct static-file compatibility. Hash routing keeps document navigation client-side without requiring server rewrites.
227
+
228
+ ---
229
+
230
+ ## 🧩 Custom Components (`.dmd/.components/`)
231
+
232
+ DocMeDown provides a **Universal Component Compatibility Layer**. You can author custom widgets in **native Svelte 5**, **React with TypeScript (TSX)**, or standard **Web Elements (Lit)** with zero build setup:
233
+
234
+ ### 1. Svelte 5 Component (`.dmd/.components/CounterWidget.svelte`)
235
+
236
+ ```svelte title=".dmd/.components/CounterWidget.svelte"
237
+ <script>
238
+ let { title = "Interactive Counter" } = $props();
239
+ let count = $state(0);
240
+ </script>
241
+
242
+ <div class="counter-widget">
243
+ <strong>{title}: {count}</strong>
244
+ <button onclick={() => count++}>+1</button>
245
+ </div>
246
+ ```
247
+
248
+ ### 2. React TSX Component (`.dmd/.components/ReactMetricCard.tsx`)
249
+
250
+ ```tsx title=".dmd/.components/ReactMetricCard.tsx"
251
+ import React, { useState } from "react";
252
+
253
+ export default function ReactMetricCard({ label = "Query Rate", initial = 100 }) {
254
+ const [val, setVal] = useState(initial);
255
+ return (
256
+ <div className="metric-panel">
257
+ <strong>{label}: {val} req/s</strong>
258
+ <button onClick={() => setVal(val + 10)}>Boost</button>
259
+ </div>
260
+ );
261
+ }
262
+ ```
263
+
264
+ Use `<CounterWidget />` or `<ReactMetricCard />` directly inside any Markdown document!
265
+
266
+ - **Build-Time AOT Compilation**: Standard React TSX components are compiled Ahead-of-Time into native Svelte 5 custom elements during `docmedown build`, eliminating React runtime overhead.
267
+ - **Runtime Bridge Fallback**: Complex React components mount cleanly via `ReactBridge` (`createRoot`), preserving hook fidelity.
268
+ - **Offline Parity**: All `.dmd/.components/` components are pre-compiled and embedded in `./docs/.dmd/.singlefile/index.html` for 100% self-contained offline functionality (the root `docs/index.html` symlink instead serves the SEO site).
269
+ - **Legacy Compatibility**: Bare `.dmd/` components and standard `.dmd/components.js` custom element modules remain fully supported as a deprecated fallback.
270
+
271
+ ### Ready-to-Use Built-in Markdown Components
272
+
273
+ ```html
274
+ <!-- Interactive Tabs -->
275
+ <Tabs>
276
+ <Tab label="npm">npm install docmedown</Tab>
277
+ <Tab label="yarn">yarn add docmedown</Tab>
278
+ <Tab label="pnpm">pnpm add docmedown</Tab>
279
+ </Tabs>
280
+
281
+ <!-- Feature Cards -->
282
+ <CardGrid cols={2}>
283
+ <Card
284
+ title="Instant Setup"
285
+ description="Zero configuration required."
286
+ badge="Fast"
287
+ badgeType="success"
288
+ />
289
+ <Card
290
+ title="Complete Theme Families"
291
+ description="Atlas, Blueprint, Terminal, Editorial, Botanical, and Studio change the entire reading system."
292
+ badge="New"
293
+ badgeType="new"
294
+ />
295
+ </CardGrid>
296
+
297
+ <!-- Step-by-Step Guide -->
298
+ <Steps>
299
+ <Step title="Install" step={1}>Install via npm or use standalone script.</Step>
300
+ <Step title="Write Markdown" step={2}>Add your .md guides and tutorials.</Step>
301
+ <Step title="Publish" step={3}>Deploy to any static web host or GitHub Pages.</Step>
302
+ </Steps>
303
+ ```
304
+
305
+ ---
306
+
307
+ ## ⚙️ Configuration Reference (`docs.json`)
308
+
309
+ DocMeDown validates configuration from `docs.json`, `dmd.json`, inline `#dmd-config` JSON, and embedded manifests before applying defaults. Add the published JSON Schema reference for editor completion and immediate feedback:
310
+
311
+ ```json
312
+ {
313
+ "$schema": "https://raw.githubusercontent.com/gabrielmsilva00/docmedown/main/schemas/docs.schema.json",
314
+ "name": "My Documentation",
315
+ "tagline": "The simplest Markdown documenter yet",
316
+ "version": "1.0.0",
317
+ "rootDoc": "README.md",
318
+ "theme": {
319
+ "family": "atlas",
320
+ "density": "comfortable",
321
+ "defaultMode": "auto",
322
+ "codeTheme": "github"
323
+ },
324
+ "nav": [
325
+ { "label": "Overview", "href": "#/README" },
326
+ { "label": "Getting Started", "href": "#/getting-started" },
327
+ { "label": "Guides", "href": "#/guides/custom-components" }
328
+ ],
329
+ "socials": [
330
+ { "type": "github", "url": "https://github.com/my-org/my-repo" }
331
+ ],
332
+ "search": {
333
+ "enabled": true,
334
+ "placeholder": "Search docs..."
335
+ },
336
+ "footer": {
337
+ "copyright": "© 2026 My Organization. All rights reserved.",
338
+ "showBuiltWith": true
339
+ }
340
+ }
341
+ ```
342
+
343
+ Unknown keys are rejected. The npm package also ships the portable schema at `schemas/docs.schema.json`; TypeScript consumers can import `docConfigSchema` and `parseDocConfig` from `docmedown`. See the full [configuration reference](./docs/configuration.md) for every field and validation rule.
344
+
345
+ ### Theme Families
346
+
347
+ | Family | Best suited for | Visual system |
348
+ | :--- | :--- | :--- |
349
+ | `atlas` *(default)* | General product and API documentation | Neutral mineral canvas, cobalt actions, balanced spacing |
350
+ | `blueprint` | Architecture and technical specifications | Squared geometry, drafting rules, coral signals |
351
+ | `terminal` | CLI, operations, and infrastructure manuals | Dark-first console character, compact rhythm, monospace utilities |
352
+ | `editorial` | Guides, handbooks, and long-form reading | Warm paper surfaces, serif display type, generous article rhythm |
353
+ | `botanical` | Research notes, learning resources, and field guides | Sage book-cloth surfaces, fern accents, serif headings, leaf-shaped notes |
354
+ | `studio` | Design systems and creative product documentation | Lilac stock, violet ink, bold display type, offset-print frames |
355
+
356
+ Use the **Appearance** menu to switch family, color mode, and reading density at runtime. Set `accentColor` and `accentColorDark` only when a brand color must override the family default. Legacy accent-only presets remain accepted temporarily for migration but should not be used in new configurations.
357
+
358
+ ---
359
+
360
+ ## 🛠️ CLI Command Reference
361
+
362
+ | Command | Description |
363
+ | :--- | :--- |
364
+ | `docmedown [dir]` | Quickstart setup if empty (shows preview tree & prompts for confirmation), or starts local preview server |
365
+ | `docmedown init [dir]` | Interactive setup wizard to configure and scaffold docs (shows preview tree & prompts for confirmation) |
366
+ | `docmedown serve [dir]` (or `dev`) | Starts local live-reloading dev server with WebSocket HMR and in-browser editor (`Ctrl+E`) |
367
+ | `docmedown serve [dir] --preview` | Starts dev server in staged `.preview/` overlay mode |
368
+ | `docmedown build [dir]` | Builds serveable files, prerendered static pages with SEO metadata, AI context files (`llms.txt`, `llms-full.txt`, `SKILL.md`, `okf.json`), and `./<dir>/.dist/index.html` for offline use |
369
+ | `docmedown build [dir] --no-single-file` | Builds serveable files only |
370
+ | `docmedown build [dir] --no-static` | Skips static page prerendering and SEO/AI context files |
371
+ | `docmedown mcp [dir]` | Serves documentation as an MCP (Model Context Protocol) server over stdio or SSE |
372
+ | `docmedown validate [dir]` | Validates Markdown links, anchors, frontmatter, and `docs.json` schema |
373
+ | `docmedown doctor [dir]` | Diagnoses Node environment, missing assets, and `.dmd` component compilation |
374
+ | `docmedown config [path]` | Launches interactive TUI configuration wizard |
375
+
376
+ ---
377
+
378
+ ## 🚀 Maintainer release command
379
+
380
+ Maintainers publish a prepared version with one command:
381
+
382
+ ```bash
383
+ npm run deploy
384
+ ```
385
+
386
+ It validates the release, pushes `main` and `v<version>` to GitHub, publishes to npm, and verifies the npm registry. Run `npm run deploy:dry-run` to validate without changing GitHub or npm.
387
+
388
+ ## 🧹 Quality checks & local MCP testing
389
+
390
+ DocMeDown uses [Biome](https://biomejs.dev/) for formatting, import organization, and linting, and Zod for runtime configuration validation.
391
+
392
+ ```bash
393
+ npm run lint # check formatting, imports, and lint rules
394
+ npm run lint:fix # apply Biome fixes
395
+ npm run format # format maintained source files
396
+ npm run typecheck # static type analysis
397
+ npm test # full unit test suite
398
+ npm run test:mcp # dedicated MCP protocol test suite
399
+ npm run dev:mcp # launch local MCP server over stdio
400
+ npm run test:mcp:client # test MCP queries interactively from CLI
401
+ ```
402
+
403
+ `npm run test:release` runs all of these checks plus production, documentation, and package smoke builds.
404
+
405
+ ---
406
+
407
+ ## 📄 License
408
+
409
+ DocMeDown is open-source software licensed under the [Apache License, Version 2.0](LICENSE).
410
+
411
+ Copyright © 2026 Gabriel M. P. da Silva and DocMeDown Contributors.
412
+
413
+ ### Rationale for Apache License 2.0
414
+
415
+ DocMeDown is licensed under the **Apache License, Version 2.0**. While both MIT and Apache 2.0 are permissive open-source licenses granting full freedom to use, modify, distribute, and commercialize the software, Apache 2.0 provides key legal and practical advantages:
416
+
417
+ 1. **Explicit Patent License Grant (Section 3)**:
418
+ MIT provides a general copyright license but does not explicitly address software patents. Apache 2.0 includes an express, royalty-free, perpetual patent license granted by all contributors to any user, eliminating legal ambiguity and providing total confidence when adopting DocMeDown in enterprise environments.
419
+
420
+ 2. **Defensive Patent Retaliation**:
421
+ Apache 2.0 contains a mutual termination clause: if an entity files a patent infringement lawsuit against the project or its users claiming the work infringes their patents, any patent licenses granted to that entity under Apache 2.0 are automatically terminated. This prevents predatory patent litigation and protects the community.
422
+
423
+ 3. **Trademark Protection (Section 6)**:
424
+ Apache 2.0 explicitly clarifies that the license does not grant trademark rights to use the project’s name, logo, or branding without permission, preventing malicious or misleading impersonation of DocMeDown while keeping the code 100% open.
425
+
426
+ 4. **Contributor Clarity & Enterprise Adoption**:
427
+ Apache 2.0 standardizes intellectual property and contribution guidelines (Sections 4 & 5). It is the recognized standard across modern developer infrastructure (such as Kubernetes, Apache Software Foundation projects, LLVM runtimes, Android, and TypeScript components), ensuring frictionless compliance for corporate legal teams and independent developers alike.
428
+