md-review 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/README.md +24 -204
- package/bin/md-review.js +2 -1
- package/dist/assets/{index-D1IQM189.css → index-BSdkfsKj.css} +1 -1
- package/dist/assets/{index-BIHwAaLg.js → index-DLWqCQoZ.js} +26 -26
- package/dist/index.html +3 -3
- package/package.json +5 -5
- package/server/index.js +34 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ryo Matsukawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,220 +1,40 @@
|
|
|
1
|
-
# md-
|
|
1
|
+
# md-review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [日本語](./README-ja.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+

|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- ✅ GitHub Flavored Markdown (GFM) サポート
|
|
10
|
-
- テーブル
|
|
11
|
-
- タスクリスト
|
|
12
|
-
- 取り消し線
|
|
13
|
-
- 📁 **ファイルツリー表示** - カレントディレクトリ内の全Markdownファイルを一覧表示
|
|
14
|
-
- 🗂️ **2カラムレイアウト** - 左側にツリー、右側にプレビュー
|
|
15
|
-
- ⚡ 高速な起動(Vite)
|
|
16
|
-
- 🚀 軽量なAPIサーバー(Hono)
|
|
17
|
-
- 📦 TypeScript + React 19
|
|
7
|
+
A CLI tool for reviewing Markdown files with inline comments.
|
|
8
|
+
Comments can be copied and used as feedback for AI agents.
|
|
18
9
|
|
|
19
|
-
##
|
|
10
|
+
## Features
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## 使い方
|
|
27
|
-
|
|
28
|
-
md-previewには**2つのモード**があります:
|
|
29
|
-
|
|
30
|
-
### 1. 開発モード(推奨)
|
|
31
|
-
|
|
32
|
-
カレントディレクトリ内の全Markdownファイルをツリー表示し、選択してプレビューできます。
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# APIサーバーを起動
|
|
36
|
-
node server/index.js &
|
|
37
|
-
|
|
38
|
-
# 開発サーバーを起動
|
|
39
|
-
pnpm run dev
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
または、両方同時に起動:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# APIサーバーをバックグラウンドで起動
|
|
46
|
-
node server/index.js &
|
|
47
|
-
|
|
48
|
-
# Viteサーバーを起動(http://localhost:6060 が自動で開きます)
|
|
49
|
-
pnpm run dev
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
ブラウザで `http://localhost:6060` を開くと、以下のようなUIが表示されます:
|
|
53
|
-
- **左側**: ファイルツリー(カレントディレクトリ内の全Markdownファイル:.md、.markdown)
|
|
54
|
-
- **右側**: 選択されたMarkdownファイルのプレビュー
|
|
55
|
-
|
|
56
|
-
### 2. CLI モード
|
|
12
|
+
- Display Markdown in its original format
|
|
13
|
+
- Add comments to specific lines
|
|
14
|
+
- Select files from tree view
|
|
57
15
|
|
|
58
|
-
|
|
16
|
+
## Install
|
|
59
17
|
|
|
60
|
-
```
|
|
61
|
-
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g md-review
|
|
62
20
|
```
|
|
63
21
|
|
|
64
|
-
|
|
22
|
+
## Usage
|
|
65
23
|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
node bin/md-preview.js test-samples/sample.md
|
|
69
|
-
|
|
70
|
-
# 任意のMarkdownファイルをプレビュー
|
|
71
|
-
node bin/md-preview.js ./docs/README.md
|
|
72
|
-
node bin/md-preview.js ~/Documents/notes.md
|
|
24
|
+
```sh
|
|
25
|
+
md-review README.md
|
|
73
26
|
```
|
|
74
27
|
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# ポート番号を指定
|
|
79
|
-
node bin/md-preview.js --port 8080 --api-port 3000 file.md
|
|
80
|
-
|
|
81
|
-
# ブラウザを自動的に開かない
|
|
82
|
-
node bin/md-preview.js --no-open file.md
|
|
83
|
-
|
|
84
|
-
# ヘルプを表示
|
|
85
|
-
node bin/md-preview.js --help
|
|
28
|
+
### Options
|
|
86
29
|
|
|
87
|
-
|
|
88
|
-
|
|
30
|
+
```sh
|
|
31
|
+
-p, --port <port> Vite server port (default: 6060)
|
|
32
|
+
--api-port <port> API server port (default: 3030)
|
|
33
|
+
--no-open Do not open browser automatically
|
|
34
|
+
-h, --help Show help
|
|
35
|
+
-v, --version Show version
|
|
89
36
|
```
|
|
90
37
|
|
|
91
|
-
##
|
|
92
|
-
|
|
93
|
-
| オプション | 短縮形 | デフォルト | 説明 |
|
|
94
|
-
|-----------|--------|-----------|------|
|
|
95
|
-
| `--port` | `-p` | `6060` | Viteサーバーのポート番号 |
|
|
96
|
-
| `--api-port` | - | `3030` | APIサーバーのポート番号 |
|
|
97
|
-
| `--no-open` | - | - | ブラウザを自動的に開かない |
|
|
98
|
-
| `--help` | `-h` | - | ヘルプを表示 |
|
|
99
|
-
| `--version` | `-v` | - | バージョンを表示 |
|
|
100
|
-
|
|
101
|
-
## 起動の流れ
|
|
102
|
-
|
|
103
|
-
1. CLIコマンドを実行すると、以下のサーバーが起動します:
|
|
104
|
-
- **APIサーバー(Hono)**: `http://localhost:3030` - Markdownファイルを読み込むAPI
|
|
105
|
-
- **Viteサーバー**: `http://localhost:6060` - Reactアプリケーション
|
|
106
|
-
|
|
107
|
-
2. 自動的にブラウザで `http://localhost:6060` が開き、Markdownファイルが表示されます
|
|
108
|
-
|
|
109
|
-
3. 終了するには `Ctrl+C` を押してください
|
|
110
|
-
|
|
111
|
-
## 技術スタック
|
|
112
|
-
|
|
113
|
-
### フロントエンド
|
|
114
|
-
- **React** 19 - UIライブラリ
|
|
115
|
-
- **TypeScript** - 型安全な開発
|
|
116
|
-
- **Vite** - 高速な開発サーバー
|
|
117
|
-
- **react-markdown** - Markdownレンダリング
|
|
118
|
-
- **remark-gfm** - GFM記法サポート
|
|
119
|
-
- **rehype-highlight** - シンタックスハイライト
|
|
120
|
-
- **highlight.js** - コードハイライトライブラリ
|
|
121
|
-
|
|
122
|
-
### バックエンド
|
|
123
|
-
- **Hono** - 高速で軽量なWebフレームワーク
|
|
124
|
-
- **@hono/node-server** - Node.js用アダプター
|
|
125
|
-
|
|
126
|
-
### CLI
|
|
127
|
-
- **commander** - コマンドライン引数のパース
|
|
128
|
-
- **chalk** - ターミナル出力の色付け
|
|
129
|
-
- **open** - ブラウザを開く
|
|
130
|
-
|
|
131
|
-
## プロジェクト構成
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
md-preview/
|
|
135
|
-
├── bin/
|
|
136
|
-
│ └── md-preview.js # CLI エントリーポイント
|
|
137
|
-
├── server/
|
|
138
|
-
│ └── index.js # Hono APIサーバー
|
|
139
|
-
├── src/
|
|
140
|
-
│ ├── components/
|
|
141
|
-
│ │ ├── ErrorDisplay.tsx # エラー表示
|
|
142
|
-
│ │ └── MarkdownPreview.tsx # Markdownプレビュー
|
|
143
|
-
│ ├── hooks/
|
|
144
|
-
│ │ └── useMarkdown.ts # Markdown取得フック
|
|
145
|
-
│ ├── styles/
|
|
146
|
-
│ │ └── markdown.css # Markdownスタイル
|
|
147
|
-
│ ├── App.tsx
|
|
148
|
-
│ ├── main.tsx
|
|
149
|
-
│ └── index.css
|
|
150
|
-
├── test-samples/
|
|
151
|
-
│ └── sample.md # テスト用サンプル
|
|
152
|
-
├── index.html
|
|
153
|
-
├── vite.config.ts
|
|
154
|
-
├── tsconfig.json
|
|
155
|
-
└── package.json
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## サポートするMarkdown記法
|
|
159
|
-
|
|
160
|
-
### 基本記法
|
|
161
|
-
- 見出し (h1-h6)
|
|
162
|
-
- 段落
|
|
163
|
-
- 強調 (**太字**, *斜体*)
|
|
164
|
-
- リスト(順序付き/順序なし)
|
|
165
|
-
- インラインコード
|
|
166
|
-
- コードブロック(シンタックスハイライト付き)
|
|
167
|
-
- リンク
|
|
168
|
-
- 引用
|
|
169
|
-
- 水平線
|
|
170
|
-
|
|
171
|
-
### GFM拡張記法
|
|
172
|
-
- テーブル
|
|
173
|
-
- タスクリスト
|
|
174
|
-
- 取り消し線 (~~text~~)
|
|
175
|
-
|
|
176
|
-
## 開発
|
|
177
|
-
|
|
178
|
-
### 開発サーバーの起動
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
# Vite開発サーバーのみ起動
|
|
182
|
-
pnpm run dev
|
|
183
|
-
|
|
184
|
-
# APIサーバーのみ起動
|
|
185
|
-
pnpm run server
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### ビルド
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
pnpm run build
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## トラブルシューティング
|
|
195
|
-
|
|
196
|
-
### ポートが既に使用されている
|
|
197
|
-
|
|
198
|
-
デフォルトのポート(6060, 3030)が既に使用されている場合は、別のポートを指定してください:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
node bin/md-preview.js --port 8080 --api-port 3000 file.md
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### ブラウザが自動的に開かない
|
|
205
|
-
|
|
206
|
-
`--no-open` オプションを付けずに実行してください。または、手動で以下のURLを開いてください:
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
http://localhost:6060
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Markdownが表示されない
|
|
213
|
-
|
|
214
|
-
1. APIサーバーが正常に起動しているか確認してください(`http://localhost:3030/api/health` にアクセス)
|
|
215
|
-
2. ファイルパスが正しいか確認してください
|
|
216
|
-
3. ファイルが読み取り可能か確認してください
|
|
217
|
-
|
|
218
|
-
## ライセンス
|
|
38
|
+
## License
|
|
219
39
|
|
|
220
|
-
MIT
|
|
40
|
+
[MIT](./LICENSE)
|
package/bin/md-review.js
CHANGED
|
@@ -126,10 +126,11 @@ apiProcess.stdout.on('data', (data) => {
|
|
|
126
126
|
|
|
127
127
|
if (!serverReady && output.includes(SERVER_READY_MESSAGE)) {
|
|
128
128
|
serverReady = true;
|
|
129
|
-
console.log('Starting Vite
|
|
129
|
+
console.log('Starting Vite preview server...');
|
|
130
130
|
|
|
131
131
|
viteProcess = spawn('node', [
|
|
132
132
|
'node_modules/vite/bin/vite.js',
|
|
133
|
+
'preview',
|
|
133
134
|
'--port', port,
|
|
134
135
|
...(shouldOpen ? ['--open'] : [])
|
|
135
136
|
], {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.file-tree{height:100%;display:flex;flex-direction:column;background-color:#f6f8fa}.file-tree-header{padding:16px;border-bottom:1px solid #d0d7de;background-color:#fff;display:flex;align-items:center;justify-content:space-between}.file-tree-header-content{flex:1}.file-tree-header h3{margin:0 0 4px;font-size:14px;font-weight:600;color:#24292f}.file-count{font-size:12px;color:#57606a}.sidebar-collapse-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:#57606a;transition:background-color .2s,color .2s;padding:0;flex-shrink:0;margin-left:8px}.sidebar-collapse-button:hover{background-color:#f6f8fa;color:#24292f}.sidebar-collapse-button:active{background-color:#eaeef2}.search-container{padding:12px 16px;border-bottom:1px solid #d0d7de;background-color:#fff}.search-input-wrapper{position:relative;display:flex;align-items:center;background-color:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;padding:6px 8px;transition:border-color .2s,background-color .2s}.search-input-wrapper:focus-within{background-color:#fff;border-color:#0969da;box-shadow:0 0 0 3px #0969da1a}.search-icon{font-size:14px;margin-right:6px;color:#57606a;flex-shrink:0}.search-input{flex:1;border:none;background:transparent;outline:none;font-size:14px;color:#24292f;padding:0;min-width:0}.search-input::placeholder{color:#57606a}.search-clear{background:none;border:none;cursor:pointer;padding:0 4px;color:#57606a;font-size:16px;line-height:1;transition:color .2s;flex-shrink:0}.search-clear:hover{color:#24292f}.search-shortcut{margin-left:8px;padding:2px 6px;background-color:#fff;border:1px solid #d0d7de;border-radius:4px;font-size:11px;color:#57606a;font-family:system-ui,-apple-system,sans-serif;flex-shrink:0}.search-input-wrapper:focus-within .search-shortcut{display:none}.file-tree-content{flex:1;overflow-y:auto;padding:8px 0}.tree-item{display:flex;align-items:center;padding:4px 8px;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none;transition:background-color .1s}.tree-item:hover{background-color:#eaeef2}.tree-item.file{color:#24292f}.tree-item.file.selected{background-color:#ddf4ff;border-left:2px solid #0969da}.tree-item.directory{color:#24292f;font-weight:500}.chevron-icon{margin-right:4px;color:#57606a;flex-shrink:0;transition:transform .2s ease-in-out}.file-icon,.folder-icon{margin-right:6px;font-size:16px;flex-shrink:0}.tree-item.file .file-icon{margin-left:20px}.file-name,.folder-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-tree-content::-webkit-scrollbar{width:8px}.file-tree-content::-webkit-scrollbar-track{background:#f6f8fa}.file-tree-content::-webkit-scrollbar-thumb{background:#d0d7de;border-radius:4px}.file-tree-content::-webkit-scrollbar-thumb:hover{background:#afb8c1}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
1
|
+
*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.file-tree{height:100%;display:flex;flex-direction:column;background-color:#f6f8fa}.file-tree-header{padding:16px;border-bottom:1px solid #d0d7de;background-color:#fff;display:flex;align-items:center;justify-content:space-between}.file-tree-header-content{flex:1}.file-tree-footer{padding:12px 16px;border-top:1px solid #d0d7de;background-color:#fff}.github-link{display:inline-flex;align-items:center;color:#57606a;transition:color .2s}.github-link:hover{color:#24292f}.file-tree-header h3{margin:0 0 4px;font-size:14px;font-weight:600;color:#24292f}.file-count{font-size:12px;color:#57606a}.sidebar-collapse-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:#57606a;transition:background-color .2s,color .2s;padding:0;flex-shrink:0;margin-left:8px}.sidebar-collapse-button:hover{background-color:#f6f8fa;color:#24292f}.sidebar-collapse-button:active{background-color:#eaeef2}.search-container{padding:12px 16px;border-bottom:1px solid #d0d7de;background-color:#fff}.search-input-wrapper{position:relative;display:flex;align-items:center;background-color:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;padding:6px 8px;transition:border-color .2s,background-color .2s}.search-input-wrapper:focus-within{background-color:#fff;border-color:#0969da;box-shadow:0 0 0 3px #0969da1a}.search-icon{font-size:14px;margin-right:6px;color:#57606a;flex-shrink:0}.search-input{flex:1;border:none;background:transparent;outline:none;font-size:14px;color:#24292f;padding:0;min-width:0}.search-input::placeholder{color:#57606a}.search-clear{background:none;border:none;cursor:pointer;padding:0 4px;color:#57606a;font-size:16px;line-height:1;transition:color .2s;flex-shrink:0}.search-clear:hover{color:#24292f}.search-shortcut{margin-left:8px;padding:2px 6px;background-color:#fff;border:1px solid #d0d7de;border-radius:4px;font-size:11px;color:#57606a;font-family:system-ui,-apple-system,sans-serif;flex-shrink:0}.search-input-wrapper:focus-within .search-shortcut{display:none}.file-tree-content{flex:1;overflow-y:auto;padding:8px 0}.tree-item{display:flex;align-items:center;padding:4px 8px;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none;transition:background-color .1s}.tree-item:hover{background-color:#eaeef2}.tree-item.file{color:#24292f}.tree-item.file.selected{background-color:#ddf4ff;border-left:2px solid #0969da}.tree-item.directory{color:#24292f;font-weight:500}.chevron-icon{margin-right:4px;color:#57606a;flex-shrink:0;transition:transform .2s ease-in-out}.file-icon,.folder-icon{margin-right:6px;font-size:16px;flex-shrink:0}.tree-item.file .file-icon{margin-left:20px}.file-name,.folder-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-tree-content::-webkit-scrollbar{width:8px}.file-tree-content::-webkit-scrollbar-track{background:#f6f8fa}.file-tree-content::-webkit-scrollbar-thumb{background:#d0d7de;border-radius:4px}.file-tree-content::-webkit-scrollbar-thumb:hover{background:#afb8c1}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
2
|
Theme: GitHub
|
|
3
3
|
Description: Light theme as seen on github.com
|
|
4
4
|
Author: github.com
|