docrev 0.6.13 → 0.7.7

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
@@ -6,180 +6,213 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![CI](https://github.com/gcol33/docrev/actions/workflows/ci.yml/badge.svg)](https://github.com/gcol33/docrev/actions/workflows/ci.yml)
8
8
 
9
- A CLI for writing scientific papers in Markdown while collaborating with Word users.
9
+ A CLI for writing documents in Markdown while collaborating with Word users.
10
10
 
11
- You write in Markdown under version control. Your collaborators use Word. docrev converts between the two, preserving track changes, comments, equations, and cross-references.
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
12
 
13
- ## Install
13
+ ## The Problem
14
14
 
15
- ```bash
16
- npm install -g docrev
17
- brew install pandoc
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
18
24
  ```
19
25
 
20
- Pandoc is required for document conversion. On Windows use `winget install JohnMacFarlane.Pandoc`, on Linux use `apt install pandoc`.
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.
21
27
 
22
- ## Getting Started
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.
23
29
 
24
- ### Starting from a Word Document
30
+ ## Highlights
25
31
 
26
- If you have an existing manuscript in Word:
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
27
40
 
28
41
  ```bash
29
- rev import manuscript.docx
42
+ npm install -g docrev
30
43
  ```
31
44
 
32
- This converts your document to markdown, splitting it into sections:
45
+ Requires [Node.js](https://nodejs.org) 18+, [Pandoc](https://pandoc.org) 2.11+, and [LaTeX](#installing-dependencies) for PDF output.
33
46
 
34
- ```
35
- my-paper/
36
- ├── introduction.md
37
- ├── methods.md
38
- ├── results.md
39
- ├── discussion.md
40
- ├── references.bib
41
- └── rev.yaml
42
- ```
47
+ ## Quick Example
43
48
 
44
- Track changes and comments from the Word document are preserved as annotations in the markdown files (see below).
49
+ Write in Markdown with citations and cross-references:
45
50
 
46
- ### Starting from Scratch
51
+ ```markdown
52
+ Climate change poses significant challenges [@IPCC2021]. As shown in
53
+ @fig:temperature, global temperatures have risen steadily.
47
54
 
48
- To start a new paper in markdown:
55
+ ![Temperature anomalies](figures/temperature.png){#fig:temperature}
49
56
 
50
- ```bash
51
- rev new my-paper
52
- cd my-paper
57
+ The relationship follows $\Delta T = \lambda \cdot \Delta F$ (@eq:forcing).
53
58
  ```
54
59
 
55
- This creates the same project structure with empty section files. Write your paper in the markdown files, then build Word documents to share with collaborators.
60
+ Build and share:
56
61
 
57
- ## The Revision Cycle
58
-
59
- ### 1. Build and Share
62
+ ```bash
63
+ rev build docx # → paper.docx (for collaborators)
64
+ rev build pdf # paper.pdf (for journals)
65
+ ```
60
66
 
61
- Generate a Word document from your markdown:
67
+ When collaborators return the Word doc with track changes:
62
68
 
63
69
  ```bash
64
- rev build docx
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
65
86
  ```
66
87
 
67
- Send this to your collaborators. They review it in Word, adding comments and track changes as usual.
88
+ You stay in Markdown. Collaborators use Word. Journals get PDF. Everyone works in their preferred format.
68
89
 
69
- ### 2. Import Feedback
90
+ ## The CLI Review Cycle
70
91
 
71
- When collaborators return the reviewed document, import their feedback:
92
+ When reviewers send back a Word document with track changes and comments:
72
93
 
73
94
  ```bash
74
- rev sections reviewed.docx
95
+ rev sync reviewed.docx # import feedback into markdown
75
96
  ```
76
97
 
77
- This updates your markdown files with their comments and track changes, converted to inline annotations.
98
+ Track changes appear inline - accept or reject by editing:
78
99
 
79
- ### 3. Review Track Changes
100
+ ```markdown
101
+ The sample size was {--100--}{++150++} participants.
102
+ ```
80
103
 
81
- Track changes appear as inline annotations in your markdown:
104
+ Handle comments without opening Word:
82
105
 
83
- ```markdown
84
- The sample size was {--100--}{++150++} individuals.
85
- We collected data {~~monthly~>weekly~~} from each site.
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
86
111
  ```
87
112
 
88
- - `{++text++}` inserted text
89
- - `{--text--}` — deleted text
90
- - `{~~old~>new~~}` — substitution
113
+ Reviewers who annotate PDFs instead of Word? That works too:
91
114
 
92
- To accept a change, keep the new text and delete the markup. To reject it, keep the old text. When you're done, the file is clean markdown.
115
+ ```bash
116
+ rev sync annotated.pdf # extract PDF comments
117
+ rev pdf-comments annotated.pdf --append methods.md
118
+ ```
93
119
 
94
- ### 4. Respond to Comments
120
+ Your entire revision cycle stays in the terminal. `final_v3_REAL_final.docx` is over.
95
121
 
96
- Comments appear inline in your markdown:
122
+ ## Getting Started
97
123
 
98
- ```markdown
99
- We used a random sampling approach.
100
- {>>Reviewer 2: Please clarify the sampling method.<<}
101
- ```
124
+ ### Starting a New Document
102
125
 
103
- List all comments in a file:
126
+ Create a new project:
104
127
 
105
128
  ```bash
106
- rev comments methods.md
129
+ rev new my-report
130
+ cd my-report
107
131
  ```
108
132
 
109
- Reply from the command line:
133
+ You'll be prompted to enter your section names, or press Enter to use the default structure. You can also specify sections directly:
110
134
 
111
135
  ```bash
112
- rev config user "Your Name" # one-time setup
113
- rev reply methods.md -n 1 -m "Added clarification in paragraph 2"
136
+ rev new my-report -s intro,methods,results,discussion
114
137
  ```
115
138
 
116
- Your reply threads beneath the original:
139
+ Or set your preferred default sections once:
117
140
 
118
- ```markdown
119
- We used a random sampling approach.
120
- {>>Reviewer 2: Please clarify the sampling method.<<}
121
- {>>Your Name: Added clarification in paragraph 2.<<}
141
+ ```bash
142
+ rev config sections "intro,methods,results,discussion"
122
143
  ```
123
144
 
124
- Mark comments as resolved:
145
+ This creates a folder with your chosen sections:
125
146
 
126
- ```bash
127
- rev resolve methods.md -n 1
147
+ ```
148
+ my-report/
149
+ ├── intro.md
150
+ ├── methods.md
151
+ ├── results.md
152
+ ├── discussion.md
153
+ ├── references.bib
154
+ └── rev.yaml
128
155
  ```
129
156
 
130
- ### 5. Rebuild with Comment Threads
131
-
132
- Generate both a clean version and one showing the comment threads:
157
+ Write your content in the markdown files. When ready to share:
133
158
 
134
159
  ```bash
135
- rev build --dual
160
+ rev build docx
136
161
  ```
137
162
 
138
- This produces:
139
- - `paper.docx` — clean, for submission
140
- - `paper_comments.docx` — includes comment threads as Word comments
163
+ This produces `my-report.docx` with citations resolved, equations rendered, and cross-references numbered. Use `rev build pdf` for PDF output instead.
141
164
 
142
- Your collaborators see the full conversation in the comments pane.
165
+ ### Starting from an Existing Word Document
143
166
 
144
- ### 6. Repeat
167
+ If you have a Word document to convert:
145
168
 
146
- Send the updated Word document. Import new feedback with `rev sections`. Continue until done.
169
+ ```bash
170
+ rev import manuscript.docx
171
+ ```
147
172
 
148
- ## Before Submission
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.
149
174
 
150
- ### Validate Your Bibliography
175
+ ### Configuration
151
176
 
152
- Check that DOIs in your bibliography resolve correctly:
177
+ Layout is controlled in `rev.yaml`:
153
178
 
154
- ```bash
155
- rev doi check references.bib
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
156
187
  ```
157
188
 
158
- Find DOIs for entries missing them:
189
+ Configure your name for comment replies:
159
190
 
160
191
  ```bash
161
- rev doi lookup references.bib
192
+ rev config user "Your Name"
162
193
  ```
163
194
 
164
- Add a citation directly from a DOI:
195
+ ## Annotation Syntax
165
196
 
166
- ```bash
167
- rev doi add 10.1038/s41586-020-2649-2
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
168
203
  ```
169
204
 
170
- ### Run Pre-Submission Checks
205
+ ## Writing Tips
171
206
 
172
- Check for broken references, missing citations, and common issues:
207
+ Track word count changes between versions:
173
208
 
174
209
  ```bash
175
- rev check
210
+ rev diff # compare against last commit
211
+ # methods.md +142 words -38 words
212
+ # results.md +89 words -12 words
176
213
  ```
177
214
 
178
- ## Writing in Markdown
179
-
180
- ### Citations
181
-
182
- Add references to `references.bib`:
215
+ Add references to `references.bib` (BibTeX format):
183
216
 
184
217
  ```bibtex
185
218
  @article{Smith2020,
@@ -191,61 +224,86 @@ Add references to `references.bib`:
191
224
  }
192
225
  ```
193
226
 
194
- Cite in text:
227
+ Cite with `[@Smith2020]` or `[@Smith2020; @Jones2021]` for multiple sources.
195
228
 
196
- ```markdown
197
- Previous work [@Smith2020] established this relationship.
198
- Multiple sources support this [@Smith2020; @Jones2021].
199
- ```
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".
200
232
 
201
- ### Equations
233
+ ## Command Reference
202
234
 
203
- Inline equations use single dollar signs: `$E = mc^2$`
235
+ | Task | Command |
236
+ |------|---------|
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` |
242
+ | Build PDF | `rev build pdf` |
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` |
204
266
 
205
- Display equations use double dollar signs:
267
+ Run `rev help` to see all commands, or `rev help <command>` for details on a specific command.
206
268
 
207
- ```markdown
208
- $$
209
- \bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i
210
- $$
211
- ```
269
+ Full command reference: [docs/commands.md](docs/commands.md)
212
270
 
213
- ### Figures and Cross-References
271
+ ## Claude Code Skill
214
272
 
215
- ```markdown
216
- ![Study site locations](figures/map.png){#fig:map}
273
+ Install the docrev skill for [Claude Code](https://claude.ai/code):
217
274
 
218
- Results are shown in @fig:map.
275
+ ```bash
276
+ rev install-cli-skill # install to ~/.claude/skills/docrev
277
+ rev uninstall-cli-skill # remove
219
278
  ```
220
279
 
221
- The reference `@fig:map` becomes "Figure 1" in the output. Numbers update automatically when figures are reordered.
280
+ Once installed, Claude understands docrev commands and can help navigate comments, draft replies, and manage your revision cycle.
222
281
 
223
- Tables and equations work the same way with `@tbl:label` and `@eq:label`.
282
+ ## Installing Dependencies
224
283
 
225
- ## Useful Commands
284
+ ### Pandoc
226
285
 
227
- | Task | Command |
228
- |------|---------|
229
- | Start new project | `rev new my-paper` |
230
- | Import Word document | `rev import manuscript.docx` |
231
- | Import feedback | `rev sections reviewed.docx` |
232
- | List comments | `rev comments methods.md` |
233
- | Reply to comment | `rev reply methods.md -n 1 -m "response"` |
234
- | Build Word | `rev build docx` |
235
- | Build PDF | `rev build pdf` |
236
- | Build both clean and annotated | `rev build --dual` |
237
- | Check DOIs | `rev doi check references.bib` |
238
- | Find missing DOIs | `rev doi lookup references.bib` |
239
- | Word count | `rev word-count` |
240
- | Pre-submission check | `rev check` |
241
- | Watch for changes | `rev watch docx` |
286
+ [Pandoc](https://pandoc.org) handles document conversion.
242
287
 
243
- Full command reference: [docs/commands.md](docs/commands.md)
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)
244
298
 
245
- ## Requirements
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` |
246
305
 
247
- - Node.js 18+
248
- - Pandoc 2.11+
306
+ Alternatively, [TinyTeX](https://yihui.org/tinytex/) provides a minimal distribution that downloads packages on demand.
249
307
 
250
308
  ## License
251
309