mind-hiro 0.2.0 → 0.2.1

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
@@ -1,6 +1,6 @@
1
1
  # Mind Hiro
2
2
 
3
- Generate a **self-contained, interactive mind-map website** from a folder of Markdown files — one HTML file, works offline, no server needed.
3
+ Generate a **self-contained, interactive mind-map site** from a folder of Markdown files — single HTML file, works offline, no server needed.
4
4
 
5
5
  Powered by [markmap](https://markmap.js.org/) + [Vite](https://vitejs.dev/).
6
6
 
@@ -8,31 +8,38 @@ Powered by [markmap](https://markmap.js.org/) + [Vite](https://vitejs.dev/).
8
8
 
9
9
  ## Features
10
10
 
11
- - **Three-panel UI** — sidebar file list, Markdown editor, live mind-map renderer
11
+ - **Three-panel UI** — file sidebar, Markdown editor, live mind-map renderer
12
+ - **Command palette** — `⌘K` to search files and run actions (toggle theme, share, …)
12
13
  - **Live editing** — edit Markdown in the browser; mind map updates in real time
13
- - **Search** — filter files by filename or content
14
- - **Share links** — compress current Markdown into a URL hash and copy to clipboard
15
- - **Dark / light mode** — persisted to `localStorage`
16
- - **Local edits saved** — browser remembers your edits per file across sessions
14
+ - **Full-text search** — filter files by filename or content
15
+ - **Share links** — compress the current file into a URL hash and copy to clipboard
16
+ - **Dark / light mode** — toggled via toolbar or command palette, persisted to `localStorage`
17
+ - **Local edits saved** — browser remembers edits per file across sessions
17
18
  - **Fully self-contained** — all JS/CSS inlined; no CDN, works offline
18
19
 
19
20
  ---
20
21
 
21
- ## CLI
22
+ ## Quick start
22
23
 
23
24
  ```bash
24
- npx mind-hiro generate <dir> [options]
25
+ npx mind-hiro generate ./docs -o site.html
25
26
  ```
26
27
 
28
+ Open `site.html` in any browser — no server needed.
29
+
30
+ ---
31
+
32
+ ## CLI
33
+
27
34
  ```
35
+ mind-hiro generate <dir> [options]
36
+
28
37
  Options:
29
- -o, --output <file> Output HTML file (default: mind-hiro.html)
38
+ -o, --output <file> Output HTML file (default: mind-hiro.html)
30
39
  -r, --recursive Scan subdirectories recursively
31
40
  -h, --help Show help
32
41
  ```
33
42
 
34
- ### Examples
35
-
36
43
  ```bash
37
44
  # Generate from a docs folder
38
45
  npx mind-hiro generate ./docs -o site.html
@@ -41,11 +48,7 @@ npx mind-hiro generate ./docs -o site.html
41
48
  npx mind-hiro generate ./notes -r -o notes.html
42
49
  ```
43
50
 
44
- Then open `site.html` in any browser — no server needed.
45
-
46
- ---
47
-
48
- ## Install globally
51
+ ### Install globally
49
52
 
50
53
  ```bash
51
54
  npm install -g mind-hiro
@@ -58,26 +61,26 @@ mind-hiro generate ./docs -o site.html
58
61
 
59
62
  ```ts
60
63
  import { generate } from 'mind-hiro'
64
+ import { writeFileSync } from 'fs'
61
65
 
62
66
  const html = generate([
63
67
  { name: 'Architecture', content: '# Architecture\n## Frontend\n## Backend' },
64
68
  { name: 'Roadmap', content: '# Roadmap\n## Q1\n## Q2' },
65
69
  ])
66
70
 
67
- import { writeFileSync } from 'fs'
68
71
  writeFileSync('output.html', html)
69
72
  ```
70
73
 
71
74
  ### `generate(files): string`
72
75
 
73
- | Parameter | Type | Description |
74
- |---|---|---|
75
- | `files` | `MindMapFile[]` | Array of `{ name: string, content: string }` objects |
76
- | returns | `string` | Self-contained HTML string |
76
+ | Parameter | Type | Description |
77
+ |-----------|-----------------|------------------------------------------------|
78
+ | `files` | `MindMapFile[]` | Array of `{ name: string, content: string }` objects |
79
+ | returns | `string` | Self-contained HTML string |
77
80
 
78
81
  ```ts
79
82
  interface MindMapFile {
80
- name: string // Shown in the sidebar (filename without extension)
83
+ name: string // Shown in the sidebar
81
84
  content: string // Raw Markdown content
82
85
  }
83
86
  ```
@@ -87,14 +90,27 @@ interface MindMapFile {
87
90
  ## Development
88
91
 
89
92
  ```bash
90
- git clone https://github.com/your-username/mind-hiro
93
+ git clone https://github.com/minhonglolz/mind-hiro
91
94
  cd mind-hiro
92
95
  npm install
93
96
 
94
- npm run dev # Start Vite dev server
95
- npm run build # Build app + CLI
97
+ npm run dev # Vite dev server (hot reload)
98
+ npm run build # Build app template + CLI
99
+ npm run type-check # TypeScript check without emitting
96
100
  ```
97
101
 
102
+ ### Project structure
103
+
104
+ ```
105
+ app/ Vite app — the embedded viewer UI (TS + Tailwind)
106
+ src/ CLI + programmatic API (Node.js)
107
+ shared/ Types shared between app and src
108
+ index.html Dev entry point
109
+ ```
110
+
111
+ `npm run build:app` bundles `app/` into `template/index.html` (the inlined shell).
112
+ `npm run build:lib` compiles `src/` into `dist-lib/` (the CLI + API).
113
+
98
114
  ---
99
115
 
100
116
  ## License
File without changes
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mind-hiro",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Generate a self-contained interactive mind-map website from Markdown files",
5
5
  "type": "module",
6
6
  "main": "./dist-lib/src/index.js",
7
7
  "bin": {
8
- "mind-hiro": "./dist-lib/src/cli.js"
8
+ "mind-hiro": "dist-lib/src/cli.js"
9
9
  },
10
10
  "exports": {
11
11
  ".": {