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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ All notable changes to docrev will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.7.1] - 2025-01-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Writing Markdown guide in docs (tables, equations, citations, cross-refs)
|
|
12
|
+
- Grid table syntax documentation for merged cells
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- README restructured for better scannability (490 → 290 lines)
|
|
16
|
+
- Install section moved up for faster onboarding
|
|
17
|
+
- Added Highlights section with quick feature overview
|
|
18
|
+
- Condensed overlapping sections
|
|
19
|
+
|
|
20
|
+
## [0.7.0] - 2025-01-02
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- API rate limiting with exponential backoff for Crossref/DataCite/doi.org APIs
|
|
24
|
+
- Windows support in CI matrix
|
|
25
|
+
- Architecture documentation for contributors (`ARCHITECTURE.md`)
|
|
26
|
+
- Exclusion patterns for cross-reference false positives (e.g., "Table of Contents")
|
|
27
|
+
- Timeout support for PDF extraction (30s default)
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Consolidated YAML dependencies (removed `js-yaml`, using `yaml` package only)
|
|
31
|
+
- Improved annotation false positive detection (code blocks, URLs, LaTeX patterns)
|
|
32
|
+
- Enhanced error messages for Word import and PDF extraction
|
|
33
|
+
- Updated User-Agent strings for API requests
|
|
34
|
+
- Improved README with problem statement and quick example
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
- CI lint step now checks all command files separately
|
|
38
|
+
- Windows temp directory paths in tests
|
|
39
|
+
|
|
8
40
|
## [0.3.2] - 2024-12-29
|
|
9
41
|
|
|
10
42
|
### Added
|
package/README.md
CHANGED
|
@@ -1,174 +1,309 @@
|
|
|
1
1
|
# docrev
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/docrev)
|
|
4
|
+
[](https://www.npmjs.com/package/docrev)
|
|
5
|
+
[](https://nodejs.org)
|
|
4
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
|
|
5
8
|
|
|
6
|
-
|
|
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:
|
|
7
16
|
|
|
8
17
|
```
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
13
24
|
```
|
|
14
25
|
|
|
15
|
-
|
|
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
|
|
16
38
|
|
|
17
39
|
## Install
|
|
18
40
|
|
|
19
41
|
```bash
|
|
20
42
|
npm install -g docrev
|
|
21
|
-
brew install pandoc
|
|
22
43
|
```
|
|
23
44
|
|
|
24
|
-
|
|
45
|
+
Requires [Node.js](https://nodejs.org) 18+, [Pandoc](https://pandoc.org) 2.11+, and [LaTeX](#installing-dependencies) for PDF output.
|
|
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:
|
|
25
61
|
|
|
26
|
-
From scratch:
|
|
27
62
|
```bash
|
|
28
|
-
rev
|
|
29
|
-
|
|
63
|
+
rev build docx # → paper.docx (for collaborators)
|
|
64
|
+
rev build pdf # → paper.pdf (for journals)
|
|
30
65
|
```
|
|
31
66
|
|
|
32
|
-
|
|
67
|
+
When collaborators return the Word doc with track changes:
|
|
68
|
+
|
|
33
69
|
```bash
|
|
34
|
-
rev
|
|
70
|
+
rev sync reviewed.docx # their comments → your markdown
|
|
35
71
|
```
|
|
36
72
|
|
|
37
|
-
|
|
73
|
+
## How It Works
|
|
74
|
+
|
|
38
75
|
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
46
86
|
```
|
|
47
87
|
|
|
48
|
-
|
|
88
|
+
You stay in Markdown. Collaborators use Word. Journals get PDF. Everyone works in their preferred format.
|
|
49
89
|
|
|
50
|
-
|
|
51
|
-
|
|
90
|
+
## The CLI Review Cycle
|
|
91
|
+
|
|
92
|
+
When reviewers send back a Word document with track changes and comments:
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
```bash
|
|
95
|
+
rev sync reviewed.docx # import feedback into markdown
|
|
96
|
+
```
|
|
54
97
|
|
|
55
|
-
-
|
|
56
|
-
- Another point
|
|
98
|
+
Track changes appear inline - accept or reject by editing:
|
|
57
99
|
|
|
58
|
-
|
|
59
|
-
|
|
100
|
+
```markdown
|
|
101
|
+
The sample size was {--100--}{++150++} participants.
|
|
60
102
|
```
|
|
61
103
|
|
|
62
|
-
|
|
104
|
+
Handle comments without opening Word:
|
|
63
105
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
journal = {Nature},
|
|
70
|
-
year = {2020}
|
|
71
|
-
}
|
|
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
|
|
72
111
|
```
|
|
73
112
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
77
118
|
```
|
|
78
119
|
|
|
79
|
-
|
|
120
|
+
Your entire revision cycle stays in the terminal. `final_v3_REAL_final.docx` is over.
|
|
80
121
|
|
|
81
|
-
|
|
122
|
+
## Getting Started
|
|
82
123
|
|
|
83
|
-
|
|
124
|
+
### Starting a New Document
|
|
84
125
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
126
|
+
Create a new project:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
rev new my-report
|
|
130
|
+
cd my-report
|
|
90
131
|
```
|
|
91
132
|
|
|
92
|
-
|
|
133
|
+
You'll be prompted to enter your section names, or press Enter to use the default structure. You can also specify sections directly:
|
|
93
134
|
|
|
94
|
-
```
|
|
95
|
-
|
|
135
|
+
```bash
|
|
136
|
+
rev new my-report -s intro,methods,results,discussion
|
|
137
|
+
```
|
|
96
138
|
|
|
97
|
-
|
|
139
|
+
Or set your preferred default sections once:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
rev config sections "intro,methods,results,discussion"
|
|
98
143
|
```
|
|
99
144
|
|
|
100
|
-
|
|
145
|
+
This creates a folder with your chosen sections:
|
|
101
146
|
|
|
102
|
-
|
|
147
|
+
```
|
|
148
|
+
my-report/
|
|
149
|
+
├── intro.md
|
|
150
|
+
├── methods.md
|
|
151
|
+
├── results.md
|
|
152
|
+
├── discussion.md
|
|
153
|
+
├── references.bib
|
|
154
|
+
└── rev.yaml
|
|
155
|
+
```
|
|
103
156
|
|
|
104
|
-
|
|
157
|
+
Write your content in the markdown files. When ready to share:
|
|
105
158
|
|
|
106
159
|
```bash
|
|
107
|
-
rev build docx
|
|
108
|
-
rev build pdf # PDF
|
|
109
|
-
rev build --dual # Clean + comments versions
|
|
110
|
-
rev watch docx # Auto-rebuild on save
|
|
160
|
+
rev build docx
|
|
111
161
|
```
|
|
112
162
|
|
|
113
|
-
|
|
163
|
+
This produces `my-report.docx` with citations resolved, equations rendered, and cross-references numbered. Use `rev build pdf` for PDF output instead.
|
|
164
|
+
|
|
165
|
+
### Starting from an Existing Word Document
|
|
166
|
+
|
|
167
|
+
If you have a Word document to convert:
|
|
114
168
|
|
|
115
|
-
Import reviewed document:
|
|
116
169
|
```bash
|
|
117
|
-
rev
|
|
170
|
+
rev import manuscript.docx
|
|
118
171
|
```
|
|
119
172
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
173
|
+
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.
|
|
174
|
+
|
|
175
|
+
### Configuration
|
|
176
|
+
|
|
177
|
+
Layout is controlled in `rev.yaml`:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
title: "My Document"
|
|
181
|
+
output:
|
|
182
|
+
docx:
|
|
183
|
+
reference-doc: template.docx # your Word template
|
|
184
|
+
pdf:
|
|
185
|
+
documentclass: article
|
|
186
|
+
fontsize: 12pt
|
|
123
187
|
```
|
|
124
188
|
|
|
125
|
-
|
|
189
|
+
Configure your name for comment replies:
|
|
190
|
+
|
|
126
191
|
```bash
|
|
127
192
|
rev config user "Your Name"
|
|
128
|
-
rev reply methods.md -n 1 -m "Clarified sampling methodology"
|
|
129
193
|
```
|
|
130
194
|
|
|
131
|
-
|
|
195
|
+
## Annotation Syntax
|
|
196
|
+
|
|
197
|
+
Track changes from Word appear as [CriticMarkup](http://criticmarkup.com/):
|
|
198
|
+
|
|
199
|
+
```markdown
|
|
200
|
+
The sample size was {--100--}{++150++} participants. # deletion + insertion
|
|
201
|
+
Data was collected {~~monthly~>weekly~~}. # substitution
|
|
202
|
+
{>>Reviewer 2: Please clarify.<<} # comment
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Writing Tips
|
|
206
|
+
|
|
207
|
+
Track word count changes between versions:
|
|
208
|
+
|
|
132
209
|
```bash
|
|
133
|
-
rev
|
|
210
|
+
rev diff # compare against last commit
|
|
211
|
+
# methods.md +142 words -38 words
|
|
212
|
+
# results.md +89 words -12 words
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Add references to `references.bib` (BibTeX format):
|
|
216
|
+
|
|
217
|
+
```bibtex
|
|
218
|
+
@article{Smith2020,
|
|
219
|
+
author = {Smith, Jane},
|
|
220
|
+
title = {Paper Title},
|
|
221
|
+
journal = {Nature},
|
|
222
|
+
year = {2020},
|
|
223
|
+
doi = {10.1038/example}
|
|
224
|
+
}
|
|
134
225
|
```
|
|
135
226
|
|
|
136
|
-
|
|
137
|
-
- `paper.docx` (clean)
|
|
138
|
-
- `paper_comments.docx` (with comment threads)
|
|
227
|
+
Cite with `[@Smith2020]` or `[@Smith2020; @Jones2021]` for multiple sources.
|
|
139
228
|
|
|
140
|
-
|
|
229
|
+
Equations use LaTeX: inline `$E = mc^2$` or display `$$\sum_{i=1}^{n} x_i$$`.
|
|
230
|
+
|
|
231
|
+
Cross-references: `@fig:label`, `@tbl:label`, `@eq:label` → "Figure 1", "Table 2", "Equation 3".
|
|
232
|
+
|
|
233
|
+
## Command Reference
|
|
141
234
|
|
|
142
235
|
| Task | Command |
|
|
143
236
|
|------|---------|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
237
|
+
| Create project | `rev new my-project` |
|
|
238
|
+
| Create LaTeX project | `rev new my-project --template latex` |
|
|
239
|
+
| Import Word document | `rev import manuscript.docx` |
|
|
240
|
+
| Extract Word equations | `rev equations from-word doc.docx` |
|
|
241
|
+
| Build DOCX | `rev build docx` |
|
|
147
242
|
| Build PDF | `rev build pdf` |
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
243
|
+
| Build clean + annotated | `rev build docx --dual` |
|
|
244
|
+
| Sync Word feedback | `rev sync reviewed.docx` |
|
|
245
|
+
| Sync PDF comments | `rev sync annotated.pdf` |
|
|
246
|
+
| Extract PDF comments | `rev pdf-comments annotated.pdf` |
|
|
247
|
+
| Extract with highlighted text | `rev pdf-comments file.pdf --with-text` |
|
|
248
|
+
| Project status | `rev status` |
|
|
249
|
+
| Next pending comment | `rev next` |
|
|
250
|
+
| List pending comments | `rev todo` |
|
|
251
|
+
| Filter by author | `rev comments file.md --author "Reviewer 2"` |
|
|
252
|
+
| Accept all changes | `rev accept file.md -a` |
|
|
253
|
+
| Reject change | `rev reject file.md -n 1` |
|
|
254
|
+
| Reply to comment | `rev reply file.md -n 1 -m "response"` |
|
|
255
|
+
| Reply to all pending | `rev reply file.md --all -m "Addressed"` |
|
|
256
|
+
| Resolve comment | `rev resolve file.md -n 1` |
|
|
257
|
+
| Show contributors | `rev contributors` |
|
|
258
|
+
| Lookup ORCID | `rev orcid 0000-0002-1825-0097` |
|
|
259
|
+
| Archive reviewer files | `rev archive` |
|
|
260
|
+
| Check DOIs | `rev doi check references.bib` |
|
|
261
|
+
| Find missing DOIs | `rev doi lookup references.bib` |
|
|
262
|
+
| Add citation from DOI | `rev doi add 10.1038/example` |
|
|
263
|
+
| Word count | `rev wc` |
|
|
264
|
+
| Pre-submission check | `rev check` |
|
|
265
|
+
| Check for updates | `rev upgrade --check` |
|
|
266
|
+
|
|
267
|
+
Run `rev help` to see all commands, or `rev help <command>` for details on a specific command.
|
|
268
|
+
|
|
269
|
+
Full command reference: [docs/commands.md](docs/commands.md)
|
|
270
|
+
|
|
271
|
+
## Claude Code Skill
|
|
272
|
+
|
|
273
|
+
Install the docrev skill for [Claude Code](https://claude.ai/code):
|
|
154
274
|
|
|
155
|
-
|
|
275
|
+
```bash
|
|
276
|
+
rev install-cli-skill # install to ~/.claude/skills/docrev
|
|
277
|
+
rev uninstall-cli-skill # remove
|
|
278
|
+
```
|
|
156
279
|
|
|
157
|
-
|
|
280
|
+
Once installed, Claude understands docrev commands and can help navigate comments, draft replies, and manage your revision cycle.
|
|
158
281
|
|
|
159
|
-
|
|
160
|
-
- Pandoc
|
|
282
|
+
## Installing Dependencies
|
|
161
283
|
|
|
162
|
-
|
|
163
|
-
# macOS
|
|
164
|
-
brew install pandoc
|
|
284
|
+
### Pandoc
|
|
165
285
|
|
|
166
|
-
|
|
167
|
-
winget install JohnMacFarlane.Pandoc
|
|
286
|
+
[Pandoc](https://pandoc.org) handles document conversion.
|
|
168
287
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
288
|
+
| Platform | Command |
|
|
289
|
+
|----------|---------|
|
|
290
|
+
| macOS | `brew install pandoc` |
|
|
291
|
+
| Windows | `winget install JohnMacFarlane.Pandoc` |
|
|
292
|
+
| Debian/Ubuntu | `sudo apt install pandoc` |
|
|
293
|
+
| Fedora | `sudo dnf install pandoc` |
|
|
294
|
+
|
|
295
|
+
Other platforms: [pandoc.org/installing](https://pandoc.org/installing.html)
|
|
296
|
+
|
|
297
|
+
### LaTeX (for PDF output)
|
|
298
|
+
|
|
299
|
+
| Platform | Command |
|
|
300
|
+
|----------|---------|
|
|
301
|
+
| macOS | `brew install --cask mactex` |
|
|
302
|
+
| Windows | `winget install MiKTeX.MiKTeX` |
|
|
303
|
+
| Debian/Ubuntu | `sudo apt install texlive-full` |
|
|
304
|
+
| Fedora | `sudo dnf install texlive-scheme-full` |
|
|
305
|
+
|
|
306
|
+
Alternatively, [TinyTeX](https://yihui.org/tinytex/) provides a minimal distribution that downloads packages on demand.
|
|
172
307
|
|
|
173
308
|
## License
|
|
174
309
|
|