docrev 0.11.1 → 0.11.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 +202 -197
- package/PLAN-tables-and-postprocess.md +850 -850
- package/README.md +433 -433
- 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/build.d.ts +28 -0
- package/dist/lib/build.d.ts.map +1 -1
- package/dist/lib/build.js +81 -4
- package/dist/lib/build.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/schema.d.ts.map +1 -1
- package/dist/lib/schema.js +8 -2
- package/dist/lib/schema.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/lib/anchor-match.ts +307 -307
- package/lib/annotations.ts +664 -664
- package/lib/build.ts +2047 -1956
- package/lib/citations.ts +160 -160
- package/lib/commands/build.ts +885 -885
- 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 -451
- 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 -689
- 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 -99
- package/lib/config.ts +84 -84
- package/lib/crossref.ts +781 -781
- package/lib/csl.ts +191 -191
- package/lib/dependencies.ts +132 -132
- package/lib/diff-engine.ts +465 -465
- package/lib/doi-cache.ts +115 -115
- package/lib/doi.ts +879 -879
- package/lib/equations.ts +506 -506
- package/lib/errors.ts +350 -350
- 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 -906
- 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 -768
- 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 -127
- package/lib/response.ts +197 -197
- package/lib/restore-references.ts +240 -240
- package/lib/review.ts +327 -327
- package/lib/schema.ts +494 -488
- package/lib/scientific-words.ts +73 -73
- package/lib/sections.ts +428 -428
- 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 +166 -166
- package/lib/tui.ts +450 -450
- package/lib/types.ts +546 -546
- package/lib/undo.ts +250 -250
- package/lib/utils.ts +69 -69
- package/lib/variables.ts +179 -179
- package/lib/word-extraction.ts +525 -525
- package/lib/word.ts +526 -526
- package/lib/wordcomments.ts +789 -789
- package/package.json +1 -1
- package/scripts/postbuild.js +47 -47
- package/skill/REFERENCE.md +550 -550
- package/skill/SKILL.md +302 -302
- package/tsconfig.json +26 -26
- package/types/index.d.ts +531 -531
- package/issues.md +0 -180
- package/site/assets/extra.css +0 -208
- package/site/commands.html +0 -926
- package/site/configuration.html +0 -469
- package/site/index.html +0 -288
- package/site/troubleshooting.html +0 -461
- package/site/workflow.html +0 -518
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 "$@"
|
package/dist/lib/build.d.ts
CHANGED
|
@@ -21,6 +21,15 @@ export interface CrossrefConfig {
|
|
|
21
21
|
export interface PdfConfig {
|
|
22
22
|
template?: string | null;
|
|
23
23
|
headerIncludes?: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Path (relative to the project dir, or absolute) to a LaTeX preamble file
|
|
26
|
+
* injected via pandoc's `-H`. Use for custom fonts, `fancyhdr` running
|
|
27
|
+
* headers, `lineno` line numbers, etc. A missing file is reported, not
|
|
28
|
+
* silently dropped.
|
|
29
|
+
*/
|
|
30
|
+
header?: string | null;
|
|
31
|
+
/** Second LaTeX preamble file, injected via `-H` after {@link header}. */
|
|
32
|
+
footer?: string | null;
|
|
24
33
|
documentclass?: string;
|
|
25
34
|
fontsize?: string;
|
|
26
35
|
geometry?: string;
|
|
@@ -335,6 +344,25 @@ export declare function translateRawLatexFigures(content: string): {
|
|
|
335
344
|
* won't survive the docx build. Returns null when there's nothing to warn about.
|
|
336
345
|
*/
|
|
337
346
|
export declare function collectRawLatexFigureWarning(directory: string, config: BuildConfig): string | null;
|
|
347
|
+
/**
|
|
348
|
+
* Resolve user-supplied LaTeX preamble sources into files to inject via
|
|
349
|
+
* pandoc's `-H`. Covers `pdf.header` / `pdf.footer` (file paths, relative to
|
|
350
|
+
* the project dir) and an inline `header-includes` string (written to a temp
|
|
351
|
+
* `.tex` in the project dir). Pandoc runs with cwd = the project dir, so
|
|
352
|
+
* returned paths are left relative to it.
|
|
353
|
+
*
|
|
354
|
+
* A `pdf.header`/`pdf.footer` file that does not exist is reported in
|
|
355
|
+
* `warnings` rather than dropped silently — the fail-open loss of the entire
|
|
356
|
+
* user preamble was the bug this addresses.
|
|
357
|
+
*
|
|
358
|
+
* @returns headerArgs — file paths to pass after `-H`; tempFiles — paths the
|
|
359
|
+
* caller must clean up; warnings — human-readable notices for missing files.
|
|
360
|
+
*/
|
|
361
|
+
export declare function resolveLatexPreambleSources(directory: string, config: BuildConfig): {
|
|
362
|
+
headerArgs: string[];
|
|
363
|
+
tempFiles: string[];
|
|
364
|
+
warnings: string[];
|
|
365
|
+
};
|
|
338
366
|
/**
|
|
339
367
|
* Build pandoc arguments for format.
|
|
340
368
|
*
|
package/dist/lib/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,EAAoD,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAUlH,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,KAAK,QAAQ,EAKd,MAAM,aAAa,CAAC;AAqBrB,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,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EA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C1C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,SAAS,GAAE,MAAM,EAAO,GACvB,MAAM,EAAE,CAaV;AAwBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAI/E;AAWD,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAalD;AAgBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,MAAM,CAgBR;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,YAAY,CAAC,CAmOvB;AAED;;GAEG;AACH,wBAAsB,KAAK,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,MAAM,EAAoB,EACnC,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,eAAe,CAAC,CAsE1B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAYjE"}
|
package/dist/lib/build.js
CHANGED
|
@@ -986,6 +986,69 @@ export function collectRawLatexFigureWarning(directory, config) {
|
|
|
986
986
|
return null;
|
|
987
987
|
return formatRawLatexFigureWarning(all, translateEnabled);
|
|
988
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* Collect an inline `header-includes` LaTeX string from the config. Pandoc's
|
|
991
|
+
* native metadata key is `header-includes`; accept it at the top level (where
|
|
992
|
+
* pandoc documents it) and under `pdf`. String or list of strings; entries are
|
|
993
|
+
* joined with newlines. Returns null when nothing is set.
|
|
994
|
+
*/
|
|
995
|
+
function getInlineHeaderIncludes(config) {
|
|
996
|
+
const top = config['header-includes'];
|
|
997
|
+
const pdf = config.pdf?.['header-includes'];
|
|
998
|
+
const parts = [];
|
|
999
|
+
for (const value of [top, pdf]) {
|
|
1000
|
+
if (typeof value === 'string' && value.trim()) {
|
|
1001
|
+
parts.push(value);
|
|
1002
|
+
}
|
|
1003
|
+
else if (Array.isArray(value)) {
|
|
1004
|
+
for (const item of value) {
|
|
1005
|
+
if (typeof item === 'string' && item.trim())
|
|
1006
|
+
parts.push(item);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return parts.length > 0 ? parts.join('\n') : null;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Resolve user-supplied LaTeX preamble sources into files to inject via
|
|
1014
|
+
* pandoc's `-H`. Covers `pdf.header` / `pdf.footer` (file paths, relative to
|
|
1015
|
+
* the project dir) and an inline `header-includes` string (written to a temp
|
|
1016
|
+
* `.tex` in the project dir). Pandoc runs with cwd = the project dir, so
|
|
1017
|
+
* returned paths are left relative to it.
|
|
1018
|
+
*
|
|
1019
|
+
* A `pdf.header`/`pdf.footer` file that does not exist is reported in
|
|
1020
|
+
* `warnings` rather than dropped silently — the fail-open loss of the entire
|
|
1021
|
+
* user preamble was the bug this addresses.
|
|
1022
|
+
*
|
|
1023
|
+
* @returns headerArgs — file paths to pass after `-H`; tempFiles — paths the
|
|
1024
|
+
* caller must clean up; warnings — human-readable notices for missing files.
|
|
1025
|
+
*/
|
|
1026
|
+
export function resolveLatexPreambleSources(directory, config) {
|
|
1027
|
+
const headerArgs = [];
|
|
1028
|
+
const tempFiles = [];
|
|
1029
|
+
const warnings = [];
|
|
1030
|
+
const pdf = (config.pdf || {});
|
|
1031
|
+
for (const key of ['header', 'footer']) {
|
|
1032
|
+
const value = pdf[key];
|
|
1033
|
+
if (!value || typeof value !== 'string')
|
|
1034
|
+
continue;
|
|
1035
|
+
const abs = path.isAbsolute(value) ? value : path.join(directory, value);
|
|
1036
|
+
if (fs.existsSync(abs)) {
|
|
1037
|
+
headerArgs.push(value);
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
warnings.push(`pdf.${key}: LaTeX preamble file not found — ${value} (not applied)`);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
const inline = getInlineHeaderIncludes(config);
|
|
1044
|
+
if (inline) {
|
|
1045
|
+
const inlinePath = path.join(directory, '.header-includes.tex');
|
|
1046
|
+
fs.writeFileSync(inlinePath, inline.endsWith('\n') ? inline : inline + '\n', 'utf-8');
|
|
1047
|
+
tempFiles.push(inlinePath);
|
|
1048
|
+
headerArgs.push(path.basename(inlinePath));
|
|
1049
|
+
}
|
|
1050
|
+
return { headerArgs, tempFiles, warnings };
|
|
1051
|
+
}
|
|
989
1052
|
/**
|
|
990
1053
|
* Build pandoc arguments for format.
|
|
991
1054
|
*
|
|
@@ -1094,10 +1157,10 @@ export function buildPandocArgs(format, config, outputPath) {
|
|
|
1094
1157
|
}
|
|
1095
1158
|
// Fit images within slide bounds (default: true)
|
|
1096
1159
|
if (beamer.fit_images !== false) {
|
|
1097
|
-
const fitImagesHeader = `\\makeatletter
|
|
1098
|
-
\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}
|
|
1099
|
-
\\def\\maxheight{\\ifdim\\Gin@nat@height>0.75\\textheight 0.75\\textheight\\else\\Gin@nat@height\\fi}
|
|
1100
|
-
\\makeatother
|
|
1160
|
+
const fitImagesHeader = `\\makeatletter
|
|
1161
|
+
\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}
|
|
1162
|
+
\\def\\maxheight{\\ifdim\\Gin@nat@height>0.75\\textheight 0.75\\textheight\\else\\Gin@nat@height\\fi}
|
|
1163
|
+
\\makeatother
|
|
1101
1164
|
\\setkeys{Gin}{width=\\maxwidth,height=\\maxheight,keepaspectratio}`;
|
|
1102
1165
|
args.push('-V', `header-includes=${fitImagesHeader}`);
|
|
1103
1166
|
}
|
|
@@ -1335,6 +1398,20 @@ export async function runPandoc(inputPath, format, config, options = {}) {
|
|
|
1335
1398
|
args.push('-H', path.basename(preamblePath));
|
|
1336
1399
|
}
|
|
1337
1400
|
}
|
|
1401
|
+
// User-supplied LaTeX preamble: pdf.header / pdf.footer (file paths) and an
|
|
1402
|
+
// inline header-includes block, injected through pandoc's -H channel — the
|
|
1403
|
+
// same mechanism the macros preamble and annotated-comments path use. Only
|
|
1404
|
+
// the LaTeX family consumes a preamble.
|
|
1405
|
+
if (format === 'pdf' || format === 'tex' || format === 'beamer') {
|
|
1406
|
+
const { headerArgs, tempFiles, warnings } = resolveLatexPreambleSources(directory, config);
|
|
1407
|
+
for (const warning of warnings) {
|
|
1408
|
+
console.warn(`Warning: ${warning}`);
|
|
1409
|
+
}
|
|
1410
|
+
for (const headerFile of headerArgs) {
|
|
1411
|
+
args.push('-H', headerFile);
|
|
1412
|
+
}
|
|
1413
|
+
macroTempFiles.push(...tempFiles);
|
|
1414
|
+
}
|
|
1338
1415
|
// Add crossref metadata file if exists (skip for slides - they don't use crossref)
|
|
1339
1416
|
if (format !== 'beamer' && format !== 'pptx') {
|
|
1340
1417
|
const crossrefPath = path.join(directory, 'crossref.yaml');
|