docmedown 0.9.3 → 0.9.5
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.
- package/README.md +30 -6
- package/dist/cli.js +155 -129
- package/dist/docmedown.cjs +64 -64
- package/dist/docmedown.iife.js +264 -264
- package/dist/docmedown.mjs +3337 -3337
- package/dist/docmedown.web.js +69 -69
- package/dist/types/runtime/bridges/dynamic-component.d.ts +1 -9
- package/dist/types/runtime/home.d.ts +2 -4
- package/dist/types/runtime/markdown/callouts.d.ts +0 -12
- package/dist/types/runtime/markdown/highlighter.d.ts +0 -23
- package/dist/types/runtime/markdown/inline-text.d.ts +0 -1
- package/dist/types/runtime/markdown/parser.d.ts +0 -1
- package/dist/types/runtime/markdown/tables.d.ts +2 -3
- package/dist/types/runtime/media.d.ts +0 -3
- package/dist/types/runtime/offline-export.d.ts +2 -2
- package/dist/types/runtime/splash.d.ts +0 -2
- package/dist/types/runtime/svelte-compiler-loader.d.ts +0 -1
- package/dist/types/runtime/svelte-runtime.d.ts +0 -18
- package/dist/types/runtime/svelte-tag.d.ts +0 -1
- package/package.json +1 -1
- package/templates/getting-started.md +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Drop a single `index.html` file into any directory of `.md` files, and you have
|
|
|
17
17
|
## ✨ Features at a Glance
|
|
18
18
|
|
|
19
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.
|
|
20
21
|
- 🌐 **Dual Usage: CLI Tool & Web Script**:
|
|
21
22
|
- Run via single-line CLI: `npx docmedown ./docs`
|
|
22
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.
|
|
@@ -33,7 +34,6 @@ Drop a single `index.html` file into any directory of `.md` files, and you have
|
|
|
33
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.
|
|
34
35
|
- 💡 **GitHub-Style Callouts**: Full support for `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, and `[!CAUTION]`.
|
|
35
36
|
|
|
36
|
-
|
|
37
37
|
---
|
|
38
38
|
|
|
39
39
|
## 🚀 10-Second Quickstart
|
|
@@ -41,13 +41,11 @@ Drop a single `index.html` file into any directory of `.md` files, and you have
|
|
|
41
41
|
### Option 1: Using the CLI Tool
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
# Run at your project root: detects root
|
|
44
|
+
# Run at your project root: detects root *.md files (README, CONTRIBUTING, CHANGELOG, etc.)
|
|
45
45
|
# and links both root and the ./docs/ folder by default!
|
|
46
46
|
npx docmedown
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
> **Automatic Root Markdown Linking**: Real-world projects typically keep `.md` files at their repository root (`README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `ROADMAP.md`). When running `docmedown`, it detects `.md` files at your current directory and links them directly alongside your `./docs/` folder by default. All root and `./docs/` documents appear seamlessly at the top level of your documentation without creating an unnecessary `./docs/` subdivision.
|
|
50
|
-
|
|
51
49
|
To configure branding, themes, or remote GitHub repository sources with an interactive terminal wizard:
|
|
52
50
|
|
|
53
51
|
```bash
|
|
@@ -77,6 +75,32 @@ Place your `README.md` alongside `index.html`, and you're done!
|
|
|
77
75
|
|
|
78
76
|
---
|
|
79
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
|
+
|
|
80
104
|
## 🔌 Embedding & Lifecycle Integration
|
|
81
105
|
|
|
82
106
|
For a host application that controls when documentation mounts, opt out of automatic initialization before loading the script:
|
|
@@ -311,8 +335,8 @@ Use the **Appearance** menu to switch family, color mode, and reading density at
|
|
|
311
335
|
|
|
312
336
|
| Command | Description |
|
|
313
337
|
| :--- | :--- |
|
|
314
|
-
| `docmedown [dir]` |
|
|
315
|
-
| `docmedown init [dir]` |
|
|
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) |
|
|
316
340
|
| `docmedown serve [dir]` (or `dev`) | Starts local live-reloading dev server with WebSocket HMR and in-browser editor (`Ctrl+E`) |
|
|
317
341
|
| `docmedown serve [dir] --preview` | Starts dev server in staged `.preview/` overlay mode |
|
|
318
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 |
|