docrev 0.9.13 → 0.9.15

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 (126) hide show
  1. package/.claude/settings.local.json +9 -9
  2. package/.gitattributes +1 -1
  3. package/CHANGELOG.md +149 -149
  4. package/PLAN-tables-and-postprocess.md +850 -850
  5. package/README.md +411 -391
  6. package/bin/rev.js +11 -11
  7. package/bin/rev.ts +145 -145
  8. package/completions/rev.bash +127 -127
  9. package/completions/rev.ps1 +210 -210
  10. package/completions/rev.zsh +207 -207
  11. package/dev_notes/stress2/build_adversarial.ts +186 -186
  12. package/dev_notes/stress2/drift_matcher.ts +62 -62
  13. package/dev_notes/stress2/probe_anchors.ts +35 -35
  14. package/dev_notes/stress2/project/discussion.before.md +3 -3
  15. package/dev_notes/stress2/project/discussion.md +3 -3
  16. package/dev_notes/stress2/project/methods.before.md +20 -20
  17. package/dev_notes/stress2/project/methods.md +20 -20
  18. package/dev_notes/stress2/project/rev.yaml +5 -5
  19. package/dev_notes/stress2/project/sections.yaml +4 -4
  20. package/dev_notes/stress2/sections.yaml +5 -5
  21. package/dev_notes/stress2/trace_placement.ts +50 -50
  22. package/dev_notes/stresstest_boundaries.ts +27 -27
  23. package/dev_notes/stresstest_drift_apply.ts +43 -43
  24. package/dev_notes/stresstest_drift_compare.ts +43 -43
  25. package/dev_notes/stresstest_drift_v2.ts +54 -54
  26. package/dev_notes/stresstest_inspect.ts +54 -54
  27. package/dev_notes/stresstest_pstyle.ts +55 -55
  28. package/dev_notes/stresstest_section_debug.ts +23 -23
  29. package/dev_notes/stresstest_split.ts +70 -70
  30. package/dev_notes/stresstest_trace.ts +19 -19
  31. package/dev_notes/stresstest_verify_no_overwrite.ts +40 -40
  32. package/dist/lib/build.d.ts +38 -1
  33. package/dist/lib/build.d.ts.map +1 -1
  34. package/dist/lib/build.js +68 -30
  35. package/dist/lib/build.js.map +1 -1
  36. package/dist/lib/commands/build.d.ts.map +1 -1
  37. package/dist/lib/commands/build.js +38 -5
  38. package/dist/lib/commands/build.js.map +1 -1
  39. package/dist/lib/commands/utilities.js +164 -164
  40. package/dist/lib/commands/word-tools.js +8 -8
  41. package/dist/lib/grammar.js +3 -3
  42. package/dist/lib/pdf-comments.js +44 -44
  43. package/dist/lib/plugins.js +57 -57
  44. package/dist/lib/pptx-themes.js +115 -115
  45. package/dist/lib/spelling.js +2 -2
  46. package/dist/lib/templates.js +387 -387
  47. package/dist/lib/themes.js +51 -51
  48. package/eslint.config.js +27 -27
  49. package/lib/anchor-match.ts +276 -276
  50. package/lib/annotations.ts +644 -644
  51. package/lib/build.ts +1300 -1251
  52. package/lib/citations.ts +160 -160
  53. package/lib/commands/build.ts +833 -801
  54. package/lib/commands/citations.ts +515 -515
  55. package/lib/commands/comments.ts +1050 -1050
  56. package/lib/commands/context.ts +174 -174
  57. package/lib/commands/core.ts +309 -309
  58. package/lib/commands/doi.ts +435 -435
  59. package/lib/commands/file-ops.ts +372 -372
  60. package/lib/commands/history.ts +320 -320
  61. package/lib/commands/index.ts +87 -87
  62. package/lib/commands/init.ts +259 -259
  63. package/lib/commands/merge-resolve.ts +378 -378
  64. package/lib/commands/preview.ts +178 -178
  65. package/lib/commands/project-info.ts +244 -244
  66. package/lib/commands/quality.ts +517 -517
  67. package/lib/commands/response.ts +454 -454
  68. package/lib/commands/section-boundaries.ts +82 -82
  69. package/lib/commands/sections.ts +451 -451
  70. package/lib/commands/sync.ts +706 -706
  71. package/lib/commands/text-ops.ts +449 -449
  72. package/lib/commands/utilities.ts +448 -448
  73. package/lib/commands/verify-anchors.ts +272 -272
  74. package/lib/commands/word-tools.ts +340 -340
  75. package/lib/comment-realign.ts +517 -517
  76. package/lib/config.ts +84 -84
  77. package/lib/crossref.ts +781 -781
  78. package/lib/csl.ts +191 -191
  79. package/lib/dependencies.ts +98 -98
  80. package/lib/diff-engine.ts +465 -465
  81. package/lib/doi-cache.ts +115 -115
  82. package/lib/doi.ts +897 -897
  83. package/lib/equations.ts +506 -506
  84. package/lib/errors.ts +346 -346
  85. package/lib/format.ts +541 -541
  86. package/lib/git.ts +326 -326
  87. package/lib/grammar.ts +303 -303
  88. package/lib/image-registry.ts +180 -180
  89. package/lib/import.ts +911 -911
  90. package/lib/journals.ts +543 -543
  91. package/lib/merge.ts +633 -633
  92. package/lib/orcid.ts +144 -144
  93. package/lib/pdf-comments.ts +263 -263
  94. package/lib/pdf-import.ts +524 -524
  95. package/lib/plugins.ts +362 -362
  96. package/lib/postprocess.ts +188 -188
  97. package/lib/pptx-color-filter.lua +37 -37
  98. package/lib/pptx-template.ts +469 -469
  99. package/lib/pptx-themes.ts +483 -483
  100. package/lib/protect-restore.ts +520 -520
  101. package/lib/rate-limiter.ts +94 -94
  102. package/lib/response.ts +197 -197
  103. package/lib/restore-references.ts +240 -240
  104. package/lib/review.ts +327 -327
  105. package/lib/schema.ts +417 -417
  106. package/lib/scientific-words.ts +73 -73
  107. package/lib/sections.ts +335 -335
  108. package/lib/slides.ts +756 -756
  109. package/lib/spelling.ts +334 -334
  110. package/lib/templates.ts +526 -526
  111. package/lib/themes.ts +742 -742
  112. package/lib/trackchanges.ts +247 -247
  113. package/lib/tui.ts +450 -450
  114. package/lib/types.ts +550 -550
  115. package/lib/undo.ts +250 -250
  116. package/lib/utils.ts +69 -69
  117. package/lib/variables.ts +179 -179
  118. package/lib/word-extraction.ts +806 -806
  119. package/lib/word.ts +643 -643
  120. package/lib/wordcomments.ts +817 -817
  121. package/package.json +137 -137
  122. package/scripts/postbuild.js +28 -28
  123. package/skill/REFERENCE.md +473 -431
  124. package/skill/SKILL.md +274 -258
  125. package/tsconfig.json +26 -26
  126. package/types/index.d.ts +525 -525
