md-review 0.0.5 → 0.0.6

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
  # md-review
2
2
 
3
- English | [日本語](./README-ja.md)
3
+ English | [日本語](./README-ja.md) | [简体中文](./README-zh.md)
4
4
 
5
5
  ![screenshot](./assets/screenshot.png)
6
6
 
@@ -12,6 +12,9 @@ Comments can be copied and used as feedback for AI agents.
12
12
  - Display Markdown in its original format
13
13
  - Add comments to specific lines
14
14
  - Select files from tree view
15
+ - Dark mode support (follows system preferences)
16
+ - Resizable and collapsible sidebars
17
+ - Click line numbers in comments to jump to corresponding content
15
18
 
16
19
  ## Install
17
20
 
@@ -22,17 +25,25 @@ npm install -g md-review
22
25
  ## Usage
23
26
 
24
27
  ```sh
25
- md-review README.md
28
+ md-review [options] # Browse all markdown files in current directory
29
+ md-review <file> [options] # Preview a specific markdown file
26
30
  ```
27
31
 
28
32
  ### Options
29
33
 
30
34
  ```sh
31
- -p, --port <port> Vite server port (default: 6060)
32
- --api-port <port> API server port (default: 3030)
35
+ -p, --port <port> Server port (default: 3030)
33
36
  --no-open Do not open browser automatically
34
- -h, --help Show help
35
- -v, --version Show version
37
+ -h, --help Show this help message
38
+ -v, --version Show version number
39
+ ```
40
+
41
+ ### Examples
42
+
43
+ ```sh
44
+ md-review # Browse all markdown files in current directory
45
+ md-review README.md # Preview README.md
46
+ md-review docs/guide.md --port 8080
36
47
  ```
37
48
 
38
49
  ## 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:${port}`);
133
+ openModule.default(`http://localhost:${actualPort}`);
127
134
  }
128
135
  }
129
136
  });