docrev 0.6.3 → 0.6.4
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/README.md +249 -76
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,118 +1,291 @@
|
|
|
1
1
|
# docrev
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/docrev)
|
|
4
|
-
[](https://nodejs.org/)
|
|
5
|
-
[](https://opensource.org/licenses/MIT)
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
**Write your papers in plain text. Generate Word documents when you need them.**
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
You're writing a scientific paper. Your supervisor reviews it in Word, adding comments and track changes. You address the feedback, send it back. Another round of reviews. Then journal submission. Then reviewer comments. More Word documents flying back and forth.
|
|
10
|
+
|
|
11
|
+
Sound familiar?
|
|
12
|
+
|
|
13
|
+
- Word files get corrupted
|
|
14
|
+
- "Which version is the latest?" confusion
|
|
15
|
+
- Track changes become unreadable after multiple rounds
|
|
16
|
+
- Equations break when copy-pasting
|
|
17
|
+
- Figures get embedded at wrong resolutions
|
|
18
|
+
- Collaborating means emailing files back and forth
|
|
19
|
+
|
|
20
|
+
## The Solution
|
|
21
|
+
|
|
22
|
+
**docrev** lets you write in plain text (Markdown) and generate Word/PDF whenever you need to share. Your collaborators keep using Word — they don't need to change anything. You get:
|
|
23
|
+
|
|
24
|
+
- **Version control** — See exactly what changed, when, and why
|
|
25
|
+
- **No corruption** — Plain text files never break
|
|
26
|
+
- **Equations that work** — Write LaTeX, get perfect equations in Word
|
|
27
|
+
- **Figures stay separate** — Reference images, don't embed them
|
|
28
|
+
- **Automated formatting** — Citations, cross-references, all handled
|
|
29
|
+
|
|
30
|
+
## How It Works
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Your text files ───► docrev ───► Word/PDF for collaborators
|
|
34
|
+
│ │
|
|
35
|
+
│ ▼
|
|
36
|
+
│ They add comments
|
|
37
|
+
│ │
|
|
38
|
+
│ ▼
|
|
39
|
+
└────────────── docrev ◄──── They send it back
|
|
40
|
+
(imports their feedback)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You always work in plain text. Word is just the delivery format.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
### Install
|
|
10
50
|
|
|
11
51
|
```bash
|
|
12
52
|
npm install -g docrev
|
|
53
|
+
brew install pandoc # Required for Word/PDF generation
|
|
13
54
|
```
|
|
14
55
|
|
|
15
|
-
|
|
56
|
+
### Start a New Paper
|
|
16
57
|
|
|
17
58
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
59
|
+
rev new my-paper
|
|
60
|
+
cd my-paper
|
|
61
|
+
```
|
|
20
62
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
63
|
+
This creates:
|
|
64
|
+
```
|
|
65
|
+
my-paper/
|
|
66
|
+
├── introduction.md ← Write your intro here
|
|
67
|
+
├── methods.md ← Your methods
|
|
68
|
+
├── results.md ← Your results
|
|
69
|
+
├── discussion.md ← Your discussion
|
|
70
|
+
├── references.bib ← Your citations
|
|
71
|
+
└── rev.yaml ← Paper title, authors
|
|
24
72
|
```
|
|
25
73
|
|
|
26
|
-
|
|
74
|
+
### Or Import from Existing Word Document
|
|
27
75
|
|
|
28
76
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
77
|
+
rev import my-manuscript.docx
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
docrev extracts:
|
|
81
|
+
- Text → Markdown files
|
|
82
|
+
- Comments → Preserved with author names
|
|
83
|
+
- Equations → Converted to LaTeX
|
|
84
|
+
- Images → Saved to figures/
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Writing in Markdown
|
|
89
|
+
|
|
90
|
+
Markdown is just text with simple formatting. If you can write an email, you can write Markdown.
|
|
91
|
+
|
|
92
|
+
### Basic Formatting
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
# This is a Heading
|
|
96
|
+
|
|
97
|
+
This is a paragraph. **Bold text** and *italic text*.
|
|
98
|
+
|
|
99
|
+
- Bullet point
|
|
100
|
+
- Another bullet
|
|
101
|
+
|
|
102
|
+
1. Numbered list
|
|
103
|
+
2. Second item
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Citations
|
|
107
|
+
|
|
108
|
+
In your `.bib` file:
|
|
109
|
+
```bibtex
|
|
110
|
+
@article{Smith2020,
|
|
111
|
+
author = {Smith, Jane},
|
|
112
|
+
title = {My Paper Title},
|
|
113
|
+
journal = {Nature},
|
|
114
|
+
year = {2020}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
In your text:
|
|
119
|
+
```markdown
|
|
120
|
+
Previous studies have shown this effect [@Smith2020].
|
|
121
|
+
Multiple citations work too [@Smith2020; @Jones2021].
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
→ Becomes: "Previous studies have shown this effect (Smith 2020)."
|
|
125
|
+
|
|
126
|
+
### Equations
|
|
127
|
+
|
|
128
|
+
Inline: `$E = mc^2$` → E = mc²
|
|
129
|
+
|
|
130
|
+
Display equation:
|
|
131
|
+
```markdown
|
|
132
|
+
$$
|
|
133
|
+
\hat{p} = \frac{\sum_d w_d p_d}{\sum_d w_d}
|
|
134
|
+
$$
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Figures
|
|
138
|
+
|
|
139
|
+
```markdown
|
|
140
|
+
{#fig:map}
|
|
141
|
+
|
|
142
|
+
As shown in @fig:map, our study sites span 12 countries.
|
|
143
|
+
```
|
|
31
144
|
|
|
32
|
-
|
|
33
|
-
rev import manuscript.docx
|
|
145
|
+
→ In Word: "As shown in Figure 1, our study sites..."
|
|
34
146
|
|
|
35
|
-
|
|
147
|
+
The figure number updates automatically if you reorder figures.
|
|
36
148
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Build Your Document
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
rev build docx # Generate Word document
|
|
155
|
+
rev build pdf # Generate PDF
|
|
156
|
+
rev build --dual # Both clean + with-comments versions
|
|
41
157
|
```
|
|
42
158
|
|
|
43
|
-
|
|
159
|
+
### Preview While Writing
|
|
44
160
|
|
|
45
161
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
162
|
+
rev watch docx # Auto-rebuilds when you save
|
|
163
|
+
```
|
|
48
164
|
|
|
49
|
-
|
|
50
|
-
rev review methods.md
|
|
165
|
+
---
|
|
51
166
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
167
|
+
## Handle Reviewer Feedback
|
|
168
|
+
|
|
169
|
+
### 1. Receive Reviewed Document
|
|
55
170
|
|
|
56
|
-
|
|
57
|
-
|
|
171
|
+
Your supervisor sends back `manuscript_reviewed.docx` with comments and track changes.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
rev sections manuscript_reviewed.docx
|
|
58
175
|
```
|
|
59
176
|
|
|
60
|
-
|
|
177
|
+
This imports their changes into your Markdown files.
|
|
61
178
|
|
|
62
|
-
|
|
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
|
|
179
|
+
### 2. See Their Comments
|
|
69
180
|
|
|
70
|
-
|
|
181
|
+
```bash
|
|
182
|
+
rev comments methods.md
|
|
183
|
+
```
|
|
71
184
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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 |
|
|
185
|
+
Output:
|
|
186
|
+
```
|
|
187
|
+
#1 [Dr. Smith] line 45
|
|
188
|
+
"Please clarify the sampling methodology"
|
|
84
189
|
|
|
85
|
-
|
|
190
|
+
#2 [Dr. Smith] line 78
|
|
191
|
+
"Add a citation here"
|
|
192
|
+
```
|
|
86
193
|
|
|
87
|
-
|
|
194
|
+
### 3. Reply to Comments
|
|
88
195
|
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{~~old~>new~~} # Substitutions
|
|
93
|
-
{>>Author: comment<<} # Comments
|
|
196
|
+
```bash
|
|
197
|
+
rev config user "Your Name" # Set your name (once)
|
|
198
|
+
rev reply methods.md -n 1 -m "Added detail about random sampling in paragraph 2"
|
|
94
199
|
```
|
|
95
200
|
|
|
96
|
-
|
|
201
|
+
### 4. Rebuild and Send Back
|
|
97
202
|
|
|
203
|
+
```bash
|
|
204
|
+
rev build --dual
|
|
98
205
|
```
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
206
|
+
|
|
207
|
+
Creates:
|
|
208
|
+
- `paper.docx` — Clean version
|
|
209
|
+
- `paper_comments.docx` — With threaded comment conversations
|
|
210
|
+
|
|
211
|
+
Your reply appears under their comment, just like a conversation in Word.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Why Separate Files?
|
|
216
|
+
|
|
217
|
+
Instead of one giant document, docrev uses separate files for each section:
|
|
218
|
+
|
|
219
|
+
| File | Content |
|
|
220
|
+
|------|---------|
|
|
221
|
+
| `introduction.md` | Background, aims, hypotheses |
|
|
222
|
+
| `methods.md` | Study design, analysis |
|
|
223
|
+
| `results.md` | Findings |
|
|
224
|
+
| `discussion.md` | Interpretation |
|
|
225
|
+
|
|
226
|
+
**Benefits:**
|
|
227
|
+
- Easier to navigate
|
|
228
|
+
- Work on one section without scrolling
|
|
229
|
+
- Git shows changes per section
|
|
230
|
+
- Collaborators can review specific parts
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Commands Reference
|
|
235
|
+
|
|
236
|
+
| What you want to do | Command |
|
|
237
|
+
|---------------------|---------|
|
|
238
|
+
| Create new paper | `rev new my-paper` |
|
|
239
|
+
| Import from Word | `rev import manuscript.docx` |
|
|
240
|
+
| Build Word doc | `rev build docx` |
|
|
241
|
+
| Build PDF | `rev build pdf` |
|
|
242
|
+
| Import reviewer feedback | `rev sections reviewed.docx` |
|
|
243
|
+
| See all comments | `rev comments methods.md` |
|
|
244
|
+
| Reply to comment #1 | `rev reply methods.md -n 1 -m "Fixed"` |
|
|
245
|
+
| Check word count | `rev word-count` |
|
|
246
|
+
| Validate DOIs | `rev doi check` |
|
|
247
|
+
| Check before submission | `rev check` |
|
|
248
|
+
|
|
249
|
+
See [full documentation](docs/commands.md) for all commands.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Requirements
|
|
254
|
+
|
|
255
|
+
- **Node.js 18+** — [Download](https://nodejs.org/)
|
|
256
|
+
- **Pandoc** — Converts Markdown to Word/PDF
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# macOS
|
|
260
|
+
brew install pandoc
|
|
261
|
+
|
|
262
|
+
# Windows
|
|
263
|
+
winget install JohnMacFarlane.Pandoc
|
|
264
|
+
|
|
265
|
+
# Linux
|
|
266
|
+
sudo apt install pandoc
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## FAQ
|
|
272
|
+
|
|
273
|
+
**Q: Do my collaborators need to install docrev?**
|
|
274
|
+
No. They keep using Word normally. You handle the conversion.
|
|
275
|
+
|
|
276
|
+
**Q: Can I use my existing Word document?**
|
|
277
|
+
Yes. `rev import manuscript.docx` converts it to Markdown.
|
|
278
|
+
|
|
279
|
+
**Q: What about my bibliography?**
|
|
280
|
+
Use a `.bib` file (export from Zotero/Mendeley/EndNote). Citations are handled automatically.
|
|
281
|
+
|
|
282
|
+
**Q: Will equations look right in Word?**
|
|
283
|
+
Yes. LaTeX equations are converted to native Word equations.
|
|
284
|
+
|
|
285
|
+
**Q: What if I make a mistake?**
|
|
286
|
+
Plain text + Git means you can always go back. Run `rev backup` before big changes.
|
|
287
|
+
|
|
288
|
+
---
|
|
116
289
|
|
|
117
290
|
## License
|
|
118
291
|
|