@@ -1,55 +1,55 @@
1
- // Inspect the document.xml paragraph styles to find true headings.
2
- import AdmZip from 'adm-zip';
3
- import * as fs from 'fs';
4
-
5
- const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
6
- const zip = new AdmZip(docx);
7
- const xml = zip.getEntry('word/document.xml')!.getData().toString('utf8');
8
-
9
- // Build text-position map from <w:t> runs the same way extractCommentAnchors does
10
- const textNodePattern = /<w:t[^>]*>([^<]*)<\/w:t>/g;
11
- const textNodes: Array<{ xmlStart: number; xmlEnd: number; textStart: number; textEnd: number; text: string }> = [];
12
- let textPosition = 0;
13
- let m;
14
- function decode(s: string): string {
15
- return s.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&apos;/g, "'");
16
- }
17
- while ((m = textNodePattern.exec(xml)) !== null) {
18
- const decoded = decode(m[1]);
19
- textNodes.push({ xmlStart: m.index, xmlEnd: m.index + m[0].length, textStart: textPosition, textEnd: textPosition + decoded.length, text: decoded });
20
- textPosition += decoded.length;
21
- }
22
-
23
- function xmlToText(xmlPos: number): number {
24
- for (const n of textNodes) {
25
- if (xmlPos >= n.xmlStart && xmlPos < n.xmlEnd) return n.textStart;
26
- if (xmlPos < n.xmlStart) return n.textStart;
27
- }
28
- return textNodes.length ? textNodes[textNodes.length - 1].textEnd : 0;
29
- }
30
-
31
- // Now walk paragraphs; each <w:p ...>...</w:p>. Inside, find <w:pStyle w:val="..."/> if present, and concatenate text runs.
32
- const paraPattern = /<w:p\b[^>]*>([\s\S]*?)<\/w:p>/g;
33
- const headings: Array<{ style: string; text: string; xmlStart: number; textPos: number }> = [];
34
- let pm;
35
- while ((pm = paraPattern.exec(xml)) !== null) {
36
- const inner = pm[1];
37
- const styleMatch = inner.match(/<w:pStyle[^>]*w:val="([^"]+)"/);
38
- if (!styleMatch) continue;
39
- const style = styleMatch[1];
40
- if (!/heading/i.test(style)) continue;
41
- // Extract text from runs
42
- const textInRange = /<w:t[^>]*>([^<]*)<\/w:t>/g;
43
- let txt = '';
44
- let tm;
45
- while ((tm = textInRange.exec(inner)) !== null) txt += decode(tm[1]);
46
- if (!txt.trim()) continue;
47
- const xmlStart = pm.index;
48
- const textPos = xmlToText(xmlStart);
49
- headings.push({ style, text: txt.trim(), xmlStart, textPos });
50
- }
51
-
52
- console.log(`Found ${headings.length} heading paragraphs:`);
53
- for (const h of headings) {
54
- console.log(` [${h.style.padEnd(8)}] textPos=${String(h.textPos).padStart(6)} "${h.text.slice(0, 60)}"`);
55
- }
1
+ // Inspect the document.xml paragraph styles to find true headings.
2
+ import AdmZip from 'adm-zip';
3
+ import * as fs from 'fs';
4
+
5
+ const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
6
+ const zip = new AdmZip(docx);
7
+ const xml = zip.getEntry('word/document.xml')!.getData().toString('utf8');
8
+
9
+ // Build text-position map from <w:t> runs the same way extractCommentAnchors does
10
+ const textNodePattern = /<w:t[^>]*>([^<]*)<\/w:t>/g;
11
+ const textNodes: Array<{ xmlStart: number; xmlEnd: number; textStart: number; textEnd: number; text: string }> = [];
12
+ let textPosition = 0;
13
+ let m;
14
+ function decode(s: string): string {
15
+ return s.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&apos;/g, "'");
16
+ }
17
+ while ((m = textNodePattern.exec(xml)) !== null) {
18
+ const decoded = decode(m[1]);
19
+ textNodes.push({ xmlStart: m.index, xmlEnd: m.index + m[0].length, textStart: textPosition, textEnd: textPosition + decoded.length, text: decoded });
20
+ textPosition += decoded.length;
21
+ }
22
+
23
+ function xmlToText(xmlPos: number): number {
24
+ for (const n of textNodes) {
25
+ if (xmlPos >= n.xmlStart && xmlPos < n.xmlEnd) return n.textStart;
26
+ if (xmlPos < n.xmlStart) return n.textStart;
27
+ }
28
+ return textNodes.length ? textNodes[textNodes.length - 1].textEnd : 0;
29
+ }
30
+
31
+ // Now walk paragraphs; each <w:p ...>...</w:p>. Inside, find <w:pStyle w:val="..."/> if present, and concatenate text runs.
32
+ const paraPattern = /<w:p\b[^>]*>([\s\S]*?)<\/w:p>/g;
33
+ const headings: Array<{ style: string; text: string; xmlStart: number; textPos: number }> = [];
34
+ let pm;
35
+ while ((pm = paraPattern.exec(xml)) !== null) {
36
+ const inner = pm[1];
37
+ const styleMatch = inner.match(/<w:pStyle[^>]*w:val="([^"]+)"/);
38
+ if (!styleMatch) continue;
39
+ const style = styleMatch[1];
40
+ if (!/heading/i.test(style)) continue;
41
+ // Extract text from runs
42
+ const textInRange = /<w:t[^>]*>([^<]*)<\/w:t>/g;
43
+ let txt = '';
44
+ let tm;
45
+ while ((tm = textInRange.exec(inner)) !== null) txt += decode(tm[1]);
46
+ if (!txt.trim()) continue;
47
+ const xmlStart = pm.index;
48
+ const textPos = xmlToText(xmlStart);
49
+ headings.push({ style, text: txt.trim(), xmlStart, textPos });
50
+ }
51
+
52
+ console.log(`Found ${headings.length} heading paragraphs:`);
53
+ for (const h of headings) {
54
+ console.log(` [${h.style.padEnd(8)}] textPos=${String(h.textPos).padStart(6)} "${h.text.slice(0, 60)}"`);
55
+ }
@@ -1,23 +1,23 @@
1
- import { extractCommentAnchors } from '../lib/import.js';
2
-
3
- const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
4
- const { fullDocText } = await extractCommentAnchors(docx);
5
-
6
- const keywords = ['Abstract', 'Introduction', 'Methods', 'Results', 'Discussion', 'Conclusion', 'References'];
7
- for (const kw of keywords) {
8
- const lower = fullDocText.toLowerCase();
9
- const needle = kw.toLowerCase();
10
- const occ: Array<{ idx: number; ctx: string; afterChar: string }> = [];
11
- let idx = 0;
12
- while ((idx = lower.indexOf(needle, idx)) !== -1) {
13
- const ctx = fullDocText.slice(Math.max(0, idx - 20), idx + needle.length + 20).replace(/\s+/g, ' ');
14
- const afterChar = fullDocText.slice(idx + needle.length, idx + needle.length + 1);
15
- occ.push({ idx, ctx, afterChar });
16
- idx++;
17
- }
18
- console.log(`\n--- ${kw} (${occ.length} occurrences) ---`);
19
- for (const o of occ.slice(0, 6)) {
20
- console.log(` @${o.idx} after="${o.afterChar}" ctx: ...${o.ctx}...`);
21
- }
22
- if (occ.length > 6) console.log(` ... and ${occ.length - 6} more`);
23
- }
1
+ import { extractCommentAnchors } from '../lib/import.js';
2
+
3
+ const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
4
+ const { fullDocText } = await extractCommentAnchors(docx);
5
+
6
+ const keywords = ['Abstract', 'Introduction', 'Methods', 'Results', 'Discussion', 'Conclusion', 'References'];
7
+ for (const kw of keywords) {
8
+ const lower = fullDocText.toLowerCase();
9
+ const needle = kw.toLowerCase();
10
+ const occ: Array<{ idx: number; ctx: string; afterChar: string }> = [];
11
+ let idx = 0;
12
+ while ((idx = lower.indexOf(needle, idx)) !== -1) {
13
+ const ctx = fullDocText.slice(Math.max(0, idx - 20), idx + needle.length + 20).replace(/\s+/g, ' ');
14
+ const afterChar = fullDocText.slice(idx + needle.length, idx + needle.length + 1);
15
+ occ.push({ idx, ctx, afterChar });
16
+ idx++;
17
+ }
18
+ console.log(`\n--- ${kw} (${occ.length} occurrences) ---`);
19
+ for (const o of occ.slice(0, 6)) {
20
+ console.log(` @${o.idx} after="${o.afterChar}" ctx: ...${o.ctx}...`);
21
+ }
22
+ if (occ.length > 6) console.log(` ... and ${occ.length - 6} more`);
23
+ }
@@ -1,70 +1,70 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
-
4
- const ROOT = 'C:/GillesC/tmp/docrev-stress/project';
5
- fs.mkdirSync(ROOT, { recursive: true });
6
-
7
- const full = fs.readFileSync('C:/GillesC/tmp/docrev-stress/full.md', 'utf-8');
8
- const lines = full.split(/\r?\n/);
9
-
10
- interface Section { file: string; header: string; lines: string[]; }
11
-
12
- const sections: Section[] = [];
13
-
14
- // Map H1 heading text to section file
15
- const headerToFile: Record<string, string> = {
16
- 'Abstract': 'abstract.md',
17
- 'Introduction': 'introduction.md',
18
- 'Methods': 'methods.md',
19
- 'Results': 'results.md',
20
- 'Discussion': 'discussion.md',
21
- 'Conclusion': 'conclusion.md',
22
- 'References': 'references.md',
23
- 'Supplementary Materials': 'supplement.md',
24
- };
25
-
26
- let current: Section | null = null;
27
- const preambleLines: string[] = [];
28
-
29
- for (const line of lines) {
30
- const m = line.match(/^# (.+)$/);
31
- if (m && headerToFile[m[1].trim()]) {
32
- if (current) sections.push(current);
33
- current = { file: headerToFile[m[1].trim()], header: m[1].trim(), lines: [line] };
34
- } else if (current) {
35
- current.lines.push(line);
36
- } else {
37
- preambleLines.push(line);
38
- }
39
- }
40
- if (current) sections.push(current);
41
-
42
- // Write sections
43
- for (const s of sections) {
44
- const out = path.join(ROOT, s.file);
45
- fs.writeFileSync(out, s.lines.join('\n'), 'utf-8');
46
- console.log(`wrote ${out} (${s.lines.length} lines)`);
47
- }
48
-
49
- // Write sections.yaml
50
- const yaml: string[] = ['version: 1', 'sections:'];
51
- for (const s of sections) {
52
- yaml.push(` ${s.file}:`);
53
- yaml.push(` header: "${s.header}"`);
54
- yaml.push(` aliases: []`);
55
- }
56
- fs.writeFileSync(path.join(ROOT, 'sections.yaml'), yaml.join('\n') + '\n', 'utf-8');
57
- console.log(`wrote sections.yaml`);
58
-
59
- // Minimal rev.yaml so commands that look for project root don't choke
60
- const revYaml = `title: "Stress Test"
61
- authors:
62
- - name: Gilles Colling
63
- output:
64
- docx: {}
65
- pdf: {}
66
- `;
67
- fs.writeFileSync(path.join(ROOT, 'rev.yaml'), revYaml, 'utf-8');
68
-
69
- console.log();
70
- console.log(`section files: ${sections.length}`);
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+
4
+ const ROOT = 'C:/GillesC/tmp/docrev-stress/project';
5
+ fs.mkdirSync(ROOT, { recursive: true });
6
+
7
+ const full = fs.readFileSync('C:/GillesC/tmp/docrev-stress/full.md', 'utf-8');
8
+ const lines = full.split(/\r?\n/);
9
+
10
+ interface Section { file: string; header: string; lines: string[]; }
11
+
12
+ const sections: Section[] = [];
13
+
14
+ // Map H1 heading text to section file
15
+ const headerToFile: Record<string, string> = {
16
+ 'Abstract': 'abstract.md',
17
+ 'Introduction': 'introduction.md',
18
+ 'Methods': 'methods.md',
19
+ 'Results': 'results.md',
20
+ 'Discussion': 'discussion.md',
21
+ 'Conclusion': 'conclusion.md',
22
+ 'References': 'references.md',
23
+ 'Supplementary Materials': 'supplement.md',
24
+ };
25
+
26
+ let current: Section | null = null;
27
+ const preambleLines: string[] = [];
28
+
29
+ for (const line of lines) {
30
+ const m = line.match(/^# (.+)$/);
31
+ if (m && headerToFile[m[1].trim()]) {
32
+ if (current) sections.push(current);
33
+ current = { file: headerToFile[m[1].trim()], header: m[1].trim(), lines: [line] };
34
+ } else if (current) {
35
+ current.lines.push(line);
36
+ } else {
37
+ preambleLines.push(line);
38
+ }
39
+ }
40
+ if (current) sections.push(current);
41
+
42
+ // Write sections
43
+ for (const s of sections) {
44
+ const out = path.join(ROOT, s.file);
45
+ fs.writeFileSync(out, s.lines.join('\n'), 'utf-8');
46
+ console.log(`wrote ${out} (${s.lines.length} lines)`);
47
+ }
48
+
49
+ // Write sections.yaml
50
+ const yaml: string[] = ['version: 1', 'sections:'];
51
+ for (const s of sections) {
52
+ yaml.push(` ${s.file}:`);
53
+ yaml.push(` header: "${s.header}"`);
54
+ yaml.push(` aliases: []`);
55
+ }
56
+ fs.writeFileSync(path.join(ROOT, 'sections.yaml'), yaml.join('\n') + '\n', 'utf-8');
57
+ console.log(`wrote sections.yaml`);
58
+
59
+ // Minimal rev.yaml so commands that look for project root don't choke
60
+ const revYaml = `title: "Stress Test"
61
+ authors:
62
+ - name: Gilles Colling
63
+ output:
64
+ docx: {}
65
+ pdf: {}
66
+ `;
67
+ fs.writeFileSync(path.join(ROOT, 'rev.yaml'), revYaml, 'utf-8');
68
+
69
+ console.log();
70
+ console.log(`section files: ${sections.length}`);
@@ -1,19 +1,19 @@
1
- import { extractCommentAnchors } from '../lib/import.js';
2
-
3
- const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
4
- const { fullDocText } = await extractCommentAnchors(docx);
5
-
6
- const needle = 'methods';
7
- const lower = fullDocText.toLowerCase();
8
- let idx = 0;
9
- const trace: Array<{idx:number, after:string, skipped:boolean}> = [];
10
- while ((idx = lower.indexOf(needle, idx)) !== -1 && trace.length < 10) {
11
- const after = fullDocText.slice(idx + needle.length, idx + needle.length + 5);
12
- const skip = after.startsWith(':') || after.startsWith(' :');
13
- trace.push({ idx, after, skipped: skip });
14
- if (!skip) break;
15
- idx++;
16
- }
17
- for (const t of trace) console.log(`idx=${t.idx} after="${t.after}" skipped=${t.skipped}`);
18
- console.log();
19
- console.log(`first non-:-prefixed Methods idx = ${trace.find(t => !t.skipped)?.idx ?? -1}`);
1
+ import { extractCommentAnchors } from '../lib/import.js';
2
+
3
+ const docx = 'C:/GillesC/tmp/docrev-stress/reviewed.docx';
4
+ const { fullDocText } = await extractCommentAnchors(docx);
5
+
6
+ const needle = 'methods';
7
+ const lower = fullDocText.toLowerCase();
8
+ let idx = 0;
9
+ const trace: Array<{idx:number, after:string, skipped:boolean}> = [];
10
+ while ((idx = lower.indexOf(needle, idx)) !== -1 && trace.length < 10) {
11
+ const after = fullDocText.slice(idx + needle.length, idx + needle.length + 5);
12
+ const skip = after.startsWith(':') || after.startsWith(' :');
13
+ trace.push({ idx, after, skipped: skip });
14
+ if (!skip) break;
15
+ idx++;
16
+ }
17
+ for (const t of trace) console.log(`idx=${t.idx} after="${t.after}" skipped=${t.skipped}`);
18
+ console.log();
19
+ console.log(`first non-:-prefixed Methods idx = ${trace.find(t => !t.skipped)?.idx ?? -1}`);
@@ -1,40 +1,40 @@
1
- // Verify sync --comments-only didn't touch existing prose, only inserted comments.
2
- import * as fs from 'fs';
3
- import { stripCriticMarkup } from '../lib/anchor-match.js';
4
-
5
- const original = 'C:/GillesC/tmp/docrev-stress/project';
6
- const synced = 'C:/GillesC/tmp/docrev-stress/project-sync';
7
- const files = ['abstract.md', 'introduction.md', 'methods.md', 'results.md', 'discussion.md', 'conclusion.md', 'references.md', 'supplement.md'];
8
-
9
- let totalComments = 0;
10
- let mismatches = 0;
11
- for (const f of files) {
12
- const orig = fs.readFileSync(`${original}/${f}`, 'utf-8');
13
- const synd = fs.readFileSync(`${synced}/${f}`, 'utf-8');
14
-
15
- // Count comments inserted
16
- const commentMatches = synd.match(/\{>>.*?<<\}/gs) || [];
17
- totalComments += commentMatches.length;
18
-
19
- // The originals may already contain CriticMarkup (Word highlights -> [X]{.mark}),
20
- // so strip both sides to compare just the underlying prose.
21
- const synStripped = stripCriticMarkup(synd);
22
- const origNorm = stripCriticMarkup(orig);
23
-
24
- if (synStripped !== origNorm) {
25
- // Find first difference
26
- let i = 0;
27
- while (i < origNorm.length && i < synStripped.length && origNorm[i] === synStripped[i]) i++;
28
- const ctxOrig = origNorm.slice(Math.max(0, i - 30), i + 50).replace(/\n/g, '\\n');
29
- const ctxSyn = synStripped.slice(Math.max(0, i - 30), i + 50).replace(/\n/g, '\\n');
30
- console.log(`✗ ${f}: prose differs at byte ${i} (lengths orig=${origNorm.length} stripped=${synStripped.length})`);
31
- console.log(` orig: ${ctxOrig}`);
32
- console.log(` syn: ${ctxSyn}`);
33
- mismatches++;
34
- } else {
35
- console.log(`✓ ${f}: prose preserved (${commentMatches.length} comments inserted)`);
36
- }
37
- }
38
- console.log();
39
- console.log(`total comments inserted: ${totalComments}`);
40
- console.log(`prose mismatches: ${mismatches}/${files.length}`);
1
+ // Verify sync --comments-only didn't touch existing prose, only inserted comments.
2
+ import * as fs from 'fs';
3
+ import { stripCriticMarkup } from '../lib/anchor-match.js';
4
+
5
+ const original = 'C:/GillesC/tmp/docrev-stress/project';
6
+ const synced = 'C:/GillesC/tmp/docrev-stress/project-sync';
7
+ const files = ['abstract.md', 'introduction.md', 'methods.md', 'results.md', 'discussion.md', 'conclusion.md', 'references.md', 'supplement.md'];
8
+
9
+ let totalComments = 0;
10
+ let mismatches = 0;
11
+ for (const f of files) {
12
+ const orig = fs.readFileSync(`${original}/${f}`, 'utf-8');
13
+ const synd = fs.readFileSync(`${synced}/${f}`, 'utf-8');
14
+
15
+ // Count comments inserted
16
+ const commentMatches = synd.match(/\{>>.*?<<\}/gs) || [];
17
+ totalComments += commentMatches.length;
18
+
19
+ // The originals may already contain CriticMarkup (Word highlights -> [X]{.mark}),
20
+ // so strip both sides to compare just the underlying prose.
21
+ const synStripped = stripCriticMarkup(synd);
22
+ const origNorm = stripCriticMarkup(orig);
23
+
24
+ if (synStripped !== origNorm) {
25
+ // Find first difference
26
+ let i = 0;
27
+ while (i < origNorm.length && i < synStripped.length && origNorm[i] === synStripped[i]) i++;
28
+ const ctxOrig = origNorm.slice(Math.max(0, i - 30), i + 50).replace(/\n/g, '\\n');
29
+ const ctxSyn = synStripped.slice(Math.max(0, i - 30), i + 50).replace(/\n/g, '\\n');
30
+ console.log(`✗ ${f}: prose differs at byte ${i} (lengths orig=${origNorm.length} stripped=${synStripped.length})`);
31
+ console.log(` orig: ${ctxOrig}`);
32
+ console.log(` syn: ${ctxSyn}`);
33
+ mismatches++;
34
+ } else {
35
+ console.log(`✓ ${f}: prose preserved (${commentMatches.length} comments inserted)`);
36
+ }
37
+ }
38
+ console.log();
39
+ console.log(`total comments inserted: ${totalComments}`);
40
+ console.log(`prose mismatches: ${mismatches}/${files.length}`);
@@ -97,6 +97,12 @@ export interface BuildConfig {
97
97
  pptx: PptxConfig;
98
98
  tables: TablesConfig;
99
99
  postprocess: PostprocessConfig;
100
+ /**
101
+ * Directory (relative to the project) where final outputs land. Created on
102
+ * demand. Set to null/empty to keep outputs alongside paper.md (legacy
103
+ * behavior).
104
+ */
105
+ outputDir?: string | null;
100
106
  _configPath?: string | null;
101
107
  }
102
108
  export interface BuildResult {
@@ -128,6 +134,18 @@ interface FullBuildResult {
128
134
  forwardRefsResolved: number;
129
135
  refsAutoInjected?: boolean;
130
136
  }
137
+ interface Registry {
138
+ figures: Map<string, unknown>;
139
+ tables: Map<string, unknown>;
140
+ equations: Map<string, unknown>;
141
+ byNumber: {
142
+ fig?: Map<number, string>;
143
+ figS?: Map<number, string>;
144
+ tbl?: Map<number, string>;
145
+ tblS?: Map<number, string>;
146
+ eq?: Map<number, string>;
147
+ };
148
+ }
131
149
  /**
132
150
  * Default rev.yaml configuration
133
151
  */
@@ -166,14 +184,33 @@ export declare function combineSections(directory: string, config: BuildConfig,
166
184
  * @returns processed content
167
185
  */
168
186
  export declare function processTablesForFormat(content: string, tablesConfig: TablesConfig, format: string): string;
187
+ /**
188
+ * Apply format-specific transforms (table normalization, author blocks,
189
+ * crossref display conversion, slide syntax). Caller is responsible for
190
+ * stripping annotations beforehand — the dual-output paths keep comments
191
+ * in the markdown stream and need to apply these transforms separately
192
+ * from annotation handling.
193
+ *
194
+ * @param content - Markdown content (annotations already stripped as needed)
195
+ * @param format - Output format
196
+ * @param config - Build config
197
+ * @param registry - Crossref registry for the project
198
+ * @returns Transformed markdown
199
+ */
200
+ export declare function applyFormatTransforms(content: string, format: string, config: BuildConfig, registry: Registry): string;
169
201
  /**
170
202
  * Prepare paper.md for specific output format
171
203
  */
172
- export declare function prepareForFormat(paperPath: string, format: string, config: BuildConfig, options?: BuildOptions): string;
204
+ export declare function prepareForFormat(paperPath: string, format: string, config: BuildConfig, _options?: BuildOptions): string;
173
205
  /**
174
206
  * Build pandoc arguments for format
175
207
  */
176
208
  export declare function buildPandocArgs(format: string, config: BuildConfig, outputPath: string): string[];
209
+ /**
210
+ * Resolve the absolute directory where final outputs should land.
211
+ * Honors config.outputDir; falls back to the project directory when null/empty.
212
+ */
213
+ export declare function resolveOutputDir(directory: string, config: BuildConfig): string;
177
214
  /**
178
215
  * Run pandoc build
179
216
  */
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkB5D,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG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