md-annotator 0.5.2 → 0.5.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 +44 -57
- package/client/dist/index.html +220 -220
- package/client/src/utils/export.js +244 -0
- package/client/src/utils/parser.js +245 -0
- package/client/src/utils/storage.js +44 -0
- package/client/src/utils/textStats.js +8 -0
- package/index.js +12 -3
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -32,39 +32,29 @@
|
|
|
32
32
|
- **Update Notifications** -- Banner when a new GitHub release is available
|
|
33
33
|
- **Heartbeat Detection** -- Graceful shutdown when the browser tab is closed
|
|
34
34
|
- **IDE Integration** -- Annotate the currently open file in VSCode, Cursor, or JetBrains without arguments
|
|
35
|
+
- **Iterative Review** -- AI agent applies your feedback and re-opens the annotator for another review round until you approve
|
|
35
36
|
|
|
36
|
-
## Prerequisites
|
|
37
|
+
## 📋 Prerequisites
|
|
37
38
|
|
|
38
39
|
- **Node.js** 22+ and **npm**
|
|
39
40
|
- A modern **browser** (opens automatically)
|
|
40
41
|
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
*md-annotator* is a Claude Code plugin. After installation the slash command `/annotate:md` is available in any Claude Code session.
|
|
42
|
+
## 🔗 Integrations
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
*md-annotator* supports the following integrations:
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# Add the marketplace
|
|
52
|
-
claude plugin marketplace add konradmichalik/md-annotator
|
|
46
|
+
- [**Claude Code**](#-claude-code-plugin) -- Plugin with `/annotate:md` slash command
|
|
47
|
+
- [**OpenCode**](#-opencode-plugin) -- Plugin with `annotate_markdown` tool and `/annotate:md` command
|
|
48
|
+
- [**Standalone CLI**](#-standalone-cli) -- Use directly from the terminal without an AI agent
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
claude plugin install annotate@md-annotator --scope user
|
|
56
|
-
```
|
|
50
|
+
## 🔌 Claude Code Plugin
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
*md-annotator* is a Claude Code plugin. After installation the slash command `/annotate:md` is available in any Claude Code session.
|
|
59
53
|
|
|
60
|
-
###
|
|
54
|
+
### 📦 Installation & Update
|
|
61
55
|
|
|
62
56
|
```bash
|
|
63
|
-
|
|
64
|
-
npm update -g md-annotator
|
|
65
|
-
|
|
66
|
-
# Update the marketplace cache and plugin
|
|
67
|
-
claude plugin marketplace update md-annotator && claude plugin update annotate@md-annotator
|
|
57
|
+
curl -fsSL https://konradmichalik.github.io/md-annotator/install.sh | bash
|
|
68
58
|
```
|
|
69
59
|
|
|
70
60
|
### 🚀 Usage
|
|
@@ -82,43 +72,43 @@ Or, with IDE integration (VSCode/Cursor/JetBrains), just run without arguments t
|
|
|
82
72
|
/annotate:md
|
|
83
73
|
```
|
|
84
74
|
|
|
85
|
-
This opens the file in your browser. You can then:
|
|
86
|
-
|
|
87
|
-
- **Select text** to see the annotation toolbar
|
|
88
|
-
- **Delete** -- marks text as struck-through (red)
|
|
89
|
-
- **Comment** -- highlights text (yellow) and adds a comment
|
|
90
|
-
- **Insert** -- place the cursor to add new text at that position
|
|
91
|
-
- **Global Comment** -- add general feedback via the "+" button in the annotation panel
|
|
92
|
-
- **Annotate images & diagrams** -- click on images or Mermaid diagrams to comment or delete them
|
|
93
|
-
- **View annotations** in the sidebar panel on the right
|
|
94
|
-
- **Export** annotations as Markdown or JSON
|
|
95
|
-
- **Approve** or **Submit Feedback** when done
|
|
96
|
-
|
|
97
75
|
## 🔷 OpenCode Plugin
|
|
98
76
|
|
|
99
77
|
*md-annotator* is also available as an OpenCode plugin.
|
|
100
78
|
|
|
101
|
-
### 📦 Installation
|
|
79
|
+
### 📦 Installation & Update
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
curl -fsSL https://konradmichalik.github.io/md-annotator/install.sh | bash
|
|
83
|
+
```
|
|
102
84
|
|
|
103
|
-
|
|
85
|
+
Then add to your `opencode.json`:
|
|
104
86
|
|
|
105
87
|
```json
|
|
106
88
|
{
|
|
107
|
-
"
|
|
89
|
+
"plugin": ["@md-annotator/opencode@latest"]
|
|
108
90
|
}
|
|
109
91
|
```
|
|
110
92
|
|
|
93
|
+
> [!NOTE]
|
|
94
|
+
> See [OpenCode documentation](https://opencode.ai/docs/plugins) for more details.
|
|
95
|
+
|
|
111
96
|
### 🚀 Usage
|
|
112
97
|
|
|
113
|
-
|
|
98
|
+
Use the `/annotate:md` command in the chat:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
/annotate:md README.md
|
|
102
|
+
/annotate:md docs/api.md docs/guide.md
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The agent can also use the `annotate_markdown` tool directly:
|
|
114
106
|
|
|
115
107
|
```
|
|
116
108
|
annotate_markdown({ filePath: "/path/to/file.md" })
|
|
117
109
|
annotate_markdown({ filePaths: ["/path/to/a.md", "/path/to/b.md"] })
|
|
118
110
|
```
|
|
119
111
|
|
|
120
|
-
Or use the `/annotate:md` command in the chat.
|
|
121
|
-
|
|
122
112
|
## 💻 Standalone CLI
|
|
123
113
|
|
|
124
114
|
*md-annotator* also works as a standalone CLI tool without an AI coding agent:
|
|
@@ -130,9 +120,6 @@ md-annotator README.md
|
|
|
130
120
|
# Multiple files (opens with tab bar)
|
|
131
121
|
md-annotator docs/api.md docs/guide.md
|
|
132
122
|
|
|
133
|
-
# Or link globally first
|
|
134
|
-
npm link
|
|
135
|
-
|
|
136
123
|
# Show help
|
|
137
124
|
md-annotator --help
|
|
138
125
|
```
|
|
@@ -146,25 +133,25 @@ The server starts on an available port (default 3000) and opens your browser aut
|
|
|
146
133
|
| `MD_ANNOTATOR_PORT` | Override the server port (default: 3000) |
|
|
147
134
|
| `MD_ANNOTATOR_BROWSER` | Custom browser application |
|
|
148
135
|
|
|
149
|
-
##
|
|
136
|
+
## 📝 How It Works
|
|
150
137
|
|
|
151
|
-
|
|
152
|
-
# Clone and build
|
|
153
|
-
git clone https://github.com/konradmichalik/md-annotator.git
|
|
154
|
-
cd md-annotator
|
|
155
|
-
npm install && npm run build
|
|
138
|
+
Once a file is opened in the browser, you can:
|
|
156
139
|
|
|
157
|
-
|
|
158
|
-
|
|
140
|
+
- **Select text** to see the annotation toolbar
|
|
141
|
+
- **Delete** -- marks text as struck-through (red)
|
|
142
|
+
- **Comment** -- highlights text (yellow) and adds a comment
|
|
143
|
+
- **Insert** -- place the cursor to add new text at that position
|
|
144
|
+
- **Global Comment** -- add general feedback via the "+" button in the annotation panel
|
|
145
|
+
- **Annotate images & diagrams** -- click on images or Mermaid diagrams to comment or delete them
|
|
146
|
+
- **View annotations** in the sidebar panel on the right
|
|
147
|
+
- **Export** annotations as Markdown or JSON
|
|
148
|
+
- **Approve** or **Submit Feedback** when done
|
|
159
149
|
|
|
160
|
-
|
|
161
|
-
npm run dev:client # Vite dev server with HMR (client only)
|
|
162
|
-
npm run build # Production build (single-file HTML)
|
|
163
|
-
npm run dev # CLI with --watch
|
|
150
|
+
When used with an AI agent (Claude Code or OpenCode), submitting feedback triggers the agent to apply your changes to the file. The agent then re-opens the annotator for another review round, so you can verify the edits and provide further feedback if needed. This review loop continues until you approve the result.
|
|
164
151
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
152
|
+
## 🛠️ Development
|
|
153
|
+
|
|
154
|
+
See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for setup, build commands, and local plugin testing.
|
|
168
155
|
|
|
169
156
|
## 📄 License
|
|
170
157
|
|