docrev 0.6.2 → 0.6.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.
Files changed (2) hide show
  1. package/README.md +50 -355
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  # docrev
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/docrev)](https://www.npmjs.com/package/docrev)
4
- [![CI](https://github.com/gcol33/docrev/actions/workflows/ci.yml/badge.svg)](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
5
4
  [![Node.js](https://img.shields.io/node/v/docrev)](https://nodejs.org/)
6
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
6
 
8
- CLI tool for Word ↔ Markdown round-trips. Handle reviewer feedback on academic papers: import track changes, review interactively, manage comments, validate DOIs, and build to PDF/DOCX/LaTeX.
7
+ CLI tool for academic paper workflows with Word ↔ Markdown round-trips. Handle reviewer feedback, manage comments, validate DOIs, and build to PDF/DOCX/LaTeX.
9
8
 
10
9
  ## Install
11
10
 
@@ -13,411 +12,107 @@ CLI tool for Word ↔ Markdown round-trips. Handle reviewer feedback on academic
13
12
  npm install -g docrev
14
13
  ```
15
14
 
16
- The `rev` command is now available globally.
17
-
18
- ### Prerequisites
19
-
20
- - **Node.js 18+** - [Download](https://nodejs.org/)
21
- - **Pandoc** - For building PDF/DOCX ([pandoc.org](https://pandoc.org/installing.html))
22
- - **pandoc-crossref** - For figure/table refs (optional, [install](https://github.com/lierdakil/pandoc-crossref/releases))
15
+ **Prerequisites:** [Pandoc](https://pandoc.org/installing.html) and optionally [pandoc-crossref](https://github.com/lierdakil/pandoc-crossref)
23
16
 
24
17
  ```bash
25
18
  # macOS
26
19
  brew install pandoc pandoc-crossref
27
20
 
28
- # Ubuntu/Debian
29
- sudo apt install pandoc
30
-
31
- # Windows
32
- winget install JohnMacFarlane.Pandoc
33
- ```
34
-
35
- Verify installation:
36
- ```bash
21
+ # Verify
37
22
  rev --version
38
- rev install # Check for missing dependencies
39
- ```
40
-
41
- ### Shell Completions (Optional)
42
-
43
- Enable tab completion for `rev` commands:
44
-
45
- ```bash
46
- # Bash - add to ~/.bashrc
47
- eval "$(rev completions bash)"
48
-
49
- # Zsh - add to ~/.zshrc
50
- eval "$(rev completions zsh)"
23
+ rev install
51
24
  ```
52
25
 
53
- ## Features
54
-
55
- - **Integrated build system** - Combine sections → paper.md → PDF, DOCX, or LaTeX
56
- - **Import from Word** - Diff Word docs against your Markdown, generating CriticMarkup annotations
57
- - **Section-aware import** - Import directly to modular section files (intro.md, methods.md, etc.)
58
- - **Interactive review** - Accept/reject track changes with a TUI
59
- - **Comment management** - List, filter, resolve, and reply to reviewer comments
60
- - **Response letter generation** - Auto-generate point-by-point response from comments
61
- - **DOI validation** - Check and find DOIs via Crossref/DataCite APIs
62
- - **Cross-reference conversion** - Auto-convert "Figures 1-3" to `@fig:label` syntax (handles complex patterns)
63
- - **Equation extraction** - Extract LaTeX equations from Word documents (OMML → LaTeX)
64
- - **Citation validation** - Check citations against bibliography
65
-
66
26
  ## Quick Start
67
27
 
68
- ### Start from Word Document
69
-
70
28
  ```bash
71
- # Import existing Word doc → creates section files + rev.yaml
72
- rev import manuscript.docx
73
-
74
- # Import to specific directory
75
- rev import manuscript.docx -o my-paper/
76
-
77
- # Preview without creating files
78
- rev import manuscript.docx --dry-run
79
- ```
80
-
81
- ### New Project from Template
82
-
83
- ```bash
84
- # Create a new paper project
29
+ # Create new project
85
30
  rev new my-paper
86
31
 
87
- # or with a specific template
88
- rev new my-thesis --template thesis
89
-
90
- # List available templates
91
- rev new --list
92
- ```
93
-
94
- ### Build Workflow
95
-
96
- ```bash
97
- cd my-paper
98
-
99
- # Edit your sections
100
- # introduction.md, methods.md, results.md, discussion.md
32
+ # Or import from Word
33
+ rev import manuscript.docx
101
34
 
102
- # Build PDF and Word
103
- rev build
35
+ # Edit sections: introduction.md, methods.md, results.md, discussion.md
104
36
 
105
- # Build specific format
37
+ # Build outputs
106
38
  rev build pdf
107
39
  rev build docx
108
- rev build tex
109
- rev build all # PDF + DOCX + TEX
40
+ rev build --dual # Clean + comments DOCX with threaded comments
110
41
  ```
111
42
 
112
- ### Review Workflow
43
+ ## Reviewer Workflow
113
44
 
114
45
  ```bash
115
- # Import reviewer's Word doc to section files
46
+ # Import reviewed Word doc to section files
116
47
  rev sections reviewed.docx
117
48
 
118
49
  # Review track changes interactively
119
50
  rev review methods.md
120
51
 
121
- # See remaining comments
52
+ # See and reply to comments
122
53
  rev comments methods.md
54
+ rev reply methods.md -n 1 -m "Added clarification"
123
55
 
124
56
  # Rebuild
125
- rev build docx
57
+ rev build docx --dual
126
58
  ```
127
59
 
128
- ## Commands
129
-
130
- ### Build & Create
131
-
132
- | Command | Description |
133
- |---------|-------------|
134
- | `rev build [formats...]` | Build PDF/DOCX/TEX from sections |
135
- | `rev build --toc` | Build with table of contents |
136
- | `rev build --show-changes` | Export DOCX with visible track changes |
137
- | `rev new <name>` | Create new project from template |
138
- | `rev new --list` | List available templates |
139
- | `rev install` | Check/install dependencies (pandoc-crossref) |
60
+ ## Key Features
140
61
 
141
- ### Import & Export
62
+ - **Build system** - Sections → paper.md → PDF, DOCX, LaTeX
63
+ - **Word import** - Extracts text, comments, equations (OMML → LaTeX), and images
64
+ - **Interactive review** - Accept/reject track changes with TUI
65
+ - **Comment threading** - Guy→Gilles reply pairs become threaded Word comments
66
+ - **Cross-references** - `@fig:label` → "Figure 1" (auto-converted from Word)
67
+ - **DOI validation** - Check and lookup DOIs via Crossref/DataCite
68
+ - **Journal validation** - Check against 21 journal requirement profiles
142
69
 
143
- | Command | Description |
144
- |---------|-------------|
145
- | `rev import <docx>` | Bootstrap project from Word (creates sections + rev.yaml) |
146
- | `rev import <docx> <md>` | Import changes by diffing Word against your MD |
147
- | `rev sections <docx>` | Import Word doc to existing section files |
148
- | `rev extract <docx>` | Extract plain text from Word |
149
-
150
- ### Review & Edit
151
-
152
- | Command | Description |
153
- |---------|-------------|
154
- | `rev review <file>` | Interactive accept/reject TUI for track changes |
155
- | `rev status <file>` | Show annotation counts |
156
- | `rev comments <file>` | List all comments with context |
157
- | `rev comments <file> --export comments.csv` | Export comments to CSV |
158
- | `rev resolve <file> -n 1` | Mark comment #1 as resolved |
159
- | `rev strip <file>` | Output clean Markdown (annotations applied) |
160
-
161
- ### Cross-References
162
-
163
- | Command | Description |
164
- |---------|-------------|
165
- | `rev refs [file]` | Show figure/table registry and reference status |
166
- | `rev migrate <file>` | Convert hardcoded refs (Fig. 1) to dynamic (@fig:label) |
167
-
168
- ### Comments & Replies
169
-
170
- | Command | Description |
171
- |---------|-------------|
172
- | `rev config user "Name"` | Set your name for replies |
173
- | `rev reply <file>` | Interactive reply to reviewer comments |
174
- | `rev reply <file> -n 1 -m "text"` | Reply to specific comment (non-interactive) |
175
-
176
- ### Bibliography & DOIs
177
-
178
- | Command | Description |
179
- |---------|-------------|
180
- | `rev doi check [file.bib]` | Validate DOIs in bibliography (Crossref + DataCite) |
181
- | `rev doi lookup [file.bib]` | Search for missing DOIs by title/author/year |
182
- | `rev doi fetch <doi>` | Fetch BibTeX entry from DOI |
183
- | `rev doi add <doi>` | Fetch and add DOI entry to bibliography |
184
-
185
- ### Validation & Analysis
186
-
187
- | Command | Description |
188
- |---------|-------------|
189
- | `rev citations [file.bib]` | Validate citations against bibliography |
190
- | `rev figures [file]` | List figures/tables with reference counts |
191
- | `rev equations list` | List all equations in section files |
192
- | `rev equations from-word <docx>` | Extract equations from Word to LaTeX |
193
- | `rev response [files]` | Generate response letter from comments |
194
- | `rev anonymize <file>` | Prepare document for blind review |
195
- | `rev validate --journal <name>` | Check manuscript against journal requirements |
196
- | `rev validate --list` | List available journal profiles |
197
-
198
- ### Multi-Reviewer & Git
199
-
200
- | Command | Description |
201
- |---------|-------------|
202
- | `rev merge <md> <docx...>` | Merge feedback from multiple Word documents |
203
- | `rev diff [ref]` | Compare sections against git history |
204
- | `rev history [file]` | Show revision history for sections |
205
-
206
- ### Configuration
207
-
208
- | Command | Description |
209
- |---------|-------------|
210
- | `rev init` | Generate sections.yaml from existing .md files |
211
- | `rev split <file>` | Split annotated paper.md back to section files |
212
- | `rev help [topic]` | Show help (topics: workflow, syntax, commands) |
213
-
214
- ### Convenience Commands
215
-
216
- | Command | Description |
217
- |---------|-------------|
218
- | `rev word-count` | Show word counts per section |
219
- | `rev word-count -j <journal>` | Warn if over journal word limit |
220
- | `rev stats` | Project dashboard (words, figures, citations) |
221
- | `rev search <query>` | Search across all section files |
222
- | `rev backup` | Create timestamped backup zip |
223
- | `rev export` | Export project as distributable zip |
224
- | `rev preview <format>` | Build and open document |
225
- | `rev watch [format]` | Auto-rebuild on file changes |
226
- | `rev lint` | Check for broken refs, missing citations |
227
-
228
- ### Grammar & Style
229
-
230
- | Command | Description |
231
- |---------|-------------|
232
- | `rev grammar` | Check grammar/style issues |
233
- | `rev grammar --rules` | List available grammar rules |
234
- | `rev grammar --learn <word>` | Add word to custom dictionary |
235
- | `rev grammar --list` | Show custom dictionary |
236
-
237
- ### Spelling
70
+ ## Commands
238
71
 
239
72
  | Command | Description |
240
73
  |---------|-------------|
241
- | `rev spelling` | Check spelling in all sections |
242
- | `rev spelling --british` | Use British English dictionary |
243
- | `rev spelling --learn <word>` | Add word to global dictionary |
244
- | `rev spelling --learn-project <word>` | Add word to project dictionary |
245
- | `rev spelling --list` | Show global dictionary |
246
- | `rev spelling --list-all` | Show global + project dictionaries |
74
+ | `rev build [pdf\|docx\|tex]` | Build outputs from sections |
75
+ | `rev build --dual` | Clean + comments DOCX |
76
+ | `rev import <docx>` | Bootstrap project from Word |
77
+ | `rev sections <docx>` | Import to existing section files |
78
+ | `rev review <file>` | Interactive accept/reject TUI |
79
+ | `rev comments <file>` | List comments with context |
80
+ | `rev reply <file> -n N -m "text"` | Reply to comment |
81
+ | `rev doi check [file.bib]` | Validate DOIs |
82
+ | `rev doi lookup [file.bib]` | Find missing DOIs |
83
+ | `rev validate -j <journal>` | Check journal requirements |
84
+
85
+ See [docs/commands.md](docs/commands.md) for full command reference.
247
86
 
248
- ### Direct DOCX Editing
87
+ ## Annotation Syntax (CriticMarkup)
249
88
 
250
- | Command | Description |
251
- |---------|-------------|
252
- | `rev annotate <docx>` | Add comments to Word document |
253
- | `rev apply <md> <docx>` | Apply annotations as track changes |
254
- | `rev comment <docx>` | Interactive comment mode |
89
+ ```markdown
90
+ {++inserted text++} # Insertions
91
+ {--deleted text--} # Deletions
92
+ {~~old~>new~~} # Substitutions
93
+ {>>Author: comment<<} # Comments
94
+ ```
255
95
 
256
96
  ## Project Structure
257
97
 
258
- A typical rev project:
259
-
260
98
  ```
261
99
  my-paper/
262
- ├── rev.yaml # Project config (title, authors, build settings)
100
+ ├── rev.yaml # Config (title, authors, build settings)
263
101
  ├── introduction.md # Section files
264
102
  ├── methods.md
265
103
  ├── results.md
266
104
  ├── discussion.md
267
105
  ├── references.bib # Bibliography
268
106
  ├── figures/ # Images
269
- ├── paper.md # Combined output (generated)
270
- ├── my-paper.pdf # PDF output (generated)
271
- └── my-paper.docx # Word output (generated)
272
- ```
273
-
274
- ## Configuration (rev.yaml)
275
-
276
- ```yaml
277
- title: "Your Paper Title"
278
- authors:
279
- - name: First Author
280
- affiliation: Institution
281
- email: author@example.com
282
-
283
- sections:
284
- - introduction.md
285
- - methods.md
286
- - results.md
287
- - discussion.md
288
-
289
- bibliography: references.bib
290
- csl: nature.csl # Optional citation style
291
-
292
- crossref:
293
- figureTitle: Figure
294
- tableTitle: Table
295
- figPrefix: [Fig., Figs.]
296
- tblPrefix: [Table, Tables]
297
-
298
- pdf:
299
- documentclass: article
300
- fontsize: 12pt
301
- geometry: margin=1in
302
- linestretch: 1.5
303
- toc: false # Table of contents
304
-
305
- docx:
306
- reference: template.docx # Optional reference doc
307
- keepComments: true
308
- toc: false # Table of contents
309
- ```
310
-
311
- ## Annotation Syntax (CriticMarkup)
312
-
313
- ```markdown
314
- {++inserted text++} # Insertions
315
- {--deleted text--} # Deletions
316
- {~~old~>new~~} # Substitutions
317
- {>>Author: comment<<} # Comments
318
- ```
319
-
320
- ## Template Variables
321
-
322
- Use template variables in section files (processed during build):
323
-
324
- ```markdown
325
- Last updated: {{date}}
326
- Version: {{version}}
327
- Word count: {{word_count}}
328
- ```
329
-
330
- | Variable | Description |
331
- |----------|-------------|
332
- | `{{date}}` | Current date (YYYY-MM-DD) |
333
- | `{{date:MMMM D, YYYY}}` | Custom format (December 29, 2025) |
334
- | `{{year}}` | Current year |
335
- | `{{version}}` | Version from rev.yaml |
336
- | `{{title}}` | Document title |
337
- | `{{author}}` | First author name |
338
- | `{{authors}}` | All authors (comma-separated) |
339
- | `{{word_count}}` | Total word count |
340
-
341
- ## Comment Replies
342
-
343
- Reply to reviewer comments with your name:
344
-
345
- ```bash
346
- # Set your name (once)
347
- rev config user "Gilles Colling"
348
-
349
- # Interactive: go through each comment
350
- rev reply methods.md
351
-
352
- # Non-interactive: reply to specific comment
353
- rev reply methods.md -n 1 -m "Done, added clarification"
354
- ```
355
-
356
- Creates a conversation thread:
357
- ```markdown
358
- {>>Reviewer: Please clarify this<<} {>>Gilles Colling: Added in next paragraph<<}
359
- ```
360
-
361
- Claude can also reply programmatically using the non-interactive mode.
362
-
363
- ## Cross-Reference System
364
-
365
- Use dynamic references in your source:
366
-
367
- ```markdown
368
- ![Caption](figures/img.png){#fig:heatmap}
369
-
370
- See @fig:heatmap for the results.
107
+ └── paper.docx # Generated output
371
108
  ```
372
109
 
373
- When importing from Word, hardcoded refs are auto-converted:
374
- - `Figure 1` → `@fig:heatmap`
375
- - `Fig. 2a` → `@fig:model`
376
- - `Figs. 1-3` → `@fig:heatmap; @fig:model; @fig:hierarchy`
377
- - `Figures 1, 2, and 3` → `@fig:one; @fig:two; @fig:three`
378
- - `Fig. 1a-c` → `@fig:one` (expands letter suffixes)
379
- - `Figs. 1a-3b` → all panels from 1a to 3b
380
-
381
- ## Build Outputs
382
-
383
- | Format | Annotations | Cross-refs |
384
- |--------|-------------|------------|
385
- | PDF | Stripped (clean) | `@fig:label` → "Figure 1" |
386
- | DOCX | Comments kept | `@fig:label` → "Figure 1" |
387
- | TEX | Stripped (clean) | LaTeX labels |
388
-
389
- ## DOI Management
390
-
391
- Check and find DOIs for your bibliography:
392
-
393
- ```bash
394
- # Validate all DOIs in references.bib
395
- rev doi check references.bib
396
-
397
- # Look up missing DOIs automatically
398
- rev doi lookup references.bib --confidence medium
399
-
400
- # Fetch BibTeX from a DOI
401
- rev doi fetch 10.1038/nature12373
402
-
403
- # Add a citation by DOI
404
- rev doi add 10.1038/nature12373
405
- ```
406
-
407
- **Features:**
408
- - Validates DOIs via Crossref API (+ DataCite for Zenodo/Figshare)
409
- - Smart lookup using title, author, year, and journal matching
410
- - Filters out supplement/figure DOIs and F1000 reviews
411
- - Confidence levels: `high`, `medium`, `low` (use `--confidence low` to see all matches)
412
- - Skip entries with `nodoi = {true}` or `% no-doi` comment
413
-
414
- ## Dependencies
110
+ ## Documentation
415
111
 
416
- - Node.js 18+
417
- - [Pandoc](https://pandoc.org/) - Document conversion
418
- - [pandoc-crossref](https://github.com/lierdakil/pandoc-crossref) - Cross-references (optional but recommended)
419
- - [mammoth](https://github.com/mwilliamson/mammoth.js) - Word document parsing
420
- - [diff](https://github.com/kpdecker/jsdiff) - Text diffing
112
+ - [Commands Reference](docs/commands.md) - All commands with examples
113
+ - [Configuration](docs/configuration.md) - rev.yaml options
114
+ - [Workflow Guide](docs/workflow.md) - Step-by-step reviewer workflow
115
+ - [API Reference](docs/api.md) - Library usage
421
116
 
422
117
  ## License
423
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docrev",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
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",