docrev 0.10.1 → 0.11.0
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/.gitattributes +1 -1
- package/CHANGELOG.md +184 -173
- package/PLAN-tables-and-postprocess.md +850 -850
- package/README.md +431 -431
- package/bin/rev.js +11 -11
- package/bin/rev.ts +145 -145
- package/completions/rev.bash +127 -127
- package/completions/rev.ps1 +210 -210
- package/completions/rev.zsh +207 -207
- package/dist/lib/anchor-match.d.ts +4 -2
- package/dist/lib/anchor-match.d.ts.map +1 -1
- package/dist/lib/anchor-match.js +52 -24
- package/dist/lib/anchor-match.js.map +1 -1
- package/dist/lib/annotations.d.ts +0 -6
- package/dist/lib/annotations.d.ts.map +1 -1
- package/dist/lib/annotations.js +26 -8
- package/dist/lib/annotations.js.map +1 -1
- package/dist/lib/build.d.ts.map +1 -1
- package/dist/lib/build.js +13 -10
- package/dist/lib/build.js.map +1 -1
- package/dist/lib/commands/build.d.ts.map +1 -1
- package/dist/lib/commands/build.js +5 -0
- package/dist/lib/commands/build.js.map +1 -1
- package/dist/lib/commands/doi.d.ts.map +1 -1
- package/dist/lib/commands/doi.js +14 -2
- package/dist/lib/commands/doi.js.map +1 -1
- package/dist/lib/commands/sync.d.ts.map +1 -1
- package/dist/lib/commands/sync.js +98 -107
- package/dist/lib/commands/sync.js.map +1 -1
- package/dist/lib/commands/utilities.js +164 -164
- package/dist/lib/commands/word-tools.js +8 -8
- package/dist/lib/comment-realign.d.ts +12 -21
- package/dist/lib/comment-realign.d.ts.map +1 -1
- package/dist/lib/comment-realign.js +40 -348
- package/dist/lib/comment-realign.js.map +1 -1
- package/dist/lib/dependencies.d.ts +10 -0
- package/dist/lib/dependencies.d.ts.map +1 -1
- package/dist/lib/dependencies.js +41 -9
- package/dist/lib/dependencies.js.map +1 -1
- package/dist/lib/doi.d.ts.map +1 -1
- package/dist/lib/doi.js +68 -80
- package/dist/lib/doi.js.map +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +3 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/grammar.js +3 -3
- package/dist/lib/import.d.ts +7 -4
- package/dist/lib/import.d.ts.map +1 -1
- package/dist/lib/import.js +58 -62
- package/dist/lib/import.js.map +1 -1
- package/dist/lib/macro-filter.lua +201 -201
- package/dist/lib/ooxml.d.ts +207 -0
- package/dist/lib/ooxml.d.ts.map +1 -0
- package/dist/lib/ooxml.js +634 -0
- package/dist/lib/ooxml.js.map +1 -0
- package/dist/lib/pdf-comments.js +44 -44
- package/dist/lib/plugins.js +57 -57
- package/dist/lib/pptx-color-filter.lua +37 -37
- package/dist/lib/pptx-themes.js +115 -115
- package/dist/lib/rate-limiter.d.ts +8 -0
- package/dist/lib/rate-limiter.d.ts.map +1 -1
- package/dist/lib/rate-limiter.js +41 -4
- package/dist/lib/rate-limiter.js.map +1 -1
- package/dist/lib/sections.d.ts.map +1 -1
- package/dist/lib/sections.js +5 -2
- package/dist/lib/sections.js.map +1 -1
- package/dist/lib/spelling.js +2 -2
- package/dist/lib/templates.js +387 -387
- package/dist/lib/themes.js +51 -51
- package/dist/lib/types.d.ts +9 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/word-extraction.d.ts.map +1 -1
- package/dist/lib/word-extraction.js +48 -307
- package/dist/lib/word-extraction.js.map +1 -1
- package/dist/lib/word.d.ts.map +1 -1
- package/dist/lib/word.js +80 -175
- package/dist/lib/word.js.map +1 -1
- package/dist/lib/wordcomments.d.ts.map +1 -1
- package/dist/lib/wordcomments.js +53 -92
- package/dist/lib/wordcomments.js.map +1 -1
- package/docs-src/build.py +113 -113
- package/docs-src/extra.css +208 -208
- package/docs-src/md-to-html.lua +6 -6
- package/docs-src/template.html +116 -116
- package/eslint.config.js +27 -27
- package/lib/anchor-match.ts +307 -276
- package/lib/annotations.ts +664 -644
- package/lib/build.ts +1770 -1766
- package/lib/citations.ts +160 -160
- package/lib/commands/build.ts +860 -855
- package/lib/commands/citations.ts +515 -515
- package/lib/commands/comments.ts +1050 -1050
- package/lib/commands/context.ts +176 -176
- package/lib/commands/core.ts +309 -309
- package/lib/commands/doi.ts +451 -435
- package/lib/commands/file-ops.ts +372 -372
- package/lib/commands/history.ts +320 -320
- package/lib/commands/index.ts +87 -87
- package/lib/commands/init.ts +259 -259
- package/lib/commands/merge-resolve.ts +378 -378
- package/lib/commands/preview.ts +178 -178
- package/lib/commands/project-info.ts +244 -244
- package/lib/commands/quality.ts +517 -517
- package/lib/commands/response.ts +454 -454
- package/lib/commands/section-boundaries.ts +82 -82
- package/lib/commands/sections.ts +451 -451
- package/lib/commands/sync.ts +689 -709
- package/lib/commands/text-ops.ts +449 -449
- package/lib/commands/utilities.ts +448 -448
- package/lib/commands/verify-anchors.ts +272 -272
- package/lib/commands/word-tools.ts +340 -340
- package/lib/comment-realign.ts +99 -517
- package/lib/config.ts +84 -84
- package/lib/crossref.ts +781 -781
- package/lib/csl.ts +191 -191
- package/lib/dependencies.ts +132 -98
- package/lib/diff-engine.ts +465 -465
- package/lib/doi-cache.ts +115 -115
- package/lib/doi.ts +879 -897
- package/lib/equations.ts +506 -506
- package/lib/errors.ts +350 -346
- package/lib/format.ts +541 -541
- package/lib/git.ts +326 -326
- package/lib/grammar.ts +303 -303
- package/lib/image-registry.ts +180 -180
- package/lib/import.ts +906 -911
- package/lib/journals.ts +543 -543
- package/lib/macro-filter.lua +201 -201
- package/lib/macros.ts +273 -273
- package/lib/merge.ts +633 -633
- package/lib/ooxml.ts +768 -0
- package/lib/orcid.ts +144 -144
- package/lib/pdf-comments.ts +263 -263
- package/lib/pdf-import.ts +524 -524
- package/lib/plugins.ts +362 -362
- package/lib/postprocess.ts +188 -188
- package/lib/pptx-color-filter.lua +37 -37
- package/lib/pptx-template.ts +469 -469
- package/lib/pptx-themes.ts +483 -483
- package/lib/protect-restore.ts +520 -520
- package/lib/rate-limiter.ts +127 -94
- package/lib/response.ts +197 -197
- package/lib/restore-references.ts +240 -240
- package/lib/review.ts +327 -327
- package/lib/schema.ts +488 -488
- package/lib/scientific-words.ts +73 -73
- package/lib/sections.ts +428 -425
- package/lib/slides.ts +756 -756
- package/lib/spelling.ts +334 -334
- package/lib/templates.ts +526 -526
- package/lib/themes.ts +742 -742
- package/lib/trackchanges.ts +247 -247
- package/lib/tui.ts +450 -450
- package/lib/types.ts +558 -550
- package/lib/undo.ts +250 -250
- package/lib/utils.ts +69 -69
- package/lib/variables.ts +179 -179
- package/lib/word-extraction.ts +525 -806
- package/lib/word.ts +526 -643
- package/lib/wordcomments.ts +789 -840
- package/mkdocs.yml +64 -64
- package/package.json +137 -137
- package/scripts/postbuild.js +47 -47
- package/skill/REFERENCE.md +539 -539
- package/skill/SKILL.md +295 -295
- package/tsconfig.json +26 -26
- package/types/index.d.ts +525 -525
package/completions/rev.zsh
CHANGED
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
#compdef rev
|
|
2
|
-
|
|
3
|
-
# Zsh completion for rev (docrev)
|
|
4
|
-
# Install: add to fpath or run:
|
|
5
|
-
# eval "$(rev completions zsh)"
|
|
6
|
-
|
|
7
|
-
_rev() {
|
|
8
|
-
local -a commands build_formats doi_actions eq_actions help_topics journals preview_formats
|
|
9
|
-
|
|
10
|
-
commands=(
|
|
11
|
-
'build:Build PDF/DOCX/TEX from sections'
|
|
12
|
-
'new:Create new project from template'
|
|
13
|
-
'import:Import Word document'
|
|
14
|
-
'sections:Import to section files'
|
|
15
|
-
'extract:Extract text from Word'
|
|
16
|
-
'review:Interactive review TUI'
|
|
17
|
-
'status:Show annotation counts'
|
|
18
|
-
'comments:List comments'
|
|
19
|
-
'resolve:Mark comment as resolved'
|
|
20
|
-
'reply:Reply to comments'
|
|
21
|
-
'strip:Output clean markdown'
|
|
22
|
-
'refs:Show reference status'
|
|
23
|
-
'migrate:Convert hardcoded refs'
|
|
24
|
-
'config:Configure settings'
|
|
25
|
-
'install:Check dependencies'
|
|
26
|
-
'doi:DOI validation'
|
|
27
|
-
'citations:Validate citations'
|
|
28
|
-
'equations:Extract equations'
|
|
29
|
-
'figures:List figures'
|
|
30
|
-
'response:Generate response letter'
|
|
31
|
-
'anonymize:Prepare for blind review'
|
|
32
|
-
'validate:Check journal requirements'
|
|
33
|
-
'merge:Merge reviewer feedback'
|
|
34
|
-
'diff:Compare against git history'
|
|
35
|
-
'history:Show revision history'
|
|
36
|
-
'help:Show help'
|
|
37
|
-
'init:Initialize project'
|
|
38
|
-
'split:Split paper.md to sections'
|
|
39
|
-
'word-count:Show word counts per section'
|
|
40
|
-
'wc:Show word counts (alias)'
|
|
41
|
-
'stats:Show project statistics'
|
|
42
|
-
'search:Search across files'
|
|
43
|
-
'backup:Create timestamped backup'
|
|
44
|
-
'export:Export project as zip'
|
|
45
|
-
'preview:Build and open document'
|
|
46
|
-
'watch:Watch and auto-rebuild'
|
|
47
|
-
'lint:Check for issues'
|
|
48
|
-
'grammar:Check grammar and style'
|
|
49
|
-
'annotate:Add comments to DOCX'
|
|
50
|
-
'apply:Apply annotations as track changes'
|
|
51
|
-
'comment:Interactive comment mode'
|
|
52
|
-
'completions:Generate shell completions'
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
preview_formats=(
|
|
56
|
-
'pdf:Preview PDF'
|
|
57
|
-
'docx:Preview Word document'
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
build_formats=(
|
|
61
|
-
'pdf:Build PDF'
|
|
62
|
-
'docx:Build Word document'
|
|
63
|
-
'tex:Build LaTeX'
|
|
64
|
-
'all:Build all formats'
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
doi_actions=(
|
|
68
|
-
'check:Validate DOIs'
|
|
69
|
-
'lookup:Find missing DOIs'
|
|
70
|
-
'fetch:Get BibTeX from DOI'
|
|
71
|
-
'add:Add citation by DOI'
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
eq_actions=(
|
|
75
|
-
'list:List equations'
|
|
76
|
-
'extract:Extract to file'
|
|
77
|
-
'convert:Convert to Word'
|
|
78
|
-
'from-word:Extract from Word'
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
help_topics=(
|
|
82
|
-
'workflow:Review workflow'
|
|
83
|
-
'syntax:CriticMarkup syntax'
|
|
84
|
-
'commands:All commands'
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
journals=(
|
|
88
|
-
'nature:Nature journal'
|
|
89
|
-
'science:Science journal'
|
|
90
|
-
'plos:PLOS ONE'
|
|
91
|
-
'cell:Cell journal'
|
|
92
|
-
'ecology:Ecology journals'
|
|
93
|
-
'custom:Custom profile'
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
case "$words[2]" in
|
|
97
|
-
build)
|
|
98
|
-
_describe -t formats 'format' build_formats
|
|
99
|
-
_arguments \
|
|
100
|
-
'--toc[Include table of contents]' \
|
|
101
|
-
'--show-changes[Show track changes in DOCX]' \
|
|
102
|
-
'--clean[Clean build files]'
|
|
103
|
-
;;
|
|
104
|
-
new)
|
|
105
|
-
_arguments \
|
|
106
|
-
'--list[List templates]' \
|
|
107
|
-
'--template[Template name]:template:(paper minimal thesis proposal)'
|
|
108
|
-
;;
|
|
109
|
-
doi)
|
|
110
|
-
_describe -t actions 'action' doi_actions
|
|
111
|
-
;;
|
|
112
|
-
equations|eq)
|
|
113
|
-
_describe -t actions 'action' eq_actions
|
|
114
|
-
;;
|
|
115
|
-
validate)
|
|
116
|
-
_arguments \
|
|
117
|
-
'--list[List journals]' \
|
|
118
|
-
'--journal[Journal name]:journal:($journals)'
|
|
119
|
-
;;
|
|
120
|
-
help)
|
|
121
|
-
_describe -t topics 'topic' help_topics
|
|
122
|
-
;;
|
|
123
|
-
config)
|
|
124
|
-
_values 'setting' 'user[Set user name]'
|
|
125
|
-
;;
|
|
126
|
-
word-count|wc)
|
|
127
|
-
_arguments \
|
|
128
|
-
'--limit[Word limit]:number:' \
|
|
129
|
-
'--journal[Use journal word limit]:journal:'
|
|
130
|
-
;;
|
|
131
|
-
preview)
|
|
132
|
-
_describe -t formats 'format' preview_formats
|
|
133
|
-
;;
|
|
134
|
-
watch)
|
|
135
|
-
_arguments \
|
|
136
|
-
'--no-open[Do not open after build]'
|
|
137
|
-
_values 'format' 'pdf' 'docx' 'all'
|
|
138
|
-
;;
|
|
139
|
-
lint)
|
|
140
|
-
_arguments \
|
|
141
|
-
'--fix[Auto-fix issues]'
|
|
142
|
-
;;
|
|
143
|
-
grammar)
|
|
144
|
-
_arguments \
|
|
145
|
-
'--learn[Add word to dictionary]:word:' \
|
|
146
|
-
'--forget[Remove from dictionary]:word:' \
|
|
147
|
-
'--list[List dictionary words]' \
|
|
148
|
-
'--rules[List grammar rules]' \
|
|
149
|
-
'--no-scientific[Disable science rules]' \
|
|
150
|
-
'--severity[Minimum severity]:level:(error warning info)'
|
|
151
|
-
_files -g '*.md'
|
|
152
|
-
;;
|
|
153
|
-
annotate)
|
|
154
|
-
_arguments \
|
|
155
|
-
'-m[Comment message]:text:' \
|
|
156
|
-
'-s[Search text]:text:' \
|
|
157
|
-
'-a[Author name]:name:'
|
|
158
|
-
_files -g '*.docx'
|
|
159
|
-
;;
|
|
160
|
-
apply)
|
|
161
|
-
_arguments \
|
|
162
|
-
'-a[Author name]:name:'
|
|
163
|
-
_files -g '*.md'
|
|
164
|
-
;;
|
|
165
|
-
comment)
|
|
166
|
-
_arguments \
|
|
167
|
-
'-a[Author name]:name:'
|
|
168
|
-
_files -g '*.docx'
|
|
169
|
-
;;
|
|
170
|
-
completions)
|
|
171
|
-
_values 'shell' 'bash' 'zsh'
|
|
172
|
-
;;
|
|
173
|
-
import|sections|extract|review|status|comments|strip|refs|migrate|figures|response|anonymize|split|search|stats)
|
|
174
|
-
_files -g '*.md' -g '*.docx'
|
|
175
|
-
;;
|
|
176
|
-
resolve|reply)
|
|
177
|
-
_arguments \
|
|
178
|
-
'-n[Comment number]:number:' \
|
|
179
|
-
'-m[Reply message]:message:'
|
|
180
|
-
_files -g '*.md'
|
|
181
|
-
;;
|
|
182
|
-
check|lookup|add|citations)
|
|
183
|
-
_files -g '*.bib'
|
|
184
|
-
;;
|
|
185
|
-
merge)
|
|
186
|
-
_files -g '*.md' -g '*.docx'
|
|
187
|
-
;;
|
|
188
|
-
backup)
|
|
189
|
-
_arguments \
|
|
190
|
-
'--name[Custom backup name]:name:' \
|
|
191
|
-
'--output[Output directory]:dir:_files -/'
|
|
192
|
-
;;
|
|
193
|
-
export)
|
|
194
|
-
_arguments \
|
|
195
|
-
'--output[Output filename]:file:' \
|
|
196
|
-
'--include-output[Include built files]'
|
|
197
|
-
;;
|
|
198
|
-
*)
|
|
199
|
-
_describe -t commands 'command' commands
|
|
200
|
-
_arguments \
|
|
201
|
-
'--help[Show help]' \
|
|
202
|
-
'--version[Show version]'
|
|
203
|
-
;;
|
|
204
|
-
esac
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
_rev "$@"
|
|
1
|
+
#compdef rev
|
|
2
|
+
|
|
3
|
+
# Zsh completion for rev (docrev)
|
|
4
|
+
# Install: add to fpath or run:
|
|
5
|
+
# eval "$(rev completions zsh)"
|
|
6
|
+
|
|
7
|
+
_rev() {
|
|
8
|
+
local -a commands build_formats doi_actions eq_actions help_topics journals preview_formats
|
|
9
|
+
|
|
10
|
+
commands=(
|
|
11
|
+
'build:Build PDF/DOCX/TEX from sections'
|
|
12
|
+
'new:Create new project from template'
|
|
13
|
+
'import:Import Word document'
|
|
14
|
+
'sections:Import to section files'
|
|
15
|
+
'extract:Extract text from Word'
|
|
16
|
+
'review:Interactive review TUI'
|
|
17
|
+
'status:Show annotation counts'
|
|
18
|
+
'comments:List comments'
|
|
19
|
+
'resolve:Mark comment as resolved'
|
|
20
|
+
'reply:Reply to comments'
|
|
21
|
+
'strip:Output clean markdown'
|
|
22
|
+
'refs:Show reference status'
|
|
23
|
+
'migrate:Convert hardcoded refs'
|
|
24
|
+
'config:Configure settings'
|
|
25
|
+
'install:Check dependencies'
|
|
26
|
+
'doi:DOI validation'
|
|
27
|
+
'citations:Validate citations'
|
|
28
|
+
'equations:Extract equations'
|
|
29
|
+
'figures:List figures'
|
|
30
|
+
'response:Generate response letter'
|
|
31
|
+
'anonymize:Prepare for blind review'
|
|
32
|
+
'validate:Check journal requirements'
|
|
33
|
+
'merge:Merge reviewer feedback'
|
|
34
|
+
'diff:Compare against git history'
|
|
35
|
+
'history:Show revision history'
|
|
36
|
+
'help:Show help'
|
|
37
|
+
'init:Initialize project'
|
|
38
|
+
'split:Split paper.md to sections'
|
|
39
|
+
'word-count:Show word counts per section'
|
|
40
|
+
'wc:Show word counts (alias)'
|
|
41
|
+
'stats:Show project statistics'
|
|
42
|
+
'search:Search across files'
|
|
43
|
+
'backup:Create timestamped backup'
|
|
44
|
+
'export:Export project as zip'
|
|
45
|
+
'preview:Build and open document'
|
|
46
|
+
'watch:Watch and auto-rebuild'
|
|
47
|
+
'lint:Check for issues'
|
|
48
|
+
'grammar:Check grammar and style'
|
|
49
|
+
'annotate:Add comments to DOCX'
|
|
50
|
+
'apply:Apply annotations as track changes'
|
|
51
|
+
'comment:Interactive comment mode'
|
|
52
|
+
'completions:Generate shell completions'
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
preview_formats=(
|
|
56
|
+
'pdf:Preview PDF'
|
|
57
|
+
'docx:Preview Word document'
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
build_formats=(
|
|
61
|
+
'pdf:Build PDF'
|
|
62
|
+
'docx:Build Word document'
|
|
63
|
+
'tex:Build LaTeX'
|
|
64
|
+
'all:Build all formats'
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
doi_actions=(
|
|
68
|
+
'check:Validate DOIs'
|
|
69
|
+
'lookup:Find missing DOIs'
|
|
70
|
+
'fetch:Get BibTeX from DOI'
|
|
71
|
+
'add:Add citation by DOI'
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
eq_actions=(
|
|
75
|
+
'list:List equations'
|
|
76
|
+
'extract:Extract to file'
|
|
77
|
+
'convert:Convert to Word'
|
|
78
|
+
'from-word:Extract from Word'
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
help_topics=(
|
|
82
|
+
'workflow:Review workflow'
|
|
83
|
+
'syntax:CriticMarkup syntax'
|
|
84
|
+
'commands:All commands'
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
journals=(
|
|
88
|
+
'nature:Nature journal'
|
|
89
|
+
'science:Science journal'
|
|
90
|
+
'plos:PLOS ONE'
|
|
91
|
+
'cell:Cell journal'
|
|
92
|
+
'ecology:Ecology journals'
|
|
93
|
+
'custom:Custom profile'
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
case "$words[2]" in
|
|
97
|
+
build)
|
|
98
|
+
_describe -t formats 'format' build_formats
|
|
99
|
+
_arguments \
|
|
100
|
+
'--toc[Include table of contents]' \
|
|
101
|
+
'--show-changes[Show track changes in DOCX]' \
|
|
102
|
+
'--clean[Clean build files]'
|
|
103
|
+
;;
|
|
104
|
+
new)
|
|
105
|
+
_arguments \
|
|
106
|
+
'--list[List templates]' \
|
|
107
|
+
'--template[Template name]:template:(paper minimal thesis proposal)'
|
|
108
|
+
;;
|
|
109
|
+
doi)
|
|
110
|
+
_describe -t actions 'action' doi_actions
|
|
111
|
+
;;
|
|
112
|
+
equations|eq)
|
|
113
|
+
_describe -t actions 'action' eq_actions
|
|
114
|
+
;;
|
|
115
|
+
validate)
|
|
116
|
+
_arguments \
|
|
117
|
+
'--list[List journals]' \
|
|
118
|
+
'--journal[Journal name]:journal:($journals)'
|
|
119
|
+
;;
|
|
120
|
+
help)
|
|
121
|
+
_describe -t topics 'topic' help_topics
|
|
122
|
+
;;
|
|
123
|
+
config)
|
|
124
|
+
_values 'setting' 'user[Set user name]'
|
|
125
|
+
;;
|
|
126
|
+
word-count|wc)
|
|
127
|
+
_arguments \
|
|
128
|
+
'--limit[Word limit]:number:' \
|
|
129
|
+
'--journal[Use journal word limit]:journal:'
|
|
130
|
+
;;
|
|
131
|
+
preview)
|
|
132
|
+
_describe -t formats 'format' preview_formats
|
|
133
|
+
;;
|
|
134
|
+
watch)
|
|
135
|
+
_arguments \
|
|
136
|
+
'--no-open[Do not open after build]'
|
|
137
|
+
_values 'format' 'pdf' 'docx' 'all'
|
|
138
|
+
;;
|
|
139
|
+
lint)
|
|
140
|
+
_arguments \
|
|
141
|
+
'--fix[Auto-fix issues]'
|
|
142
|
+
;;
|
|
143
|
+
grammar)
|
|
144
|
+
_arguments \
|
|
145
|
+
'--learn[Add word to dictionary]:word:' \
|
|
146
|
+
'--forget[Remove from dictionary]:word:' \
|
|
147
|
+
'--list[List dictionary words]' \
|
|
148
|
+
'--rules[List grammar rules]' \
|
|
149
|
+
'--no-scientific[Disable science rules]' \
|
|
150
|
+
'--severity[Minimum severity]:level:(error warning info)'
|
|
151
|
+
_files -g '*.md'
|
|
152
|
+
;;
|
|
153
|
+
annotate)
|
|
154
|
+
_arguments \
|
|
155
|
+
'-m[Comment message]:text:' \
|
|
156
|
+
'-s[Search text]:text:' \
|
|
157
|
+
'-a[Author name]:name:'
|
|
158
|
+
_files -g '*.docx'
|
|
159
|
+
;;
|
|
160
|
+
apply)
|
|
161
|
+
_arguments \
|
|
162
|
+
'-a[Author name]:name:'
|
|
163
|
+
_files -g '*.md'
|
|
164
|
+
;;
|
|
165
|
+
comment)
|
|
166
|
+
_arguments \
|
|
167
|
+
'-a[Author name]:name:'
|
|
168
|
+
_files -g '*.docx'
|
|
169
|
+
;;
|
|
170
|
+
completions)
|
|
171
|
+
_values 'shell' 'bash' 'zsh'
|
|
172
|
+
;;
|
|
173
|
+
import|sections|extract|review|status|comments|strip|refs|migrate|figures|response|anonymize|split|search|stats)
|
|
174
|
+
_files -g '*.md' -g '*.docx'
|
|
175
|
+
;;
|
|
176
|
+
resolve|reply)
|
|
177
|
+
_arguments \
|
|
178
|
+
'-n[Comment number]:number:' \
|
|
179
|
+
'-m[Reply message]:message:'
|
|
180
|
+
_files -g '*.md'
|
|
181
|
+
;;
|
|
182
|
+
check|lookup|add|citations)
|
|
183
|
+
_files -g '*.bib'
|
|
184
|
+
;;
|
|
185
|
+
merge)
|
|
186
|
+
_files -g '*.md' -g '*.docx'
|
|
187
|
+
;;
|
|
188
|
+
backup)
|
|
189
|
+
_arguments \
|
|
190
|
+
'--name[Custom backup name]:name:' \
|
|
191
|
+
'--output[Output directory]:dir:_files -/'
|
|
192
|
+
;;
|
|
193
|
+
export)
|
|
194
|
+
_arguments \
|
|
195
|
+
'--output[Output filename]:file:' \
|
|
196
|
+
'--include-output[Include built files]'
|
|
197
|
+
;;
|
|
198
|
+
*)
|
|
199
|
+
_describe -t commands 'command' commands
|
|
200
|
+
_arguments \
|
|
201
|
+
'--help[Show help]' \
|
|
202
|
+
'--version[Show version]'
|
|
203
|
+
;;
|
|
204
|
+
esac
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
_rev "$@"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* anchor string and surrounding context, locate candidate positions in
|
|
5
5
|
* a target text using progressively looser strategies.
|
|
6
6
|
*/
|
|
7
|
-
export type AnchorStrategy = 'direct' | 'normalized' | 'stripped' | 'partial-start' | 'partial-start-stripped' | 'context-both' | 'context-before' | 'context-after' | 'split-match' | 'empty-anchor' | 'failed';
|
|
7
|
+
export type AnchorStrategy = 'direct' | 'normalized' | 'stripped' | 'partial-start' | 'partial-start-stripped' | 'partial-window' | 'partial-window-stripped' | 'context-both' | 'context-before' | 'context-after' | 'split-match' | 'empty-anchor' | 'failed';
|
|
8
8
|
export interface AnchorSearchResult {
|
|
9
9
|
occurrences: number[];
|
|
10
10
|
matchedAnchor: string | null;
|
|
@@ -14,7 +14,9 @@ export interface AnchorSearchResult {
|
|
|
14
14
|
/**
|
|
15
15
|
* Strip CriticMarkup so the matcher sees plain prose instead of
|
|
16
16
|
* `{++inserted++}`/`{--deleted--}`/etc. Used when an anchor lives
|
|
17
|
-
* underneath previously imported track changes.
|
|
17
|
+
* underneath previously imported track changes. Delegates to the single
|
|
18
|
+
* annotation stripper so the matcher and the build path resolve markup the
|
|
19
|
+
* same way — a payload containing `+`, `-`, or `~` is handled correctly.
|
|
18
20
|
*/
|
|
19
21
|
export declare function stripCriticMarkup(text: string): string;
|
|
20
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-match.d.ts","sourceRoot":"","sources":["../../lib/anchor-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"anchor-match.d.ts","sourceRoot":"","sources":["../../lib/anchor-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,wBAAwB,GACxB,gBAAgB,GAChB,yBAAyB,GACzB,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,CAqBR;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAS7E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,MAAW,EACnB,KAAK,GAAE,MAAW,GACjB,kBAAkB,CAuKpB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,GAAG,WAAW,CAAC;AAElF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAsBlG"}
|
package/dist/lib/anchor-match.js
CHANGED
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
* anchor string and surrounding context, locate candidate positions in
|
|
5
5
|
* a target text using progressively looser strategies.
|
|
6
6
|
*/
|
|
7
|
+
import { stripAnnotations } from './annotations.js';
|
|
7
8
|
/**
|
|
8
9
|
* Strip CriticMarkup so the matcher sees plain prose instead of
|
|
9
10
|
* `{++inserted++}`/`{--deleted--}`/etc. Used when an anchor lives
|
|
10
|
-
* underneath previously imported track changes.
|
|
11
|
+
* underneath previously imported track changes. Delegates to the single
|
|
12
|
+
* annotation stripper so the matcher and the build path resolve markup the
|
|
13
|
+
* same way — a payload containing `+`, `-`, or `~` is handled correctly.
|
|
11
14
|
*/
|
|
12
15
|
export function stripCriticMarkup(text) {
|
|
13
|
-
return text
|
|
14
|
-
.replace(/\{\+\+([^+]*)\+\+\}/g, '$1') // insertions: keep new text
|
|
15
|
-
.replace(/\{--([^-]*)--\}/g, '') // deletions: remove old text
|
|
16
|
-
.replace(/\{~~([^~]*)~>([^~]*)~~\}/g, '$2') // substitutions: keep new text
|
|
17
|
-
.replace(/\{>>[\s\S]*?<<\}/g, '') // comments: remove (non-greedy; comment text may contain '<')
|
|
18
|
-
.replace(/\[([^\]]*)\]\{\.mark\}/g, '$1'); // marked text: keep text
|
|
16
|
+
return stripAnnotations(text);
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
19
|
* Return every starting index where `needle` occurs in `haystack`.
|
|
@@ -133,39 +131,67 @@ export function findAnchorInText(anchor, text, before = '', after = '') {
|
|
|
133
131
|
if (occurrences.length > 0) {
|
|
134
132
|
return { occurrences, matchedAnchor: anchor, strategy: 'stripped', stripped: true };
|
|
135
133
|
}
|
|
136
|
-
// Strategy 4:
|
|
134
|
+
// Strategy 4: word window from anchor (prefix or interior).
|
|
135
|
+
// Sliding the window across the anchor catches the case where the
|
|
136
|
+
// anchor's prefix has been edited but a chunk in the middle/end
|
|
137
|
+
// survived intact (e.g. "Sensitivity analyses were performed by
|
|
138
|
+
// perturbing the prior variance" → drifted "Sensitivity analyses
|
|
139
|
+
// perturbed the prior variance" still contains "the prior variance").
|
|
137
140
|
const words = anchor.split(/\s+/);
|
|
138
141
|
if (words.length > 3) {
|
|
139
142
|
for (let n = Math.min(6, words.length); n >= 3; n--) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
143
|
+
for (let start = 0; start + n <= words.length; start++) {
|
|
144
|
+
const window = words.slice(start, start + n).join(' ');
|
|
145
|
+
const windowLower = window.toLowerCase();
|
|
146
|
+
if (windowLower.length < 15)
|
|
147
|
+
continue;
|
|
148
|
+
let occ = findAllOccurrences(textLower, windowLower);
|
|
149
|
+
if (occ.length > 0) {
|
|
150
|
+
const strategy = start === 0 ? 'partial-start' : 'partial-window';
|
|
151
|
+
return { occurrences: occ, matchedAnchor: window, strategy };
|
|
145
152
|
}
|
|
146
|
-
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
matchedAnchor: words.slice(0, n).join(' '),
|
|
151
|
-
strategy: 'partial-start-stripped',
|
|
152
|
-
stripped: true,
|
|
153
|
-
};
|
|
153
|
+
occ = findAllOccurrences(strippedLower, windowLower);
|
|
154
|
+
if (occ.length > 0) {
|
|
155
|
+
const strategy = start === 0 ? 'partial-start-stripped' : 'partial-window-stripped';
|
|
156
|
+
return { occurrences: occ, matchedAnchor: window, strategy, stripped: true };
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
|
-
// Strategy 5: context (before/after) only
|
|
161
|
+
// Strategy 5: context (before/after) only.
|
|
162
|
+
//
|
|
163
|
+
// For a non-empty anchor that already failed every text-based strategy
|
|
164
|
+
// above, we treat context as a degraded placement: classify it
|
|
165
|
+
// 'context-only' so callers can warn the user. We also reject
|
|
166
|
+
// implausible brackets — if both contexts match but the gap between
|
|
167
|
+
// them is far too small to contain the anchor (e.g. the anchored
|
|
168
|
+
// sentence was deleted), do not silently land the comment between
|
|
169
|
+
// the surviving sentences. Return 'failed' so the user is told to
|
|
170
|
+
// place it manually.
|
|
159
171
|
if (before || after) {
|
|
160
172
|
const beforeLower = before.toLowerCase();
|
|
161
173
|
const afterLower = after.toLowerCase();
|
|
174
|
+
const anchorLen = anchor.length;
|
|
162
175
|
if (before && after) {
|
|
163
176
|
const beforeIdx = textLower.indexOf(beforeLower.slice(-50));
|
|
164
177
|
if (beforeIdx !== -1) {
|
|
165
178
|
const searchStart = beforeIdx + beforeLower.slice(-50).length;
|
|
166
179
|
const afterIdx = textLower.indexOf(afterLower.slice(0, 50), searchStart);
|
|
167
|
-
if (afterIdx !== -1
|
|
168
|
-
|
|
180
|
+
if (afterIdx !== -1) {
|
|
181
|
+
const gap = afterIdx - searchStart;
|
|
182
|
+
// Require the bracket to plausibly contain a remnant of the anchor.
|
|
183
|
+
// Below 30% of anchor length: anchor was deleted — refuse to place.
|
|
184
|
+
// Above 2× anchor length + slack: brackets are too far apart, the
|
|
185
|
+
// matcher has latched onto unrelated repeats of common context.
|
|
186
|
+
const minGap = Math.floor(anchorLen * 0.3);
|
|
187
|
+
const maxGap = Math.min(500, anchorLen * 2 + 50);
|
|
188
|
+
if (gap >= minGap && gap <= maxGap) {
|
|
189
|
+
return { occurrences: [searchStart], matchedAnchor: null, strategy: 'context-both' };
|
|
190
|
+
}
|
|
191
|
+
// Both brackets found but gap implausible: anchor likely deleted.
|
|
192
|
+
// Don't fall back to single-side context — that would silently
|
|
193
|
+
// place the comment in the wrong location.
|
|
194
|
+
return { occurrences: [], matchedAnchor: null, strategy: 'failed' };
|
|
169
195
|
}
|
|
170
196
|
}
|
|
171
197
|
}
|
|
@@ -212,6 +238,8 @@ export function classifyStrategy(strategy, occurrences) {
|
|
|
212
238
|
case 'stripped':
|
|
213
239
|
case 'partial-start':
|
|
214
240
|
case 'partial-start-stripped':
|
|
241
|
+
case 'partial-window':
|
|
242
|
+
case 'partial-window-stripped':
|
|
215
243
|
case 'split-match':
|
|
216
244
|
return 'drift';
|
|
217
245
|
case 'context-both':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-match.js","sourceRoot":"","sources":["../../lib/anchor-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"anchor-match.js","sourceRoot":"","sources":["../../lib/anchor-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAwBpD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAW,EACX,IAAY,EACZ,MAAc,EACd,KAAa,EACb,SAAiB;IAEjB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC3F,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvE,KAAK,MAAM,IAAI,IAAI,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vD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;gBACvE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACtE,CAAC;AAQD,MAAM,UAAU,gBAAgB,CAAC,QAAwB,EAAE,WAAmB;IAC5E,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAC1C,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,YAAY;YACf,OAAO,OAAO,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,eAAe,CAAC;QACrB,KAAK,wBAAwB,CAAC;QAC9B,KAAK,gBAAgB,CAAC;QACtB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,aAAa;YAChB,OAAO,OAAO,CAAC;QACjB,KAAK,cAAc,CAAC;QACpB,KAAK,gBAAgB,CAAC;QACtB,KAAK,eAAe;YAClB,OAAO,cAAc,CAAC;QACxB,KAAK,cAAc,CAAC;QACpB,KAAK,QAAQ,CAAC;QACd;YACE,OAAO,WAAW,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -33,12 +33,6 @@ export declare function stripAnnotations(text: string, options?: StripOptions):
|
|
|
33
33
|
* @throws TypeError If text is not a string
|
|
34
34
|
*/
|
|
35
35
|
export declare function stripToSingleSpace(text: string): string;
|
|
36
|
-
/**
|
|
37
|
-
* Check if text contains any CriticMarkup annotations
|
|
38
|
-
* @param text - Text to check
|
|
39
|
-
* @returns True if text contains any annotations
|
|
40
|
-
* @throws TypeError If text is not a string
|
|
41
|
-
*/
|
|
42
36
|
export declare function hasAnnotations(text: string): boolean;
|
|
43
37
|
/**
|
|
44
38
|
* Apply a decision to a single annotation (accept or reject)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../lib/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAuHnG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CA6G3D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAyFjF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqDvD;
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../lib/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAuHnG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CA6G3D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAyFjF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqDvD;AAmBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpD;AAeD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAiD3F;AAED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