docrev 0.9.13 → 0.9.15
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/.claude/settings.local.json +9 -9
- package/.gitattributes +1 -1
- package/CHANGELOG.md +149 -149
- package/PLAN-tables-and-postprocess.md +850 -850
- package/README.md +411 -391
- package/bin/rev.js +11 -11
- package/bin/rev.ts +145 -145
- package/completions/rev.bash +127 -127
- package/completions/rev.ps1 +210 -210
- package/completions/rev.zsh +207 -207
- package/dev_notes/stress2/build_adversarial.ts +186 -186
- package/dev_notes/stress2/drift_matcher.ts +62 -62
- package/dev_notes/stress2/probe_anchors.ts +35 -35
- package/dev_notes/stress2/project/discussion.before.md +3 -3
- package/dev_notes/stress2/project/discussion.md +3 -3
- package/dev_notes/stress2/project/methods.before.md +20 -20
- package/dev_notes/stress2/project/methods.md +20 -20
- package/dev_notes/stress2/project/rev.yaml +5 -5
- package/dev_notes/stress2/project/sections.yaml +4 -4
- package/dev_notes/stress2/sections.yaml +5 -5
- package/dev_notes/stress2/trace_placement.ts +50 -50
- package/dev_notes/stresstest_boundaries.ts +27 -27
- package/dev_notes/stresstest_drift_apply.ts +43 -43
- package/dev_notes/stresstest_drift_compare.ts +43 -43
- package/dev_notes/stresstest_drift_v2.ts +54 -54
- package/dev_notes/stresstest_inspect.ts +54 -54
- package/dev_notes/stresstest_pstyle.ts +55 -55
- package/dev_notes/stresstest_section_debug.ts +23 -23
- package/dev_notes/stresstest_split.ts +70 -70
- package/dev_notes/stresstest_trace.ts +19 -19
- package/dev_notes/stresstest_verify_no_overwrite.ts +40 -40
- package/dist/lib/build.d.ts +38 -1
- package/dist/lib/build.d.ts.map +1 -1
- package/dist/lib/build.js +68 -30
- package/dist/lib/build.js.map +1 -1
- package/dist/lib/commands/build.d.ts.map +1 -1
- package/dist/lib/commands/build.js +38 -5
- package/dist/lib/commands/build.js.map +1 -1
- package/dist/lib/commands/utilities.js +164 -164
- package/dist/lib/commands/word-tools.js +8 -8
- package/dist/lib/grammar.js +3 -3
- package/dist/lib/pdf-comments.js +44 -44
- package/dist/lib/plugins.js +57 -57
- package/dist/lib/pptx-themes.js +115 -115
- package/dist/lib/spelling.js +2 -2
- package/dist/lib/templates.js +387 -387
- package/dist/lib/themes.js +51 -51
- package/eslint.config.js +27 -27
- package/lib/anchor-match.ts +276 -276
- package/lib/annotations.ts +644 -644
- package/lib/build.ts +1300 -1251
- package/lib/citations.ts +160 -160
- package/lib/commands/build.ts +833 -801
- package/lib/commands/citations.ts +515 -515
- package/lib/commands/comments.ts +1050 -1050
- package/lib/commands/context.ts +174 -174
- package/lib/commands/core.ts +309 -309
- package/lib/commands/doi.ts +435 -435
- package/lib/commands/file-ops.ts +372 -372
- package/lib/commands/history.ts +320 -320
- package/lib/commands/index.ts +87 -87
- package/lib/commands/init.ts +259 -259
- package/lib/commands/merge-resolve.ts +378 -378
- package/lib/commands/preview.ts +178 -178
- package/lib/commands/project-info.ts +244 -244
- package/lib/commands/quality.ts +517 -517
- package/lib/commands/response.ts +454 -454
- package/lib/commands/section-boundaries.ts +82 -82
- package/lib/commands/sections.ts +451 -451
- package/lib/commands/sync.ts +706 -706
- package/lib/commands/text-ops.ts +449 -449
- package/lib/commands/utilities.ts +448 -448
- package/lib/commands/verify-anchors.ts +272 -272
- package/lib/commands/word-tools.ts +340 -340
- package/lib/comment-realign.ts +517 -517
- package/lib/config.ts +84 -84
- package/lib/crossref.ts +781 -781
- package/lib/csl.ts +191 -191
- package/lib/dependencies.ts +98 -98
- package/lib/diff-engine.ts +465 -465
- package/lib/doi-cache.ts +115 -115
- package/lib/doi.ts +897 -897
- package/lib/equations.ts +506 -506
- package/lib/errors.ts +346 -346
- package/lib/format.ts +541 -541
- package/lib/git.ts +326 -326
- package/lib/grammar.ts +303 -303
- package/lib/image-registry.ts +180 -180
- package/lib/import.ts +911 -911
- package/lib/journals.ts +543 -543
- package/lib/merge.ts +633 -633
- package/lib/orcid.ts +144 -144
- package/lib/pdf-comments.ts +263 -263
- package/lib/pdf-import.ts +524 -524
- package/lib/plugins.ts +362 -362
- package/lib/postprocess.ts +188 -188
- package/lib/pptx-color-filter.lua +37 -37
- package/lib/pptx-template.ts +469 -469
- package/lib/pptx-themes.ts +483 -483
- package/lib/protect-restore.ts +520 -520
- package/lib/rate-limiter.ts +94 -94
- package/lib/response.ts +197 -197
- package/lib/restore-references.ts +240 -240
- package/lib/review.ts +327 -327
- package/lib/schema.ts +417 -417
- package/lib/scientific-words.ts +73 -73
- package/lib/sections.ts +335 -335
- package/lib/slides.ts +756 -756
- package/lib/spelling.ts +334 -334
- package/lib/templates.ts +526 -526
- package/lib/themes.ts +742 -742
- package/lib/trackchanges.ts +247 -247
- package/lib/tui.ts +450 -450
- package/lib/types.ts +550 -550
- package/lib/undo.ts +250 -250
- package/lib/utils.ts +69 -69
- package/lib/variables.ts +179 -179
- package/lib/word-extraction.ts +806 -806
- package/lib/word.ts +643 -643
- package/lib/wordcomments.ts +817 -817
- package/package.json +137 -137
- package/scripts/postbuild.js +28 -28
- package/skill/REFERENCE.md +473 -431
- package/skill/SKILL.md +274 -258
- package/tsconfig.json +26 -26
- package/types/index.d.ts +525 -525
package/README.md
CHANGED
|
@@ -1,391 +1,411 @@
|
|
|
1
|
-
# docrev
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/docrev)
|
|
4
|
-
[](https://www.npmjs.com/package/docrev)
|
|
5
|
-
[](https://nodejs.org)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
[](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
|
|
8
|
-
|
|
9
|
-
A CLI for writing documents in Markdown while collaborating with Word users.
|
|
10
|
-
|
|
11
|
-
You write in Markdown under version control. Your collaborators use Word (or PDF). docrev converts between the two, preserving track changes, comments, equations, and cross-references.
|
|
12
|
-
|
|
13
|
-
## The Problem
|
|
14
|
-
|
|
15
|
-
You've been here before:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
manuscript_v1.docx
|
|
19
|
-
manuscript_v2_john_comments.docx
|
|
20
|
-
manuscript_v2_jane_comments.docx
|
|
21
|
-
manuscript_v3_merged_final.docx
|
|
22
|
-
manuscript_v3_merged_final_REAL.docx
|
|
23
|
-
manuscript_v3_merged_final_REAL_submitted.docx
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Three reviewers send back three Word files. You manually compare changes, copy-paste between documents, lose track of who said what. A week later, you can't remember which version has the figure updates.
|
|
27
|
-
|
|
28
|
-
**docrev fixes this.** You write in plain text. Reviewers use Word. Their feedback flows back into your files automatically. One source of truth, full version history, no more file chaos.
|
|
29
|
-
|
|
30
|
-
## Highlights
|
|
31
|
-
|
|
32
|
-
- **Markdown → Word/PDF** with citations, figures, equations, cross-references
|
|
33
|
-
- **Round-trip sync**: import Word track changes and comments back to Markdown
|
|
34
|
-
- **CLI review workflow**: reply to comments, accept/reject changes from terminal
|
|
35
|
-
- **DOI tools**: validate, lookup, and auto-add references from DOIs
|
|
36
|
-
- **21 journal styles**: Nature, Science, PNAS, and more
|
|
37
|
-
- **Version control friendly**: plain text source, full git history
|
|
38
|
-
|
|
39
|
-
## Install
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npm install -g docrev
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Requires [Node.js](https://nodejs.org) 18+. [Pandoc](https://pandoc.org) is needed for building DOCX/PDF output. [LaTeX](#installing-dependencies) is additionally needed for PDF.
|
|
46
|
-
|
|
47
|
-
## Quick Example
|
|
48
|
-
|
|
49
|
-
Write in Markdown with citations and cross-references:
|
|
50
|
-
|
|
51
|
-
```markdown
|
|
52
|
-
Climate change poses significant challenges [@IPCC2021]. As shown in
|
|
53
|
-
@fig:temperature, global temperatures have risen steadily.
|
|
54
|
-
|
|
55
|
-
{#fig:temperature}
|
|
56
|
-
|
|
57
|
-
The relationship follows $\Delta T = \lambda \cdot \Delta F$ (@eq:forcing).
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Build and share:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
rev build docx # → paper.docx (for collaborators)
|
|
64
|
-
rev build pdf # → paper.pdf (for journals)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
When collaborators return the Word doc with track changes:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
rev sync reviewed.docx # their comments → your markdown
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## How It Works
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
┌─────────────┐ rev build docx ┌─────────────┐
|
|
77
|
-
│ │ ───────────────────────→│ │
|
|
78
|
-
│ Markdown │ │ Word │ → collaborators
|
|
79
|
-
│ (you) │ rev build pdf │ / PDF │ → journals
|
|
80
|
-
│ │ ───────────────────────→│ │
|
|
81
|
-
└─────────────┘ └─────────────┘
|
|
82
|
-
↑ │
|
|
83
|
-
│ rev sync │
|
|
84
|
-
└───────────────────────────────────────┘
|
|
85
|
-
their feedback → your files
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
You stay in Markdown. Collaborators use Word. Journals get PDF. Everyone works in their preferred format.
|
|
89
|
-
|
|
90
|
-
## The CLI Review Cycle
|
|
91
|
-
|
|
92
|
-
When reviewers send back a Word document with track changes and comments:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
rev sync reviewed.docx # import feedback into markdown
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Track changes appear inline - accept or reject by editing:
|
|
99
|
-
|
|
100
|
-
```markdown
|
|
101
|
-
The sample size was {--100--}{++150++} participants.
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Handle comments without opening Word:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
rev comments # list all comments
|
|
108
|
-
rev reply methods.md -n 1 -m "Added clarification"
|
|
109
|
-
rev resolve methods.md -n 1 # mark as resolved
|
|
110
|
-
rev build docx --dual # clean + annotated versions
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Reviewers who annotate PDFs instead of Word? That works too:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
rev sync annotated.pdf # extract PDF comments
|
|
117
|
-
rev pdf-comments annotated.pdf --append methods.md
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Multiple reviewers sending back separate files? Merge them:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
rev merge reviewer_A.docx reviewer_B.docx # three-way merge
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The merge command uses the original document (auto-saved in `.rev/base.docx` on build) to detect what each reviewer changed, identifies conflicts when reviewers edit the same text differently, and lets you resolve them interactively.
|
|
127
|
-
|
|
128
|
-
Your entire revision cycle stays in the terminal. `final_v3_REAL_final.docx` is over.
|
|
129
|
-
|
|
130
|
-
## Getting Started
|
|
131
|
-
|
|
132
|
-
### Starting a New Document
|
|
133
|
-
|
|
134
|
-
Create a new project:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
rev new my-report
|
|
138
|
-
cd my-report
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
You'll be prompted to enter your section names, or press Enter to use the default structure. You can also specify sections directly:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
rev new my-report -s intro,methods,results,discussion
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Or set your preferred default sections once:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
rev config sections "intro,methods,results,discussion"
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
This creates a folder with your chosen sections:
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
my-report/
|
|
157
|
-
├── intro.md
|
|
158
|
-
├── methods.md
|
|
159
|
-
├── results.md
|
|
160
|
-
├── discussion.md
|
|
161
|
-
├── references.bib
|
|
162
|
-
└── rev.yaml
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Write your content in the markdown files. When ready to share:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
rev build docx pdf
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
After building, your project structure looks like:
|
|
172
|
-
|
|
173
|
-
```
|
|
174
|
-
my-report/
|
|
175
|
-
├── intro.md
|
|
176
|
-
├── methods.md
|
|
177
|
-
├── results.md
|
|
178
|
-
├── discussion.md
|
|
179
|
-
├── references.bib
|
|
180
|
-
├── rev.yaml
|
|
181
|
-
├── paper.md ← combined sections (auto-generated)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
###
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```yaml
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
rev
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
|
335
|
-
|
|
336
|
-
|
|
|
337
|
-
|
|
|
338
|
-
|
|
|
339
|
-
|
|
|
340
|
-
|
|
|
341
|
-
|
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
| Word
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
rev
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
1
|
+
# docrev
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/docrev)
|
|
4
|
+
[](https://www.npmjs.com/package/docrev)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
|
|
8
|
+
|
|
9
|
+
A CLI for writing documents in Markdown while collaborating with Word users.
|
|
10
|
+
|
|
11
|
+
You write in Markdown under version control. Your collaborators use Word (or PDF). docrev converts between the two, preserving track changes, comments, equations, and cross-references.
|
|
12
|
+
|
|
13
|
+
## The Problem
|
|
14
|
+
|
|
15
|
+
You've been here before:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
manuscript_v1.docx
|
|
19
|
+
manuscript_v2_john_comments.docx
|
|
20
|
+
manuscript_v2_jane_comments.docx
|
|
21
|
+
manuscript_v3_merged_final.docx
|
|
22
|
+
manuscript_v3_merged_final_REAL.docx
|
|
23
|
+
manuscript_v3_merged_final_REAL_submitted.docx
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Three reviewers send back three Word files. You manually compare changes, copy-paste between documents, lose track of who said what. A week later, you can't remember which version has the figure updates.
|
|
27
|
+
|
|
28
|
+
**docrev fixes this.** You write in plain text. Reviewers use Word. Their feedback flows back into your files automatically. One source of truth, full version history, no more file chaos.
|
|
29
|
+
|
|
30
|
+
## Highlights
|
|
31
|
+
|
|
32
|
+
- **Markdown → Word/PDF** with citations, figures, equations, cross-references
|
|
33
|
+
- **Round-trip sync**: import Word track changes and comments back to Markdown
|
|
34
|
+
- **CLI review workflow**: reply to comments, accept/reject changes from terminal
|
|
35
|
+
- **DOI tools**: validate, lookup, and auto-add references from DOIs
|
|
36
|
+
- **21 journal styles**: Nature, Science, PNAS, and more
|
|
37
|
+
- **Version control friendly**: plain text source, full git history
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g docrev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Requires [Node.js](https://nodejs.org) 18+. [Pandoc](https://pandoc.org) is needed for building DOCX/PDF output. [LaTeX](#installing-dependencies) is additionally needed for PDF.
|
|
46
|
+
|
|
47
|
+
## Quick Example
|
|
48
|
+
|
|
49
|
+
Write in Markdown with citations and cross-references:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
Climate change poses significant challenges [@IPCC2021]. As shown in
|
|
53
|
+
@fig:temperature, global temperatures have risen steadily.
|
|
54
|
+
|
|
55
|
+
{#fig:temperature}
|
|
56
|
+
|
|
57
|
+
The relationship follows $\Delta T = \lambda \cdot \Delta F$ (@eq:forcing).
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Build and share:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
rev build docx # → paper.docx (for collaborators)
|
|
64
|
+
rev build pdf # → paper.pdf (for journals)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
When collaborators return the Word doc with track changes:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
rev sync reviewed.docx # their comments → your markdown
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## How It Works
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
┌─────────────┐ rev build docx ┌─────────────┐
|
|
77
|
+
│ │ ───────────────────────→│ │
|
|
78
|
+
│ Markdown │ │ Word │ → collaborators
|
|
79
|
+
│ (you) │ rev build pdf │ / PDF │ → journals
|
|
80
|
+
│ │ ───────────────────────→│ │
|
|
81
|
+
└─────────────┘ └─────────────┘
|
|
82
|
+
↑ │
|
|
83
|
+
│ rev sync │
|
|
84
|
+
└───────────────────────────────────────┘
|
|
85
|
+
their feedback → your files
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
You stay in Markdown. Collaborators use Word. Journals get PDF. Everyone works in their preferred format.
|
|
89
|
+
|
|
90
|
+
## The CLI Review Cycle
|
|
91
|
+
|
|
92
|
+
When reviewers send back a Word document with track changes and comments:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
rev sync reviewed.docx # import feedback into markdown
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Track changes appear inline - accept or reject by editing:
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
The sample size was {--100--}{++150++} participants.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Handle comments without opening Word:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
rev comments # list all comments
|
|
108
|
+
rev reply methods.md -n 1 -m "Added clarification"
|
|
109
|
+
rev resolve methods.md -n 1 # mark as resolved
|
|
110
|
+
rev build docx --dual # clean + annotated versions
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Reviewers who annotate PDFs instead of Word? That works too:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
rev sync annotated.pdf # extract PDF comments
|
|
117
|
+
rev pdf-comments annotated.pdf --append methods.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Multiple reviewers sending back separate files? Merge them:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
rev merge reviewer_A.docx reviewer_B.docx # three-way merge
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The merge command uses the original document (auto-saved in `.rev/base.docx` on build) to detect what each reviewer changed, identifies conflicts when reviewers edit the same text differently, and lets you resolve them interactively.
|
|
127
|
+
|
|
128
|
+
Your entire revision cycle stays in the terminal. `final_v3_REAL_final.docx` is over.
|
|
129
|
+
|
|
130
|
+
## Getting Started
|
|
131
|
+
|
|
132
|
+
### Starting a New Document
|
|
133
|
+
|
|
134
|
+
Create a new project:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
rev new my-report
|
|
138
|
+
cd my-report
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You'll be prompted to enter your section names, or press Enter to use the default structure. You can also specify sections directly:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
rev new my-report -s intro,methods,results,discussion
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Or set your preferred default sections once:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
rev config sections "intro,methods,results,discussion"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
This creates a folder with your chosen sections:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
my-report/
|
|
157
|
+
├── intro.md
|
|
158
|
+
├── methods.md
|
|
159
|
+
├── results.md
|
|
160
|
+
├── discussion.md
|
|
161
|
+
├── references.bib
|
|
162
|
+
└── rev.yaml
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Write your content in the markdown files. When ready to share:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
rev build docx pdf
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
After building, your project structure looks like:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
my-report/
|
|
175
|
+
├── intro.md
|
|
176
|
+
├── methods.md
|
|
177
|
+
├── results.md
|
|
178
|
+
├── discussion.md
|
|
179
|
+
├── references.bib
|
|
180
|
+
├── rev.yaml
|
|
181
|
+
├── paper.md ← combined sections (auto-generated)
|
|
182
|
+
└── output/
|
|
183
|
+
├── my-report.docx ← output for collaborators
|
|
184
|
+
└── my-report.pdf ← output for journals
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The output filename is derived from your project title in `rev.yaml`. Citations are resolved, equations rendered, and cross-references numbered. Set `outputDir: null` in `rev.yaml` if you'd rather have the built files land alongside `paper.md` (legacy layout).
|
|
188
|
+
|
|
189
|
+
### Starting from an Existing Word Document
|
|
190
|
+
|
|
191
|
+
If you have a Word document to convert:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
rev import manuscript.docx
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
This creates a project folder and splits the document into section files. Images are extracted to `figures/`, equations are converted to LaTeX, and track changes/comments are preserved as markdown annotations.
|
|
198
|
+
|
|
199
|
+
### Configuration
|
|
200
|
+
|
|
201
|
+
Layout is controlled in `rev.yaml`:
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
title: "My Document"
|
|
205
|
+
authors: []
|
|
206
|
+
sections:
|
|
207
|
+
- intro.md
|
|
208
|
+
- methods.md
|
|
209
|
+
- results.md
|
|
210
|
+
- discussion.md
|
|
211
|
+
|
|
212
|
+
# Where built artefacts land (default: output/). Set to null for the
|
|
213
|
+
# legacy "outputs alongside paper.md" layout.
|
|
214
|
+
outputDir: output
|
|
215
|
+
|
|
216
|
+
docx:
|
|
217
|
+
reference: template.docx # your Word template
|
|
218
|
+
|
|
219
|
+
pdf:
|
|
220
|
+
documentclass: article
|
|
221
|
+
fontsize: 12pt
|
|
222
|
+
engine: pdflatex # or xelatex/lualatex for Latin-Extended
|
|
223
|
+
# Fonts apply only under xelatex/lualatex (fontspec):
|
|
224
|
+
# mainfont: "TeX Gyre Termes"
|
|
225
|
+
# sansfont: "TeX Gyre Heros"
|
|
226
|
+
# monofont: "TeX Gyre Cursor"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Switch to `engine: xelatex` (or `lualatex`) when the manuscript has Czech/Polish/Croatian/Spanish names or species epithets that `pdflatex` mangles. Under those engines, `mainfont`/`sansfont`/`monofont` are forwarded to pandoc.
|
|
230
|
+
|
|
231
|
+
Configure your name for comment replies:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
rev config user "Your Name"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Table Formatting
|
|
238
|
+
|
|
239
|
+
For PDF output, configure columns that should not wrap:
|
|
240
|
+
|
|
241
|
+
```yaml
|
|
242
|
+
tables:
|
|
243
|
+
nowrap:
|
|
244
|
+
- Prior # column headers to keep on one line
|
|
245
|
+
- "$\\widehat{R}$"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Distribution notation in nowrap columns is auto-converted to LaTeX math:
|
|
249
|
+
`Normal(0, 0.5)` → `$\mathcal{N}(0, 0.5)$`
|
|
250
|
+
|
|
251
|
+
### Postprocess Scripts
|
|
252
|
+
|
|
253
|
+
Run custom scripts after output generation:
|
|
254
|
+
|
|
255
|
+
```yaml
|
|
256
|
+
postprocess:
|
|
257
|
+
pdf: ./scripts/fix-tables.py # runs after PDF
|
|
258
|
+
docx: ./scripts/add-meta.js # runs after DOCX
|
|
259
|
+
all: ./scripts/notify.sh # runs after any format
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Scripts receive environment variables: `OUTPUT_FILE`, `OUTPUT_FORMAT`, `PROJECT_DIR`, `CONFIG_PATH`.
|
|
263
|
+
|
|
264
|
+
Use `--verbose` to see script output:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
rev build pdf --verbose
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Journal Profiles
|
|
271
|
+
|
|
272
|
+
Journal profiles provide both validation rules and build formatting defaults. Set in `rev.yaml`:
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
journal: nature
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Or pass on the command line:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
rev build pdf -j nature # applies Nature's CSL style + PDF settings
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
When a journal is set, its formatting defaults (CSL citation style, font size, margins, line spacing) are applied automatically. Your explicit `rev.yaml` settings always take priority.
|
|
285
|
+
|
|
286
|
+
Six profiles include formatting: `nature`, `science`, `cell`, `pnas`, `plos-one`, `elife`. All 21 profiles support validation. Custom profiles can include formatting too — see [docs/configuration.md](docs/configuration.md).
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
rev validate --list # see all profiles ([formatting] tag = build support)
|
|
290
|
+
rev profiles --fetch-csl apa # download a CSL style to cache
|
|
291
|
+
rev profiles --list-csl # list cached CSL styles
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Annotation Syntax
|
|
295
|
+
|
|
296
|
+
Track changes from Word appear as [CriticMarkup](http://criticmarkup.com/):
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
The sample size was {--100--}{++150++} participants. # deletion + insertion
|
|
300
|
+
Data was collected {~~monthly~>weekly~~}. # substitution
|
|
301
|
+
{>>Reviewer 2: Please clarify.<<} # comment
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Writing Tips
|
|
305
|
+
|
|
306
|
+
Track word count changes between versions:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
rev diff # compare against last commit
|
|
310
|
+
# methods.md +142 words -38 words
|
|
311
|
+
# results.md +89 words -12 words
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Add references to `references.bib` (BibTeX format):
|
|
315
|
+
|
|
316
|
+
```bibtex
|
|
317
|
+
@article{Smith2020,
|
|
318
|
+
author = {Smith, Jane},
|
|
319
|
+
title = {Paper Title},
|
|
320
|
+
journal = {Nature},
|
|
321
|
+
year = {2020},
|
|
322
|
+
doi = {10.1038/example}
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Cite with `[@Smith2020]` or `[@Smith2020; @Jones2021]` for multiple sources.
|
|
327
|
+
|
|
328
|
+
Equations use LaTeX: inline `$E = mc^2$` or display `$$\sum_{i=1}^{n} x_i$$`.
|
|
329
|
+
|
|
330
|
+
Cross-references: `@fig:label`, `@tbl:label`, `@eq:label` → "Figure 1", "Table 2", "Equation 3".
|
|
331
|
+
|
|
332
|
+
## Command Reference
|
|
333
|
+
|
|
334
|
+
| Task | Command |
|
|
335
|
+
|------|---------|
|
|
336
|
+
| Create project | `rev new my-project` |
|
|
337
|
+
| Create LaTeX project | `rev new my-project --template latex` |
|
|
338
|
+
| Import Word document | `rev import manuscript.docx` |
|
|
339
|
+
| Extract Word equations | `rev equations from-word doc.docx` |
|
|
340
|
+
| Build DOCX | `rev build docx` |
|
|
341
|
+
| Build PDF | `rev build pdf` |
|
|
342
|
+
| Build clean + annotated | `rev build docx --dual` |
|
|
343
|
+
| Build with visible track changes | `rev build docx --show-changes` |
|
|
344
|
+
| Sync Word feedback | `rev sync reviewed.docx` |
|
|
345
|
+
| Sync PDF comments | `rev sync annotated.pdf` |
|
|
346
|
+
| Extract PDF comments | `rev pdf-comments annotated.pdf` |
|
|
347
|
+
| Extract with highlighted text | `rev pdf-comments file.pdf --with-text` |
|
|
348
|
+
| Project status | `rev status` |
|
|
349
|
+
| Next pending comment | `rev next` |
|
|
350
|
+
| List pending comments | `rev todo` |
|
|
351
|
+
| Filter by author | `rev comments file.md --author "Reviewer 2"` |
|
|
352
|
+
| Accept all changes | `rev accept file.md -a` |
|
|
353
|
+
| Reject change | `rev reject file.md -n 1` |
|
|
354
|
+
| Reply to comment | `rev reply file.md -n 1 -m "response"` |
|
|
355
|
+
| Reply to all pending | `rev reply file.md --all -m "Addressed"` |
|
|
356
|
+
| Resolve comment | `rev resolve file.md -n 1` |
|
|
357
|
+
| Show contributors | `rev contributors` |
|
|
358
|
+
| Lookup ORCID | `rev orcid 0000-0002-1825-0097` |
|
|
359
|
+
| Merge reviewer feedback | `rev merge reviewer_A.docx reviewer_B.docx` |
|
|
360
|
+
| Archive reviewer files | `rev archive` |
|
|
361
|
+
| Check DOIs | `rev doi check references.bib` |
|
|
362
|
+
| Find missing DOIs | `rev doi lookup references.bib` |
|
|
363
|
+
| Add citation from DOI | `rev doi add 10.1038/example` |
|
|
364
|
+
| Word count | `rev wc` |
|
|
365
|
+
| Pre-submission check | `rev check` |
|
|
366
|
+
| Check for updates | `rev upgrade --check` |
|
|
367
|
+
|
|
368
|
+
Run `rev help` to see all commands, or `rev help <command>` for details on a specific command.
|
|
369
|
+
|
|
370
|
+
Full command reference: [docs/commands.md](docs/commands.md)
|
|
371
|
+
|
|
372
|
+
## Claude Code Skill
|
|
373
|
+
|
|
374
|
+
Install the docrev skill for [Claude Code](https://claude.ai/code):
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
rev install-cli-skill # install to ~/.claude/skills/docrev
|
|
378
|
+
rev uninstall-cli-skill # remove
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Once installed, Claude understands docrev commands and can help navigate comments, draft replies, and manage your revision cycle.
|
|
382
|
+
|
|
383
|
+
## Installing Dependencies
|
|
384
|
+
|
|
385
|
+
### Pandoc
|
|
386
|
+
|
|
387
|
+
[Pandoc](https://pandoc.org) handles document conversion.
|
|
388
|
+
|
|
389
|
+
| Platform | Command |
|
|
390
|
+
|----------|---------|
|
|
391
|
+
| macOS | `brew install pandoc` |
|
|
392
|
+
| Windows | `winget install JohnMacFarlane.Pandoc` |
|
|
393
|
+
| Debian/Ubuntu | `sudo apt install pandoc` |
|
|
394
|
+
| Fedora | `sudo dnf install pandoc` |
|
|
395
|
+
|
|
396
|
+
Other platforms: [pandoc.org/installing](https://pandoc.org/installing.html)
|
|
397
|
+
|
|
398
|
+
### LaTeX (for PDF output)
|
|
399
|
+
|
|
400
|
+
| Platform | Command |
|
|
401
|
+
|----------|---------|
|
|
402
|
+
| macOS | `brew install --cask mactex` |
|
|
403
|
+
| Windows | `winget install MiKTeX.MiKTeX` |
|
|
404
|
+
| Debian/Ubuntu | `sudo apt install texlive-full` |
|
|
405
|
+
| Fedora | `sudo dnf install texlive-scheme-full` |
|
|
406
|
+
|
|
407
|
+
Alternatively, [TinyTeX](https://yihui.org/tinytex/) provides a minimal distribution that downloads packages on demand.
|
|
408
|
+
|
|
409
|
+
## License
|
|
410
|
+
|
|
411
|
+
MIT
|