docrev 0.10.1 → 0.10.2
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 +1 -1
- package/dist/lib/anchor-match.d.ts.map +1 -1
- package/dist/lib/anchor-match.js +47 -17
- package/dist/lib/anchor-match.js.map +1 -1
- package/dist/lib/build.js +4 -4
- package/dist/lib/commands/sync.d.ts.map +1 -1
- package/dist/lib/commands/sync.js +78 -100
- 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/grammar.js +3 -3
- package/dist/lib/macro-filter.lua +201 -201
- 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/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/eslint.config.js +27 -27
- package/issues.md +180 -0
- package/lib/anchor-match.ts +308 -276
- package/lib/annotations.ts +644 -644
- package/lib/build.ts +1766 -1766
- package/lib/citations.ts +160 -160
- package/lib/commands/build.ts +855 -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 +435 -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 +676 -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 +517 -517
- package/lib/config.ts +84 -84
- package/lib/crossref.ts +781 -781
- package/lib/csl.ts +191 -191
- package/lib/dependencies.ts +98 -98
- package/lib/diff-engine.ts +465 -465
- package/lib/doi-cache.ts +115 -115
- package/lib/doi.ts +897 -897
- package/lib/equations.ts +506 -506
- package/lib/errors.ts +346 -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 +911 -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/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 +94 -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 +550 -550
- package/lib/undo.ts +250 -250
- package/lib/utils.ts +69 -69
- package/lib/variables.ts +179 -179
- package/lib/word-extraction.ts +806 -806
- package/lib/word.ts +643 -643
- package/lib/wordcomments.ts +840 -840
- package/package.json +137 -137
- package/scripts/postbuild.js +47 -47
- package/site/assets/extra.css +208 -0
- package/site/commands.html +926 -0
- package/site/configuration.html +469 -0
- package/site/index.html +288 -0
- package/site/troubleshooting.html +461 -0
- package/site/workflow.html +518 -0
- 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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-match.d.ts","sourceRoot":"","sources":["../../lib/anchor-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,wBAAwB,GACxB,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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AE,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
|
@@ -133,39 +133,67 @@ export function findAnchorInText(anchor, text, before = '', after = '') {
|
|
|
133
133
|
if (occurrences.length > 0) {
|
|
134
134
|
return { occurrences, matchedAnchor: anchor, strategy: 'stripped', stripped: true };
|
|
135
135
|
}
|
|
136
|
-
// Strategy 4:
|
|
136
|
+
// Strategy 4: word window from anchor (prefix or interior).
|
|
137
|
+
// Sliding the window across the anchor catches the case where the
|
|
138
|
+
// anchor's prefix has been edited but a chunk in the middle/end
|
|
139
|
+
// survived intact (e.g. "Sensitivity analyses were performed by
|
|
140
|
+
// perturbing the prior variance" → drifted "Sensitivity analyses
|
|
141
|
+
// perturbed the prior variance" still contains "the prior variance").
|
|
137
142
|
const words = anchor.split(/\s+/);
|
|
138
143
|
if (words.length > 3) {
|
|
139
144
|
for (let n = Math.min(6, words.length); n >= 3; n--) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
+
for (let start = 0; start + n <= words.length; start++) {
|
|
146
|
+
const window = words.slice(start, start + n).join(' ');
|
|
147
|
+
const windowLower = window.toLowerCase();
|
|
148
|
+
if (windowLower.length < 15)
|
|
149
|
+
continue;
|
|
150
|
+
let occ = findAllOccurrences(textLower, windowLower);
|
|
151
|
+
if (occ.length > 0) {
|
|
152
|
+
const strategy = start === 0 ? 'partial-start' : 'partial-window';
|
|
153
|
+
return { occurrences: occ, matchedAnchor: window, strategy };
|
|
145
154
|
}
|
|
146
|
-
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
matchedAnchor: words.slice(0, n).join(' '),
|
|
151
|
-
strategy: 'partial-start-stripped',
|
|
152
|
-
stripped: true,
|
|
153
|
-
};
|
|
155
|
+
occ = findAllOccurrences(strippedLower, windowLower);
|
|
156
|
+
if (occ.length > 0) {
|
|
157
|
+
const strategy = start === 0 ? 'partial-start-stripped' : 'partial-window-stripped';
|
|
158
|
+
return { occurrences: occ, matchedAnchor: window, strategy, stripped: true };
|
|
154
159
|
}
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
|
-
// Strategy 5: context (before/after) only
|
|
163
|
+
// Strategy 5: context (before/after) only.
|
|
164
|
+
//
|
|
165
|
+
// For a non-empty anchor that already failed every text-based strategy
|
|
166
|
+
// above, we treat context as a degraded placement: classify it
|
|
167
|
+
// 'context-only' so callers can warn the user. We also reject
|
|
168
|
+
// implausible brackets — if both contexts match but the gap between
|
|
169
|
+
// them is far too small to contain the anchor (e.g. the anchored
|
|
170
|
+
// sentence was deleted), do not silently land the comment between
|
|
171
|
+
// the surviving sentences. Return 'failed' so the user is told to
|
|
172
|
+
// place it manually.
|
|
159
173
|
if (before || after) {
|
|
160
174
|
const beforeLower = before.toLowerCase();
|
|
161
175
|
const afterLower = after.toLowerCase();
|
|
176
|
+
const anchorLen = anchor.length;
|
|
162
177
|
if (before && after) {
|
|
163
178
|
const beforeIdx = textLower.indexOf(beforeLower.slice(-50));
|
|
164
179
|
if (beforeIdx !== -1) {
|
|
165
180
|
const searchStart = beforeIdx + beforeLower.slice(-50).length;
|
|
166
181
|
const afterIdx = textLower.indexOf(afterLower.slice(0, 50), searchStart);
|
|
167
|
-
if (afterIdx !== -1
|
|
168
|
-
|
|
182
|
+
if (afterIdx !== -1) {
|
|
183
|
+
const gap = afterIdx - searchStart;
|
|
184
|
+
// Require the bracket to plausibly contain a remnant of the anchor.
|
|
185
|
+
// Below 30% of anchor length: anchor was deleted — refuse to place.
|
|
186
|
+
// Above 2× anchor length + slack: brackets are too far apart, the
|
|
187
|
+
// matcher has latched onto unrelated repeats of common context.
|
|
188
|
+
const minGap = Math.floor(anchorLen * 0.3);
|
|
189
|
+
const maxGap = Math.min(500, anchorLen * 2 + 50);
|
|
190
|
+
if (gap >= minGap && gap <= maxGap) {
|
|
191
|
+
return { occurrences: [searchStart], matchedAnchor: null, strategy: 'context-both' };
|
|
192
|
+
}
|
|
193
|
+
// Both brackets found but gap implausible: anchor likely deleted.
|
|
194
|
+
// Don't fall back to single-side context — that would silently
|
|
195
|
+
// place the comment in the wrong location.
|
|
196
|
+
return { occurrences: [], matchedAnchor: null, strategy: 'failed' };
|
|
169
197
|
}
|
|
170
198
|
}
|
|
171
199
|
}
|
|
@@ -212,6 +240,8 @@ export function classifyStrategy(strategy, occurrences) {
|
|
|
212
240
|
case 'stripped':
|
|
213
241
|
case 'partial-start':
|
|
214
242
|
case 'partial-start-stripped':
|
|
243
|
+
case 'partial-window':
|
|
244
|
+
case 'partial-window-stripped':
|
|
215
245
|
case 'split-match':
|
|
216
246
|
return 'drift';
|
|
217
247
|
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;AAwBH;;;;GAIG;AACH,MAAM,UAAU,i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,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"}
|
package/dist/lib/build.js
CHANGED
|
@@ -968,10 +968,10 @@ export function buildPandocArgs(format, config, outputPath) {
|
|
|
968
968
|
}
|
|
969
969
|
// Fit images within slide bounds (default: true)
|
|
970
970
|
if (beamer.fit_images !== false) {
|
|
971
|
-
const fitImagesHeader = `\\makeatletter
|
|
972
|
-
\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}
|
|
973
|
-
\\def\\maxheight{\\ifdim\\Gin@nat@height>0.75\\textheight 0.75\\textheight\\else\\Gin@nat@height\\fi}
|
|
974
|
-
\\makeatother
|
|
971
|
+
const fitImagesHeader = `\\makeatletter
|
|
972
|
+
\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}
|
|
973
|
+
\\def\\maxheight{\\ifdim\\Gin@nat@height>0.75\\textheight 0.75\\textheight\\else\\Gin@nat@height\\fi}
|
|
974
|
+
\\makeatother
|
|
975
975
|
\\setkeys{Gin}{width=\\maxwidth,height=\\maxheight,keepaspectratio}`;
|
|
976
976
|
args.push('-V', `header-includes=${fitImagesHeader}`);
|
|
977
977
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../lib/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBzC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../lib/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBzC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAud/C"}
|