docmedown 0.9.2 → 0.9.4

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 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,8 +41,9 @@ 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
- # Scaffold a new documentation directory and start preview immediately
45
- npx docmedown ./docs
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
46
47
  ```
47
48
 
48
49
  To configure branding, themes, or remote GitHub repository sources with an interactive terminal wizard:
@@ -74,6 +75,32 @@ Place your `README.md` alongside `index.html`, and you're done!
74
75
 
75
76
  ---
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
+
77
104
  ## 🔌 Embedding & Lifecycle Integration
78
105
 
79
106
  For a host application that controls when documentation mounts, opt out of automatic initialization before loading the script:
@@ -308,8 +335,8 @@ Use the **Appearance** menu to switch family, color mode, and reading density at
308
335
 
309
336
  | Command | Description |
310
337
  | :--- | :--- |
311
- | `docmedown [dir]` | Auto-initializes if empty, or starts local preview server |
312
- | `docmedown init [dir]` | Scaffolds starter docs, `index.html`, `docs.json`, and `.dmd` folder |
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) |
313
340
  | `docmedown serve [dir]` (or `dev`) | Starts local live-reloading dev server with WebSocket HMR and in-browser editor (`Ctrl+E`) |
314
341
  | `docmedown serve [dir] --preview` | Starts dev server in staged `.preview/` overlay mode |
315
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 |