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.
Files changed (3) hide show
  1. package/README.md +8 -11
  2. package/bin/rev.js +8 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,22 +1,19 @@
1
1
  # docrev
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/docrev)](https://www.npmjs.com/package/docrev)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- **Write papers in plain text. Generate Word when needed.**
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 files --> docrev --> Word/PDF
15
- ^ |
16
- | v
17
- +---- docrev <---- reviewer feedback
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: Replace comments with markers
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 2: Write marked markdown to temp file
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 3: Build DOCX from marked markdown using pandoc
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 4: Replace markers with comment ranges
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docrev",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Academic paper revision workflow: Word ↔ Markdown round-trips, DOI validation, reviewer comments",
5
5
  "type": "module",
6
6
  "types": "types/index.d.ts",