docrev 0.6.5 → 0.6.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/README.md +8 -11
- package/bin/rev.js +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
# docrev
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/docrev)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Why
|
|
8
|
-
|
|
9
|
-
Word documents corrupt. Versions multiply. Track changes become unreadable. Equations break. Figures embed at wrong resolutions.
|
|
10
|
-
|
|
11
|
-
docrev solves this: write in Markdown, generate Word/PDF for collaborators. They use Word normally. You get version control, clean diffs, and automated formatting.
|
|
6
|
+
Write scientific papers in Markdown. Generate Word documents for collaborators. Import their feedback. Repeat.
|
|
12
7
|
|
|
13
8
|
```
|
|
14
|
-
Markdown
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
Markdown ──► docrev ──► Word/PDF ──► Collaborators
|
|
10
|
+
▲ │
|
|
11
|
+
└─────────── docrev ◄─────────────────────┘
|
|
12
|
+
(import feedback)
|
|
18
13
|
```
|
|
19
14
|
|
|
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.
|
|
16
|
+
|
|
20
17
|
## Install
|
|
21
18
|
|
|
22
19
|
```bash
|
package/bin/rev.js
CHANGED
|
@@ -1683,7 +1683,11 @@ program
|
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
|
-
// Step 1:
|
|
1686
|
+
// Step 1: Strip track changes but keep comments for Word conversion
|
|
1687
|
+
// This applies {++insertions++}, removes {--deletions--}, keeps {>>comments<<}
|
|
1688
|
+
markdown = stripAnnotations(markdown, { keepComments: true });
|
|
1689
|
+
|
|
1690
|
+
// Step 2: Replace comments with markers
|
|
1687
1691
|
const spinMarkers = fmt.spinner('Preparing markers...').start();
|
|
1688
1692
|
const { markedMarkdown, comments } = prepareMarkdownWithMarkers(markdown);
|
|
1689
1693
|
spinMarkers.stop();
|
|
@@ -1691,11 +1695,11 @@ program
|
|
|
1691
1695
|
if (comments.length === 0) {
|
|
1692
1696
|
console.log(chalk.yellow('\nNo comments found - skipping comments DOCX'));
|
|
1693
1697
|
} else {
|
|
1694
|
-
// Step
|
|
1698
|
+
// Step 3: Write marked markdown to temp file
|
|
1695
1699
|
const markedPath = path.join(dir, '.paper-marked.md');
|
|
1696
1700
|
fs.writeFileSync(markedPath, markedMarkdown, 'utf-8');
|
|
1697
1701
|
|
|
1698
|
-
// Step
|
|
1702
|
+
// Step 4: Build DOCX from marked markdown using pandoc
|
|
1699
1703
|
const spinBuild = fmt.spinner('Building marked DOCX...').start();
|
|
1700
1704
|
const markedDocxPath = path.join(dir, '.paper-marked.docx');
|
|
1701
1705
|
const pandocResult = await runPandoc(markedPath, 'docx', config, { ...options, outputPath: markedDocxPath });
|
|
@@ -1704,7 +1708,7 @@ program
|
|
|
1704
1708
|
if (!pandocResult.success) {
|
|
1705
1709
|
console.error(chalk.yellow(`\nWarning: Could not build marked DOCX: ${pandocResult.error}`));
|
|
1706
1710
|
} else {
|
|
1707
|
-
// Step
|
|
1711
|
+
// Step 5: Replace markers with comment ranges
|
|
1708
1712
|
const commentsDocxPath = docxResult.outputPath.replace(/\.docx$/, '_comments.docx');
|
|
1709
1713
|
const spinInject = fmt.spinner('Injecting comments at markers...').start();
|
|
1710
1714
|
const commentResult = await injectCommentsAtMarkers(markedDocxPath, comments, commentsDocxPath);
|