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 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
  [![npm](https://img.shields.io/npm/v/docrev)](https://www.npmjs.com/package/docrev)
4
+ [![npm downloads](https://img.shields.io/npm/dm/docrev)](https://www.npmjs.com/package/docrev)
5
+ [![node](https://img.shields.io/node/v/docrev)](https://nodejs.org)
4
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ [![CI](https://github.com/gcol33/docrev/actions/workflows/ci.yml/badge.svg)](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
5
8
 
6
- Write scientific papers in Markdown. Generate Word documents for collaborators. Import their feedback. Repeat.
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
- Markdown ──► docrev ──► Word/PDF ──► Collaborators
10
- ▲ │
11
- └─────────── docrev ◄─────────────────────┘
12
- (import feedback)
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
- Scientific papers go through many revision cycles with collaborators and reviewers. Track changes become unreadable, versions multiply, equations break when copying, figures get embedded at wrong resolutions. docrev keeps your source in plain Markdown under version control while generating Word documents for the review cycle. Your collaborators keep using Word as usual. You handle conversion on your end.
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
- ## Start a Project
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
+ ![Temperature anomalies](figures/temperature.png){#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 new my-paper
29
- cd my-paper
63
+ rev build docx # → paper.docx (for collaborators)
64
+ rev build pdf # → paper.pdf (for journals)
30
65
  ```
31
66
 
32
- From existing Word document:
67
+ When collaborators return the Word doc with track changes:
68
+
33
69
  ```bash
34
- rev import manuscript.docx
70
+ rev sync reviewed.docx # their comments → your markdown
35
71
  ```
36
72
 
37
- Project structure:
73
+ ## How It Works
74
+
38
75
  ```
39
- my-paper/
40
- ├── introduction.md
41
- ├── methods.md
42
- ├── results.md
43
- ├── discussion.md
44
- ├── references.bib
45
- └── rev.yaml
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
- ## Markdown Basics
88
+ You stay in Markdown. Collaborators use Word. Journals get PDF. Everyone works in their preferred format.
49
89
 
50
- ```markdown
51
- # Heading
90
+ ## The CLI Review Cycle
91
+
92
+ When reviewers send back a Word document with track changes and comments:
52
93
 
53
- Paragraph text. **Bold** and *italic*.
94
+ ```bash
95
+ rev sync reviewed.docx # import feedback into markdown
96
+ ```
54
97
 
55
- - Bullet point
56
- - Another point
98
+ Track changes appear inline - accept or reject by editing:
57
99
 
58
- 1. Numbered item
59
- 2. Second item
100
+ ```markdown
101
+ The sample size was {--100--}{++150++} participants.
60
102
  ```
61
103
 
62
- ### Citations
104
+ Handle comments without opening Word:
63
105
 
64
- references.bib:
65
- ```bibtex
66
- @article{Smith2020,
67
- author = {Smith, Jane},
68
- title = {Paper Title},
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
- In text:
75
- ```markdown
76
- Previous studies [@Smith2020] demonstrated this.
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
- Output: "Previous studies (Smith 2020) demonstrated this."
120
+ Your entire revision cycle stays in the terminal. `final_v3_REAL_final.docx` is over.
80
121
 
81
- ### Equations
122
+ ## Getting Started
82
123
 
83
- Inline: `$E = mc^2$`
124
+ ### Starting a New Document
84
125
 
85
- Display:
86
- ```markdown
87
- $$
88
- \hat{p} = \frac{\sum_d w_d p_d}{\sum_d w_d}
89
- $$
126
+ Create a new project:
127
+
128
+ ```bash
129
+ rev new my-report
130
+ cd my-report
90
131
  ```
91
132
 
92
- ### Figures
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
- ```markdown
95
- ![Study site locations](figures/map.png){#fig:map}
135
+ ```bash
136
+ rev new my-report -s intro,methods,results,discussion
137
+ ```
96
138
 
97
- Results shown in @fig:map indicate regional variation.
139
+ Or set your preferred default sections once:
140
+
141
+ ```bash
142
+ rev config sections "intro,methods,results,discussion"
98
143
  ```
99
144
 
100
- Output: "Results shown in Figure 1 indicate regional variation."
145
+ This creates a folder with your chosen sections:
101
146
 
102
- Figure numbers update automatically when reordered.
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
- ## Build
157
+ Write your content in the markdown files. When ready to share:
105
158
 
106
159
  ```bash
107
- rev build docx # Word document
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
- ## Handle Reviewer Feedback
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 sections reviewed.docx
170
+ rev import manuscript.docx
118
171
  ```
119
172
 
120
- View comments:
121
- ```bash
122
- rev comments methods.md
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
- Reply to comment:
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
- Rebuild with threaded comments:
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 build --dual
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
- Output:
137
- - `paper.docx` (clean)
138
- - `paper_comments.docx` (with comment threads)
227
+ Cite with `[@Smith2020]` or `[@Smith2020; @Jones2021]` for multiple sources.
139
228
 
140
- ## Commands
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
- | New project | `rev new my-paper` |
145
- | Import Word | `rev import manuscript.docx` |
146
- | Build Word | `rev build docx` |
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
- | Import feedback | `rev sections reviewed.docx` |
149
- | View comments | `rev comments methods.md` |
150
- | Reply to comment | `rev reply methods.md -n 1 -m "text"` |
151
- | Word count | `rev word-count` |
152
- | Validate DOIs | `rev doi check` |
153
- | Pre-submit check | `rev check` |
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
- Full reference: [docs/commands.md](docs/commands.md)
275
+ ```bash
276
+ rev install-cli-skill # install to ~/.claude/skills/docrev
277
+ rev uninstall-cli-skill # remove
278
+ ```
156
279
 
157
- ## Requirements
280
+ Once installed, Claude understands docrev commands and can help navigate comments, draft replies, and manage your revision cycle.
158
281
 
159
- - Node.js 18+
160
- - Pandoc
282
+ ## Installing Dependencies
161
283
 
162
- ```bash
163
- # macOS
164
- brew install pandoc
284
+ ### Pandoc
165
285
 
166
- # Windows
167
- winget install JohnMacFarlane.Pandoc
286
+ [Pandoc](https://pandoc.org) handles document conversion.
168
287
 
169
- # Linux
170
- sudo apt install pandoc
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