docrev 0.6.7 → 0.7.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/CHANGELOG.md +32 -0
- package/README.md +230 -95
- package/bin/rev.js +113 -5059
- package/completions/rev.ps1 +210 -0
- package/lib/annotations.js +41 -11
- package/lib/build.js +95 -8
- package/lib/commands/build.js +708 -0
- package/lib/commands/citations.js +497 -0
- package/lib/commands/comments.js +922 -0
- package/lib/commands/context.js +165 -0
- package/lib/commands/core.js +295 -0
- package/lib/commands/doi.js +419 -0
- package/lib/commands/history.js +307 -0
- package/lib/commands/index.js +56 -0
- package/lib/commands/init.js +247 -0
- package/lib/commands/response.js +374 -0
- package/lib/commands/sections.js +862 -0
- package/lib/commands/utilities.js +2272 -0
- package/lib/config.js +19 -0
- package/lib/crossref.js +17 -2
- package/lib/doi.js +279 -43
- package/lib/errors.js +338 -0
- package/lib/format.js +53 -6
- package/lib/git.js +92 -0
- package/lib/import.js +41 -9
- package/lib/journals.js +28 -4
- package/lib/orcid.js +149 -0
- package/lib/pdf-comments.js +217 -0
- package/lib/pdf-import.js +446 -0
- package/lib/plugins.js +285 -0
- package/lib/review.js +109 -0
- package/lib/schema.js +368 -0
- package/lib/sections.js +3 -8
- package/lib/templates.js +218 -0
- package/lib/tui.js +437 -0
- package/lib/undo.js +236 -0
- package/lib/wordcomments.js +86 -39
- package/package.json +5 -3
- package/skill/REFERENCE.md +76 -18
- package/skill/SKILL.md +122 -27
- package/.rev-dictionary +0 -4
package/lib/wordcomments.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Word comment injection with reply threading
|
|
3
3
|
*
|
|
4
4
|
* Flow:
|
|
5
|
-
* 1. prepareMarkdownWithMarkers() - Parse comments, detect
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
5
|
+
* 1. prepareMarkdownWithMarkers() - Parse comments, detect reply relationships
|
|
6
|
+
* - First comment in a cluster = parent (gets markers: ⟦CMS:n⟧anchor⟦CME:n⟧)
|
|
7
|
+
* - Subsequent adjacent comments = replies (no markers, attach to parent)
|
|
8
8
|
* 2. Pandoc converts to DOCX
|
|
9
9
|
* 3. injectCommentsAtMarkers() - Insert comment ranges for parents only
|
|
10
10
|
* - Replies go in comments.xml with parent reference in commentsExtended.xml
|
|
@@ -71,50 +71,41 @@ export function prepareMarkdownWithMarkers(markdown) {
|
|
|
71
71
|
return { markedMarkdown: markdown, comments: [] };
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
// Detect reply relationships
|
|
75
|
-
//
|
|
76
|
-
|
|
74
|
+
// Detect reply relationships based on adjacency
|
|
75
|
+
// First comment in a cluster = parent, all subsequent = replies to that parent
|
|
76
|
+
// Comments are "adjacent" if there's minimal text between them (< 10 chars)
|
|
77
|
+
const ADJACENT_THRESHOLD = 10;
|
|
77
78
|
const comments = [];
|
|
78
|
-
let
|
|
79
|
+
let clusterParentIdx = -1; // Index of first comment in current cluster
|
|
79
80
|
let lastCommentEnd = -1;
|
|
80
81
|
|
|
81
82
|
for (let i = 0; i < rawMatches.length; i++) {
|
|
82
83
|
const m = rawMatches[i];
|
|
83
|
-
const isGuy = m.author === 'Guy Colling';
|
|
84
|
-
const isGilles = m.author === 'Gilles Colling';
|
|
85
84
|
|
|
86
85
|
// Check if this comment is adjacent to the previous one
|
|
87
86
|
const gap = lastCommentEnd >= 0 ? m.start - lastCommentEnd : Infinity;
|
|
88
87
|
const isAdjacent = gap < ADJACENT_THRESHOLD;
|
|
89
88
|
|
|
90
|
-
// Reset
|
|
89
|
+
// Reset cluster if there's a gap (comments not in same cluster)
|
|
91
90
|
if (!isAdjacent) {
|
|
92
|
-
|
|
91
|
+
clusterParentIdx = -1;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
if (
|
|
94
|
+
if (clusterParentIdx === -1) {
|
|
95
|
+
// First comment in cluster = parent (regardless of author)
|
|
96
96
|
comments.push({
|
|
97
97
|
...m,
|
|
98
98
|
isReply: false,
|
|
99
99
|
parentIdx: null,
|
|
100
100
|
commentIdx: comments.length
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
} else if (isGilles && lastGuyIdx >= 0 && isAdjacent) {
|
|
104
|
-
// Gilles immediately following Guy (same cluster) = reply
|
|
105
|
-
comments.push({
|
|
106
|
-
...m,
|
|
107
|
-
isReply: true,
|
|
108
|
-
parentIdx: lastGuyIdx,
|
|
109
|
-
commentIdx: comments.length
|
|
110
|
-
});
|
|
111
|
-
// Don't reset lastGuyIdx - multiple replies could follow
|
|
102
|
+
clusterParentIdx = comments.length - 1;
|
|
112
103
|
} else {
|
|
113
|
-
//
|
|
104
|
+
// Subsequent comment in cluster = reply to first comment
|
|
114
105
|
comments.push({
|
|
115
106
|
...m,
|
|
116
|
-
isReply:
|
|
117
|
-
parentIdx:
|
|
107
|
+
isReply: true,
|
|
108
|
+
parentIdx: clusterParentIdx,
|
|
118
109
|
commentIdx: comments.length
|
|
119
110
|
});
|
|
120
111
|
}
|
|
@@ -122,6 +113,21 @@ export function prepareMarkdownWithMarkers(markdown) {
|
|
|
122
113
|
lastCommentEnd = m.end;
|
|
123
114
|
}
|
|
124
115
|
|
|
116
|
+
// Propagate anchors from replies to parents
|
|
117
|
+
// If a reply has an anchor but its parent doesn't, move the anchor to the parent
|
|
118
|
+
// Track flags for special handling during marker generation
|
|
119
|
+
for (const c of comments) {
|
|
120
|
+
if (c.isReply && c.anchor && c.parentIdx !== null) {
|
|
121
|
+
const parent = comments[c.parentIdx];
|
|
122
|
+
if (!parent.anchor) {
|
|
123
|
+
parent.anchor = c.anchor;
|
|
124
|
+
parent.anchorFromReply = true; // Parent's anchor came from a reply (markers placed by reply)
|
|
125
|
+
c.placesParentMarkers = true; // This reply should place the parent's markers
|
|
126
|
+
c.anchor = null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
// Build marked markdown - only parent comments get markers
|
|
126
132
|
// Process from end to start to preserve positions
|
|
127
133
|
let markedMarkdown = markdown;
|
|
@@ -131,12 +137,43 @@ export function prepareMarkdownWithMarkers(markdown) {
|
|
|
131
137
|
|
|
132
138
|
if (c.isReply) {
|
|
133
139
|
// Reply: remove from document entirely (will be in comments.xml only)
|
|
134
|
-
|
|
140
|
+
// Also consume leading whitespace to avoid double spaces
|
|
141
|
+
let removeStart = c.start;
|
|
142
|
+
while (removeStart > 0 && /\s/.test(markedMarkdown[removeStart - 1])) {
|
|
143
|
+
removeStart--;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// If this reply places parent's markers (anchor was propagated)
|
|
147
|
+
if (c.placesParentMarkers && c.parentIdx !== null) {
|
|
148
|
+
// Extract anchor text from the original match
|
|
149
|
+
const anchorMatch = c.fullMatch.match(/\[([^\]]+)\]\{\.mark\}$/);
|
|
150
|
+
if (anchorMatch) {
|
|
151
|
+
const anchorText = anchorMatch[1];
|
|
152
|
+
// Output markers with PARENT's index around the anchor text
|
|
153
|
+
const parentIdx = c.parentIdx;
|
|
154
|
+
const replacement = `${MARKER_START_PREFIX}${parentIdx}${MARKER_SUFFIX}${anchorText}${MARKER_END_PREFIX}${parentIdx}${MARKER_SUFFIX}`;
|
|
155
|
+
markedMarkdown = markedMarkdown.slice(0, removeStart) + replacement + markedMarkdown.slice(c.end);
|
|
156
|
+
} else {
|
|
157
|
+
markedMarkdown = markedMarkdown.slice(0, removeStart) + markedMarkdown.slice(c.end);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
markedMarkdown = markedMarkdown.slice(0, removeStart) + markedMarkdown.slice(c.end);
|
|
161
|
+
}
|
|
135
162
|
} else {
|
|
136
|
-
// Parent comment
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
163
|
+
// Parent comment
|
|
164
|
+
if (c.anchorFromReply) {
|
|
165
|
+
// Anchor markers are placed by the reply, just remove this comment
|
|
166
|
+
let removeStart = c.start;
|
|
167
|
+
while (removeStart > 0 && /\s/.test(markedMarkdown[removeStart - 1])) {
|
|
168
|
+
removeStart--;
|
|
169
|
+
}
|
|
170
|
+
markedMarkdown = markedMarkdown.slice(0, removeStart) + markedMarkdown.slice(c.end);
|
|
171
|
+
} else {
|
|
172
|
+
// Normal case: replace with markers
|
|
173
|
+
const anchor = c.anchor || '';
|
|
174
|
+
const replacement = `${MARKER_START_PREFIX}${i}${MARKER_SUFFIX}${anchor}${MARKER_END_PREFIX}${i}${MARKER_SUFFIX}`;
|
|
175
|
+
markedMarkdown = markedMarkdown.slice(0, c.start) + replacement + markedMarkdown.slice(c.end);
|
|
176
|
+
}
|
|
140
177
|
}
|
|
141
178
|
}
|
|
142
179
|
|
|
@@ -239,11 +276,7 @@ function createCommentsExtensibleXml(comments) {
|
|
|
239
276
|
return xml;
|
|
240
277
|
}
|
|
241
278
|
|
|
242
|
-
//
|
|
243
|
-
const AUTHOR_USER_IDS = {
|
|
244
|
-
'Guy Colling': '9ff4d97962428673',
|
|
245
|
-
'Gilles Colling': '46e930a4c4b85dfd',
|
|
246
|
-
};
|
|
279
|
+
// Generate deterministic user IDs for authors (no hardcoded personal data)
|
|
247
280
|
|
|
248
281
|
function createPeopleXml(comments) {
|
|
249
282
|
// Extract unique authors
|
|
@@ -265,7 +298,7 @@ function createPeopleXml(comments) {
|
|
|
265
298
|
xml += 'mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh">';
|
|
266
299
|
|
|
267
300
|
for (const author of authors) {
|
|
268
|
-
const userId =
|
|
301
|
+
const userId = generateUserId(author);
|
|
269
302
|
xml += `<w15:person w15:author="${escapeXml(author)}">`;
|
|
270
303
|
xml += `<w15:presenceInfo w15:providerId="Windows Live" w15:userId="${userId}"/>`;
|
|
271
304
|
xml += `</w15:person>`;
|
|
@@ -366,9 +399,23 @@ export async function injectCommentsAtMarkers(docxPath, comments, outputPath) {
|
|
|
366
399
|
const endInText = fullText.indexOf(endMarker);
|
|
367
400
|
if (startInText === -1 || endInText === -1) continue;
|
|
368
401
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
402
|
+
let textBefore = fullText.slice(0, startInText);
|
|
403
|
+
let anchorText = fullText.slice(startInText + startMarker.length, endInText);
|
|
404
|
+
let textAfter = fullText.slice(endInText + endMarker.length);
|
|
405
|
+
|
|
406
|
+
// When anchor is empty, use the first word from textAfter as fallback
|
|
407
|
+
if (!anchorText && textAfter) {
|
|
408
|
+
const wordMatch = textAfter.match(/^\s*(\S+)/);
|
|
409
|
+
if (wordMatch) {
|
|
410
|
+
anchorText = wordMatch[1];
|
|
411
|
+
textAfter = textAfter.slice(wordMatch[0].length);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// When anchor is still empty, normalize double spaces to single space
|
|
416
|
+
if (!anchorText && textBefore.endsWith(' ') && textAfter.startsWith(' ')) {
|
|
417
|
+
textAfter = textAfter.slice(1); // Remove leading space from textAfter
|
|
418
|
+
}
|
|
372
419
|
|
|
373
420
|
// Build replacement
|
|
374
421
|
let replacement = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docrev",
|
|
3
|
-
"version": "0.6
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Academic paper revision workflow: Word ↔ Markdown round-trips, DOI validation, reviewer comments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -114,11 +114,13 @@
|
|
|
114
114
|
"dictionary-en": "^4.0.0",
|
|
115
115
|
"dictionary-en-gb": "^3.0.0",
|
|
116
116
|
"diff": "^8.0.2",
|
|
117
|
-
"js-yaml": "^4.1.1",
|
|
118
117
|
"mammoth": "^1.6.0",
|
|
119
118
|
"mathml-to-latex": "^1.5.0",
|
|
120
119
|
"nspell": "^2.1.5",
|
|
121
|
-
"
|
|
120
|
+
"pdf-lib": "^1.17.1",
|
|
121
|
+
"pdfjs-dist": "^5.4.530",
|
|
122
|
+
"xml2js": "^0.6.2",
|
|
123
|
+
"yaml": "^2.8.2"
|
|
122
124
|
},
|
|
123
125
|
"devDependencies": {
|
|
124
126
|
"c8": "^10.1.2"
|
package/skill/REFERENCE.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# docrev Command Reference
|
|
2
2
|
|
|
3
|
+
## Project Creation
|
|
4
|
+
|
|
5
|
+
### rev new
|
|
6
|
+
Create a new document project.
|
|
7
|
+
```bash
|
|
8
|
+
rev new my-document # Creates my-document/ with section files
|
|
9
|
+
rev new my-document --template apa
|
|
10
|
+
```
|
|
11
|
+
|
|
3
12
|
## Document Import/Export
|
|
4
13
|
|
|
5
14
|
### rev import
|
|
6
15
|
Import a Word document with track changes and comments.
|
|
7
16
|
```bash
|
|
8
|
-
rev import
|
|
9
|
-
rev import
|
|
17
|
+
rev import manuscript.docx
|
|
18
|
+
rev import manuscript.docx --output ./project
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### rev sync
|
|
22
|
+
Sync feedback from a reviewed Word document into existing markdown sections.
|
|
23
|
+
```bash
|
|
24
|
+
rev sync reviewed.docx # Updates markdown with track changes/comments
|
|
25
|
+
rev sync # Auto-detect most recent .docx
|
|
26
|
+
rev sync reviewed.docx methods # Sync only methods section
|
|
10
27
|
```
|
|
11
28
|
|
|
12
29
|
### rev build
|
|
@@ -16,8 +33,13 @@ rev build # Build PDF and DOCX
|
|
|
16
33
|
rev build pdf # PDF only
|
|
17
34
|
rev build docx # DOCX only
|
|
18
35
|
rev build --toc # Include table of contents
|
|
36
|
+
rev build docx --dual # Clean + annotated versions
|
|
19
37
|
```
|
|
20
38
|
|
|
39
|
+
The `--dual` flag produces:
|
|
40
|
+
- `paper.docx` — clean, for submission
|
|
41
|
+
- `paper_comments.docx` — includes comment threads as Word comments
|
|
42
|
+
|
|
21
43
|
### rev preview
|
|
22
44
|
Build and open document in default app.
|
|
23
45
|
```bash
|
|
@@ -62,9 +84,44 @@ rev resolve methods.md -n 1,2,3 # Multiple comments
|
|
|
62
84
|
```
|
|
63
85
|
|
|
64
86
|
### rev status
|
|
65
|
-
Show annotation counts for a file.
|
|
87
|
+
Show project overview or annotation counts for a file.
|
|
88
|
+
```bash
|
|
89
|
+
rev status # Project overview (words, comments, changes)
|
|
90
|
+
rev status methods.md # Specific file annotations
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### rev next / rev prev
|
|
94
|
+
Navigate pending comments.
|
|
95
|
+
```bash
|
|
96
|
+
rev next # Show next pending comment
|
|
97
|
+
rev next -n 3 # Show 3rd pending comment
|
|
98
|
+
rev prev # Show last pending comment
|
|
99
|
+
rev first methods # First comment in methods section
|
|
100
|
+
rev last # Last comment overall
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### rev todo
|
|
104
|
+
List all pending comments as a checklist.
|
|
105
|
+
```bash
|
|
106
|
+
rev todo # List all pending
|
|
107
|
+
rev todo --by-author # Group by author
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### rev accept / rev reject
|
|
111
|
+
Accept or reject track changes.
|
|
66
112
|
```bash
|
|
67
|
-
rev
|
|
113
|
+
rev accept methods.md # List all changes
|
|
114
|
+
rev accept methods.md -n 1 # Accept change #1
|
|
115
|
+
rev accept methods.md -a # Accept all
|
|
116
|
+
rev reject methods.md -n 2 # Reject change #2
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### rev archive
|
|
120
|
+
Archive reviewer .docx files.
|
|
121
|
+
```bash
|
|
122
|
+
rev archive # Move all .docx to archive/
|
|
123
|
+
rev archive --by Smith # Specify reviewer name
|
|
124
|
+
rev archive --dry-run # Preview without moving
|
|
68
125
|
```
|
|
69
126
|
|
|
70
127
|
### rev strip
|
|
@@ -202,7 +259,7 @@ rev equations list # List all equations
|
|
|
202
259
|
rev equations from-word manuscript.docx # Extract from Word
|
|
203
260
|
```
|
|
204
261
|
|
|
205
|
-
## Direct DOCX Editing
|
|
262
|
+
## Direct DOCX Editing (Layout Workflow)
|
|
206
263
|
|
|
207
264
|
### rev annotate
|
|
208
265
|
Add comments directly to Word document.
|
|
@@ -224,19 +281,6 @@ rev comment paper.docx
|
|
|
224
281
|
|
|
225
282
|
## Project Management
|
|
226
283
|
|
|
227
|
-
### rev init
|
|
228
|
-
Initialize a new paper project.
|
|
229
|
-
```bash
|
|
230
|
-
rev init my-paper
|
|
231
|
-
rev init my-paper --template apa
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### rev sections
|
|
235
|
-
List and manage section files.
|
|
236
|
-
```bash
|
|
237
|
-
rev sections # List all sections
|
|
238
|
-
```
|
|
239
|
-
|
|
240
284
|
### rev clean
|
|
241
285
|
Remove generated files.
|
|
242
286
|
```bash
|
|
@@ -277,3 +321,17 @@ Output shell completions.
|
|
|
277
321
|
eval "$(rev completions bash)" # Bash
|
|
278
322
|
eval "$(rev completions zsh)" # Zsh
|
|
279
323
|
```
|
|
324
|
+
|
|
325
|
+
## AI Skill Installation
|
|
326
|
+
|
|
327
|
+
### rev install-cli-skill
|
|
328
|
+
Install the docrev skill for AI coding assistants.
|
|
329
|
+
```bash
|
|
330
|
+
rev install-cli-skill # Install to ~/.claude/skills/docrev
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### rev uninstall-cli-skill
|
|
334
|
+
Remove the installed skill.
|
|
335
|
+
```bash
|
|
336
|
+
rev uninstall-cli-skill
|
|
337
|
+
```
|
package/skill/SKILL.md
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docrev
|
|
3
|
-
description: "
|
|
3
|
+
description: "Document revision workflow tool (CLI: `rev`). Use when working with Word documents containing reviewer comments, importing track changes to markdown, replying to reviewer comments, building PDF/DOCX outputs, generating response letters, validating citations/DOIs, or any document revision task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# docrev -
|
|
6
|
+
# docrev - Document Revision Tool
|
|
7
7
|
|
|
8
|
-
`rev` is a CLI tool for
|
|
8
|
+
`rev` is a CLI tool for document workflows with Word ↔ Markdown round-trips.
|
|
9
|
+
|
|
10
|
+
Works for any document that goes through Word-based review: scientific papers, contracts, reports, proposals, manuals.
|
|
11
|
+
|
|
12
|
+
## Content and Layout, Separated
|
|
13
|
+
|
|
14
|
+
In Markdown, you focus on content. Write text, add citations with `[@key]`, insert equations with `$...$`, reference figures with `@fig:label`. No fiddling with fonts or styles.
|
|
15
|
+
|
|
16
|
+
Layout is controlled in `rev.yaml`:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
title: "My Document"
|
|
20
|
+
output:
|
|
21
|
+
docx:
|
|
22
|
+
reference-doc: template.docx
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Change the template, rebuild, and every document gets the new formatting.
|
|
9
26
|
|
|
10
27
|
## Core Workflow
|
|
11
28
|
|
|
12
|
-
### 1.
|
|
29
|
+
### 1. Create or import a project
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
rev new my-document # Start from scratch
|
|
33
|
+
rev import manuscript.docx # Start from existing Word doc
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Build and share
|
|
13
37
|
|
|
14
38
|
```bash
|
|
15
|
-
rev
|
|
39
|
+
rev build docx # Generate Word document
|
|
16
40
|
```
|
|
17
41
|
|
|
18
|
-
|
|
42
|
+
Send to reviewers. They add comments and track changes in Word.
|
|
19
43
|
|
|
20
|
-
###
|
|
44
|
+
### 3. Import feedback
|
|
21
45
|
|
|
22
46
|
```bash
|
|
23
|
-
rev
|
|
24
|
-
rev
|
|
47
|
+
rev sync reviewed.docx # Updates markdown with annotations
|
|
48
|
+
rev sync # Auto-detect most recent .docx
|
|
25
49
|
```
|
|
26
50
|
|
|
27
|
-
###
|
|
51
|
+
### 4. View and address comments
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
rev status # Project overview
|
|
55
|
+
rev todo # List all pending comments
|
|
56
|
+
rev next # Show next pending comment
|
|
57
|
+
rev comments methods.md # List all comments with context
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 5. Reply to reviewer comments
|
|
28
61
|
|
|
29
62
|
**Always use the non-interactive reply mode:**
|
|
30
63
|
|
|
@@ -35,25 +68,31 @@ rev reply results.md -n 3 -m "Updated figure to include 95% CI"
|
|
|
35
68
|
|
|
36
69
|
Replies appear as: `{>>Reviewer: Original<<} {>>User: Reply<<}`
|
|
37
70
|
|
|
38
|
-
###
|
|
71
|
+
### 6. Resolve addressed comments
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
rev resolve methods.md -n 1 # Mark comment #1 as resolved
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 7. Rebuild with comment threads
|
|
39
78
|
|
|
40
79
|
```bash
|
|
41
|
-
rev
|
|
80
|
+
rev build docx --dual # Produces clean + annotated versions
|
|
42
81
|
```
|
|
43
82
|
|
|
44
|
-
|
|
83
|
+
- `paper.docx` — clean, for submission
|
|
84
|
+
- `paper_comments.docx` — includes comment threads as Word comments
|
|
85
|
+
|
|
86
|
+
### 8. Archive reviewer files
|
|
45
87
|
|
|
46
88
|
```bash
|
|
47
|
-
rev
|
|
48
|
-
rev build docx # Word only
|
|
49
|
-
rev build pdf # PDF only
|
|
50
|
-
rev build --toc # Include table of contents
|
|
89
|
+
rev archive # Move reviewer files to archive/
|
|
51
90
|
```
|
|
52
91
|
|
|
53
|
-
###
|
|
92
|
+
### 9. Generate response letter
|
|
54
93
|
|
|
55
94
|
```bash
|
|
56
|
-
rev response
|
|
95
|
+
rev response # Generate point-by-point response letter
|
|
57
96
|
```
|
|
58
97
|
|
|
59
98
|
## Annotation Syntax (CriticMarkup)
|
|
@@ -68,8 +107,28 @@ rev response # Generate point-by-point response letter
|
|
|
68
107
|
|
|
69
108
|
| Task | Command |
|
|
70
109
|
|------|---------|
|
|
110
|
+
| Create project | `rev new my-project` |
|
|
111
|
+
| Create LaTeX project | `rev new my-project --template latex` |
|
|
112
|
+
| Import Word doc | `rev import manuscript.docx` |
|
|
113
|
+
| Sync Word feedback | `rev sync reviewed.docx` |
|
|
114
|
+
| Sync PDF comments | `rev sync annotated.pdf` |
|
|
115
|
+
| Extract PDF comments | `rev pdf-comments annotated.pdf` |
|
|
116
|
+
| Extract with highlighted text | `rev pdf-comments file.pdf --with-text` |
|
|
117
|
+
| Append PDF comments | `rev pdf-comments annotated.pdf --append methods.md` |
|
|
118
|
+
| Project status | `rev status` |
|
|
119
|
+
| Next pending | `rev next` |
|
|
120
|
+
| List pending | `rev todo` |
|
|
121
|
+
| Filter by author | `rev comments file.md --author "Reviewer 2"` |
|
|
122
|
+
| Reply to all pending | `rev reply file.md --all -m "Addressed"` |
|
|
123
|
+
| Accept all changes | `rev accept file.md -a` |
|
|
124
|
+
| Build Word | `rev build docx` |
|
|
125
|
+
| Build PDF | `rev build pdf` |
|
|
126
|
+
| Build clean + annotated Word | `rev build docx --dual` |
|
|
127
|
+
| Build clean + annotated PDF | `rev build pdf --dual` |
|
|
128
|
+
| Show contributors | `rev contributors` |
|
|
129
|
+
| Lookup ORCID | `rev orcid 0000-0002-1825-0097` |
|
|
130
|
+
| Archive reviewer files | `rev archive` |
|
|
71
131
|
| Word count per section | `rev word-count` |
|
|
72
|
-
| Word count with limit | `rev word-count --limit 5000` |
|
|
73
132
|
| Project dashboard | `rev stats` |
|
|
74
133
|
| Search all sections | `rev search "query"` |
|
|
75
134
|
| Pre-submission check | `rev check` |
|
|
@@ -78,6 +137,7 @@ rev response # Generate point-by-point response letter
|
|
|
78
137
|
| Check spelling | `rev spelling` |
|
|
79
138
|
| Open PDF preview | `rev preview pdf` |
|
|
80
139
|
| Auto-rebuild on changes | `rev watch` |
|
|
140
|
+
| Check for updates | `rev upgrade --check` |
|
|
81
141
|
|
|
82
142
|
## DOI Management
|
|
83
143
|
|
|
@@ -115,7 +175,7 @@ Available in section files (processed during build):
|
|
|
115
175
|
## Project Structure
|
|
116
176
|
|
|
117
177
|
```
|
|
118
|
-
my-
|
|
178
|
+
my-document/
|
|
119
179
|
├── rev.yaml # Project config
|
|
120
180
|
├── introduction.md # Section files with annotations
|
|
121
181
|
├── methods.md
|
|
@@ -126,17 +186,52 @@ my-paper/
|
|
|
126
186
|
└── paper.docx # Built output
|
|
127
187
|
```
|
|
128
188
|
|
|
189
|
+
## PDF Comment Workflow
|
|
190
|
+
|
|
191
|
+
For reviewers who annotate PDFs instead of Word documents:
|
|
192
|
+
|
|
193
|
+
### 1. Extract comments from PDF
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
rev pdf-comments annotated.pdf # Display all comments
|
|
197
|
+
rev pdf-comments annotated.pdf --by-author # Group by reviewer
|
|
198
|
+
rev pdf-comments annotated.pdf --json # Output as JSON
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 2. Import into markdown
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
rev sync annotated.pdf # Auto-import to sections
|
|
205
|
+
rev pdf-comments annotated.pdf --append methods.md # Append to specific file
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 3. Build PDF with margin notes
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
rev build pdf --dual
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Produces:
|
|
215
|
+
- `paper.pdf` — clean version for submission
|
|
216
|
+
- `paper_comments.pdf` — comments rendered as LaTeX margin notes
|
|
217
|
+
|
|
218
|
+
**Supported PDF Annotations:**
|
|
219
|
+
- Sticky notes, text boxes, highlights, underlines, strikethrough, squiggly
|
|
220
|
+
|
|
129
221
|
## When Helping Users
|
|
130
222
|
|
|
131
|
-
1. **
|
|
132
|
-
2. **
|
|
133
|
-
3. **
|
|
134
|
-
4. **
|
|
135
|
-
5. **
|
|
223
|
+
1. **Setup**: Ensure `rev config user "Name"` is set for replies
|
|
224
|
+
2. **Sync phase**: Run `rev sync` to get feedback (works with both Word and PDF)
|
|
225
|
+
3. **Review phase**: Use `rev todo` and `rev next` to navigate comments, `rev reply` to respond
|
|
226
|
+
4. **Accept phase**: Use `rev accept -a` or `rev review` to handle track changes
|
|
227
|
+
5. **Build phase**: Run `rev build docx --dual` or `rev build pdf --dual` for annotated versions
|
|
228
|
+
6. **Archive phase**: Run `rev archive` to move reviewer files
|
|
229
|
+
7. **Validation phase**: Run `rev check` before submission
|
|
230
|
+
8. **Response letter**: Use `rev response` to generate point-by-point responses
|
|
136
231
|
|
|
137
232
|
## Critical: Ask Questions When Unsure
|
|
138
233
|
|
|
139
|
-
When addressing reviewer comments or editing
|
|
234
|
+
When addressing reviewer comments or editing documents:
|
|
140
235
|
|
|
141
236
|
- **Never guess methods or numbers** - If a comment asks for clarification about methodology, sample sizes, statistical parameters, dates, or any quantitative information, ASK the user rather than inventing values
|
|
142
237
|
- **Placeholders are acceptable** - Use `[???]` or `[TODO: specify X]` when information is missing rather than fabricating data
|
package/.rev-dictionary
DELETED