md-review 0.0.5 → 0.0.7
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 +48 -6
- package/bin/md-review.js +8 -1
- package/dist/assets/index-BGI20afy.js +87 -0
- package/dist/assets/index-DkYISAAZ.css +19 -0
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/server/index.js +89 -5
- package/dist/assets/index-BSdkfsKj.css +0 -10
- package/dist/assets/index-CZ7h92Sm.js +0 -87
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# md-review
|
|
2
2
|
|
|
3
|
-
English | [日本語](./README-ja.md)
|
|
3
|
+
English | [日本語](./README-ja.md) | [简体中文](./README-zh.md)
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -11,7 +11,12 @@ Comments can be copied and used as feedback for AI agents.
|
|
|
11
11
|
|
|
12
12
|
- Display Markdown in its original format
|
|
13
13
|
- Add comments to specific lines
|
|
14
|
+
- Edit existing comments
|
|
14
15
|
- Select files from tree view
|
|
16
|
+
- Dark mode support (follows system preferences)
|
|
17
|
+
- Resizable and collapsible sidebars
|
|
18
|
+
- Click line numbers in comments to jump to corresponding content
|
|
19
|
+
- Hot reload when markdown files change
|
|
15
20
|
|
|
16
21
|
## Install
|
|
17
22
|
|
|
@@ -22,19 +27,56 @@ npm install -g md-review
|
|
|
22
27
|
## Usage
|
|
23
28
|
|
|
24
29
|
```sh
|
|
25
|
-
md-review
|
|
30
|
+
md-review [options] # Browse all markdown files in current directory
|
|
31
|
+
md-review <file> [options] # Preview a specific markdown file
|
|
26
32
|
```
|
|
27
33
|
|
|
28
34
|
### Options
|
|
29
35
|
|
|
30
36
|
```sh
|
|
31
|
-
-p, --port <port>
|
|
32
|
-
--api-port <port> API server port (default: 3030)
|
|
37
|
+
-p, --port <port> Server port (default: 3030)
|
|
33
38
|
--no-open Do not open browser automatically
|
|
34
|
-
-h, --help Show help
|
|
35
|
-
-v, --version Show version
|
|
39
|
+
-h, --help Show this help message
|
|
40
|
+
-v, --version Show version number
|
|
36
41
|
```
|
|
37
42
|
|
|
43
|
+
### Examples
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
md-review # Browse all markdown files in current directory
|
|
47
|
+
md-review README.md # Preview README.md
|
|
48
|
+
md-review docs/guide.md --port 8080
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Comment Management
|
|
52
|
+
|
|
53
|
+
### Adding Comments
|
|
54
|
+
1. Select text in the markdown preview
|
|
55
|
+
2. Click the "Comment" button that appears
|
|
56
|
+
3. Type your comment and press `Cmd/Ctrl+Enter` or click "Submit"
|
|
57
|
+
|
|
58
|
+
### Editing Comments
|
|
59
|
+
1. Click the edit icon (pencil) on any existing comment
|
|
60
|
+
2. Modify the text in the textarea
|
|
61
|
+
3. Press `Cmd/Ctrl+Enter` or click "Save" to save changes
|
|
62
|
+
4. Press `Escape` or click "Cancel" to discard changes
|
|
63
|
+
|
|
64
|
+
### Keyboard Shortcuts
|
|
65
|
+
- `Cmd/Ctrl+Enter` - Submit/Save comment
|
|
66
|
+
- `Escape` - Cancel editing
|
|
67
|
+
- `Cmd+K` - Focus search bar (in directory mode)
|
|
68
|
+
|
|
69
|
+
## Hot Module Replacement
|
|
70
|
+
|
|
71
|
+
md-review automatically watches for changes to markdown files:
|
|
72
|
+
|
|
73
|
+
- When you edit and save a markdown file, the preview updates automatically
|
|
74
|
+
- No manual browser refresh needed
|
|
75
|
+
- Works in both single file and directory browsing modes
|
|
76
|
+
- File watching uses efficient Server-Sent Events (SSE)
|
|
77
|
+
|
|
78
|
+
This makes it ideal for live editing workflows and quick iteration on documentation.
|
|
79
|
+
|
|
38
80
|
## License
|
|
39
81
|
|
|
40
82
|
[MIT](./LICENSE)
|
package/bin/md-review.js
CHANGED
|
@@ -112,18 +112,25 @@ const serverProcess = spawn('node', ['server/index.js'], {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
let serverReady = false;
|
|
115
|
+
let actualPort = port;
|
|
115
116
|
|
|
116
117
|
// Wait for server to be ready before opening browser
|
|
117
118
|
serverProcess.stdout.on('data', async (data) => {
|
|
118
119
|
process.stdout.write(data);
|
|
119
120
|
const output = data.toString();
|
|
120
121
|
|
|
122
|
+
// Extract actual port from "API Server running on http://localhost:XXXX"
|
|
123
|
+
const portMatch = output.match(/API Server running on http:\/\/localhost:(\d+)/);
|
|
124
|
+
if (portMatch) {
|
|
125
|
+
actualPort = parseInt(portMatch[1], 10);
|
|
126
|
+
}
|
|
127
|
+
|
|
121
128
|
if (!serverReady && output.includes(SERVER_READY_MESSAGE)) {
|
|
122
129
|
serverReady = true;
|
|
123
130
|
|
|
124
131
|
if (shouldOpen) {
|
|
125
132
|
const openModule = await import('open');
|
|
126
|
-
openModule.default(`http://localhost:${
|
|
133
|
+
openModule.default(`http://localhost:${actualPort}`);
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
});
|