-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodules-epubtools.html
executable file
·624 lines (610 loc) · 48.1 KB
/
modules-epubtools.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xml:base="../modules-epubtools.html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>epubtools</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="theme-color" content="#FF9800" />
<link rel="apple-touch-icon-precomposed" href="icons/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="icons/mstile-144x144.png" />
<link rel="icon" href="icons/favicon-32x32.png" sizes="32x32" />
<link type="text/css" rel="stylesheet" media="screen,projection" href="css/prism.css" />
<link type="text/css" rel="stylesheet" media="screen,projection" href="css/materialize.min.css" />
<link type="text/css" rel="stylesheet" media="screen,projection" href="css/le-tex.css" />
</head>
<body id="modules-epubtools">
<header>
<div class="container"><a href="#" data-activates="tr-nav" class="button-collapse top-nav circle hide-on-large-only"><i class="mdi-navigation-menu"></i></a></div>
<ul id="tr-nav" class="side-nav fixed" style="width:260px">
<li class="logo"><a id="logo-container" href="#" class="brand-logo"><object id="front-page-logo" type="image/svg+xml" data="icons/logo-transpect.svg">Your browser does not support SVG</object></a></li>
<li class="naventry-1st"><a href="index.html">About</a></li>
<li class="naventry-1st"><a href="getting-started.html">Getting Started</a></li>
<li class="active no-padding">
<ul class="collapsible collapsible-accordion">
<li class="active naventry-1st" id="d42574e418"><a class="active collapsible-header">Modules</a><div style="display:block" class="collapsible-body">
<ul>
<li class="naventry-2nd"><a href="modules-CoCoTeX.html">CoCoTeX</a></li>
<li class="naventry-2nd"><a href="modules-ace-daisy.html">ace-daisy</a></li>
<li class="naventry-2nd"><a href="modules-basex-svn-api.html">basex-svn-api</a></li>
<li class="naventry-2nd"><a href="modules-bib-parser.html">bib-parser</a></li>
<li class="naventry-2nd"><a href="modules-bits2hub.html">bits2hub</a></li>
<li class="naventry-2nd"><a href="modules-calabash-distro.html">calabash-distro</a></li>
<li class="naventry-2nd"><a href="modules-calabash-frontend.html">calabash-frontend</a></li>
<li class="naventry-2nd"><a href="modules-cascade.html">cascade</a></li>
<li class="naventry-2nd"><a href="modules-control.html">control</a></li>
<li class="naventry-2nd"><a href="modules-control-backend.html">control-backend</a></li>
<li class="naventry-2nd"><a href="modules-crossref.html">crossref</a></li>
<li class="naventry-2nd"><a href="modules-css-tools.html">css-tools</a></li>
<li class="naventry-2nd"><a href="modules-docx2hub.html">docx2hub</a></li>
<li class="naventry-2nd"><a href="modules-docx2hub-frontend.html">docx2hub-frontend</a></li>
<li class="naventry-2nd"><a href="modules-docx2jats-demo.html">docx2jats-demo</a></li>
<li class="naventry-2nd"><a href="modules-docx2tex.html">docx2tex</a></li>
<li class="naventry-2nd"><a href="modules-docx_modify-lib.html">docx_modify-lib</a></li>
<li class="naventry-2nd"><a href="modules-epub-font-subsetter.html">epub-font-subsetter</a></li>
<li class="naventry-2nd"><a href="modules-epub2epub.html">epub2epub</a></li>
<li class="naventry-2nd"><a href="modules-epub2hub-lib.html">epub2hub-lib</a></li>
<li class="naventry-2nd"><a href="modules-epubcheck-extension.html">epubcheck-extension</a></li>
<li class="naventry-2nd"><a href="modules-epubcheck-idpf.html">epubcheck-idpf</a></li>
<li class="naventry-2nd"><a href="modules-epubcheck-transpect.html">epubcheck-transpect</a></li>
<li class="active naventry-2nd"><a href="modules-epubtools.html">epubtools</a></li>
<li class="naventry-2nd"><a href="modules-epubtools-frontend.html">epubtools-frontend</a></li>
<li class="naventry-2nd"><a href="modules-evolve-hub.html">evolve-hub</a></li>
<li class="naventry-2nd"><a href="modules-font-obfuscate-extension.html">font-obfuscate-extension</a></li>
<li class="naventry-2nd"><a href="modules-fontmaps.html">fontmaps</a></li>
<li class="naventry-2nd"><a href="modules-github-api.html">github-api</a></li>
<li class="naventry-2nd"><a href="modules-html2hub.html">html2hub</a></li>
<li class="naventry-2nd"><a href="modules-html2xlsx.html">html2xlsx</a></li>
<li class="naventry-2nd"><a href="modules-htmlreports.html">htmlreports</a></li>
<li class="naventry-2nd"><a href="modules-htmltables.html">htmltables</a></li>
<li class="naventry-2nd"><a href="modules-htmltemplates.html">htmltemplates</a></li>
<li class="naventry-2nd"><a href="modules-hub2bits.html">hub2bits</a></li>
<li class="naventry-2nd"><a href="modules-hub2dbk.html">hub2dbk</a></li>
<li class="naventry-2nd"><a href="modules-hub2docx-frontend.html">hub2docx-frontend</a></li>
<li class="naventry-2nd"><a href="modules-hub2docx-lib.html">hub2docx-lib</a></li>
<li class="naventry-2nd"><a href="modules-hub2html.html">hub2html</a></li>
<li class="naventry-2nd"><a href="modules-hub2tei.html">hub2tei</a></li>
<li class="naventry-2nd"><a href="modules-idml2xml.html">idml2xml</a></li>
<li class="naventry-2nd"><a href="modules-idml2xml-frontend.html">idml2xml-frontend</a></li>
<li class="naventry-2nd"><a href="modules-idml_docx-to-docbook_epub-demo.html">idml_docx-to-docbook_epub-demo</a></li>
<li class="naventry-2nd"><a href="modules-idmlvalidation.html">idmlvalidation</a></li>
<li class="naventry-2nd"><a href="modules-image-props-extension.html">image-props-extension</a></li>
<li class="naventry-2nd"><a href="modules-image-transform-extension.html">image-transform-extension</a></li>
<li class="naventry-2nd"><a href="modules-jats2html.html">jats2html</a></li>
<li class="naventry-2nd"><a href="modules-javascript-extension.html">javascript-extension</a></li>
<li class="naventry-2nd"><a href="modules-jing-trang-patch.html">jing-trang-patch</a></li>
<li class="naventry-2nd"><a href="modules-kindlegen-amzn.html">kindlegen-amzn</a></li>
<li class="naventry-2nd"><a href="modules-latex-math-images.html">latex-math-images</a></li>
<li class="naventry-2nd"><a href="modules-logo.html">logo</a></li>
<li class="naventry-2nd"><a href="modules-map-style-names.html">map-style-names</a></li>
<li class="naventry-2nd"><a href="modules-markdown2hub.html">markdown2hub</a></li>
<li class="naventry-2nd"><a href="modules-mathtype-extension.html">mathtype-extension</a></li>
<li class="naventry-2nd"><a href="modules-mml-normalize.html">mml-normalize</a></li>
<li class="naventry-2nd"><a href="modules-mml2tex.html">mml2tex</a></li>
<li class="naventry-2nd"><a href="modules-nlm-stylechecker.html">nlm-stylechecker</a></li>
<li class="naventry-2nd"><a href="modules-officeopenxml-validation.html">officeopenxml-validation</a></li>
<li class="naventry-2nd"><a href="modules-pdf2fxl.html">pdf2fxl</a></li>
<li class="naventry-2nd"><a href="modules-proj-eval.html">proj-eval</a></li>
<li class="naventry-2nd"><a href="modules-pygmentize-xpl.html">pygmentize-xpl</a></li>
<li class="naventry-2nd"><a href="modules-rng-extension.html">rng-extension</a></li>
<li class="naventry-2nd"><a href="modules-schema-bits.html">schema-bits</a></li>
<li class="naventry-2nd"><a href="modules-schema-html.html">schema-html</a></li>
<li class="naventry-2nd"><a href="modules-schema-jats.html">schema-jats</a></li>
<li class="naventry-2nd"><a href="modules-schema-onix.html">schema-onix</a></li>
<li class="naventry-2nd"><a href="modules-schematron.html">schematron</a></li>
<li class="naventry-2nd"><a href="modules-sdox2hub.html">sdox2hub</a></li>
<li class="naventry-2nd"><a href="modules-semex.html">semex</a></li>
<li class="naventry-2nd"><a href="modules-split-docx.html">split-docx</a></li>
<li class="naventry-2nd"><a href="modules-stylemapper-frontend.html">stylemapper-frontend</a></li>
<li class="naventry-2nd"><a href="modules-stylemapper-lib.html">stylemapper-lib</a></li>
<li class="naventry-2nd"><a href="modules-svn-extension.html">svn-extension</a></li>
<li class="naventry-2nd"><a href="modules-tei2bits.html">tei2bits</a></li>
<li class="naventry-2nd"><a href="modules-tei2html.html">tei2html</a></li>
<li class="naventry-2nd"><a href="modules-tei2hub.html">tei2hub</a></li>
<li class="naventry-2nd"><a href="modules-tokenized-to-tree.html">tokenized-to-tree</a></li>
<li class="naventry-2nd"><a href="modules-transpect.github.io.html">transpect.github.io</a></li>
<li class="naventry-2nd"><a href="modules-transpectdoc.html">transpectdoc</a></li>
<li class="naventry-2nd"><a href="modules-unwrap-mml.html">unwrap-mml</a></li>
<li class="naventry-2nd"><a href="modules-unzip-extension.html">unzip-extension</a></li>
<li class="naventry-2nd"><a href="modules-upload-webcomponent.html">upload-webcomponent</a></li>
<li class="naventry-2nd"><a href="modules-use-css-decorator-classes.html">use-css-decorator-classes</a></li>
<li class="naventry-2nd"><a href="modules-xerif.html">xerif</a></li>
<li class="naventry-2nd"><a href="modules-xerif-demo.html">xerif-demo</a></li>
<li class="naventry-2nd"><a href="modules-xerif-latex.html">xerif-latex</a></li>
<li class="naventry-2nd"><a href="modules-xlsx2html-frontend.html">xlsx2html-frontend</a></li>
<li class="naventry-2nd"><a href="modules-xlsx2html-lib.html">xlsx2html-lib</a></li>
<li class="naventry-2nd"><a href="modules-xml2idml.html">xml2idml</a></li>
<li class="naventry-2nd"><a href="modules-xml2tex.html">xml2tex</a></li>
<li class="naventry-2nd"><a href="modules-xproc-util.html">xproc-util</a></li>
<li class="naventry-2nd"><a href="modules-xproc3kit.html">xproc3kit</a></li>
<li class="naventry-2nd"><a href="modules-xslt-util.html">xslt-util</a></li>
</ul>
</div>
</li>
</ul>
</li>
<li class="naventry-1st"><a href="styleguide.html">Styleguide</a></li>
<li class="naventry-1st"><a href="tutorial.html">Tutorials</a></li>
</ul>
</header>
<main>
<div class="section orange" id="index-banner">
<div class="container">
<h1 id="tr-title" class="light header center-on-small-only white-text">epubtools</h1>
<h4 id="tr-subtitle" class="light orange-text text-lighten-4 center-on-small-only">Library to convert and check EPUB 2 and 3</h4>
</div>
</div>
<div class="container">
<div class="row">
<div class="col s12 m9 l10" id="tr-content">
<div class="card">
<div class="card-content"><span class="card-title">Repository</span><table class="informaltable">
<tbody>
<tr>
<td>Git URL</td>
<td><code class="language-markup">https://github.com/transpect/epubtools.git</code></td>
</tr>
<tr>
<td>SVN URL</td>
<td><code class="language-markup">https://github.com/transpect/epubtools</code></td>
</tr>
<tr>
<td>Base URI</td>
<td><code class="language-markup">http://transpect.io/epubtools/</code></td>
</tr>
</tbody>
</table>
<p><a href="https://github.com/transpect/epubtools" class="btn-flat orange lighten-4">Source ⬇</a></p>
</div>
</div>
<div id="epub-create-ocf" class="section scrollspy">
<h2 class="header">epub:create-ocf</h2>
<p> This step is used to create the directory structure of the OCF Abstract Container.
It is required to provide
as option the path to the source html file. </p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/create-ocf/xpl/create-ocf.xpl"/></code></pre>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:create-ocf xmlns:epub="http://transpect.io/epubtools">
<p:input port="meta"/>
<p:output port="result" sequence="true" primary="true"/>
<p:output port="files" primary="false"/>
<p:option name="base-uri" required="true"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</epub:create-ocf></code></pre>
</div>
<div id="epub-create-opf" class="section scrollspy">
<h2 class="header">epub:create-opf</h2>
<p> This step expects a file list of the EPUB content files in this form:
<cx:document>
<c:file name="OEBPS/chapter01.xhtml"/>
</cx:document>
It provides the OPF file on the result port. The output of the files port is the file
reference of the content.opf but not
all file references in the OPF file. </p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/create-opf/xpl/create-opf.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
<li>
<p><a href="modules-xslt-util.html">xslt-util</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:create-opf xmlns:epub="http://transpect.io/epubtools">
<p:input port="source"/>
<p:input port="meta"/>
<p:output port="result" primary="true"/>
<p:output port="files" primary="false"/>
<p:option name="base-uri" required="true"/>
<p:option name="target" select="'EPUB2'"/>
<p:option name="terminate-on-error" select="'yes'"/>
<p:option name="use-svg" select="'yes'"/>
<p:option name="create-a11y-meta" required="false" select="'yes'"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</epub:create-opf></code></pre>
</div>
<div id="epub-create-ops" class="section scrollspy">
<h2 class="header">epub:create-ops</h2>
<p>Hashed file names are patched into the HTML before split</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/create-ops/xpl/create-ops.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-image-props-extension.html">image-props-extension</a></p>
</li>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
<li>
<p><a href="modules-css-tools.html">css-tools</a></p>
</li>
<li>
<p><a href="modules-xslt-util.html">xslt-util</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:create-ops xmlns:epub="http://transpect.io/epubtools">
<p:input port="source" primary="true"/>
<p:input port="conf" sequence="true" primary="false"/>
<p:input port="meta" primary="false"/>
<p:input port="attach-cover-xsl" primary="false"/>
<p:input port="create-svg-cover-xsl" primary="false"/>
<p:input port="cover-svg" primary="false"/>
<p:output port="result" primary="true"/>
<p:output port="html"/>
<p:output port="files" primary="false"/>
<p:output port="report" sequence="true" primary="false"/>
<p:output port="splitting-report" sequence="true"/>
<p:option name="base-uri" required="true"/>
<p:option name="target" select="'EPUB2'"/>
<p:option name="css-filename" required="false" select="'stylesheet.css'"/>
<p:option name="use-svg" select="'yes'"/>
<p:option name="terminate-on-error" required="false" select="'yes'"/>
<p:option name="debug" required="false" select="'no'"/>
<p:option name="debug-dir-uri" required="false" select="'debug'"/>
<p:option name="status-dir-uri" select="'status'"/>
<p:option name="create-a11y-meta" select="'yes'"/>
<p:option name="create-font-subset" required="false" select="'false'"/>
<p:option name="font-subset-min-file-size" required="false" select="0"/>
<p:option name="create-svg-cover" required="false" select="'false'"/>
<p:option name="convert-svg-cover" required="false" select="'false'"/>
<p:option name="pull-up-epub-type-to-body" required="false" select="'false'"/>
</epub:create-ops></code></pre>
</div>
<div id="tr-font-obfuscate" class="section scrollspy">
<h2 class="header">tr:font-obfuscate</h2>
<p>
This step applies the EPUB font obfuscation algorithm to
all font files that are declared in the CSS.
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/font-obfuscate/xpl/font-obfuscate.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><tr:font-obfuscate xmlns:tr="http://transpect.io">
<p:input port="source" primary="true"/>
<p:input port="meta" primary="false"/>
<p:output port="result"/>
<p:option name="targetdir"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug-dir-uri'"/>
</tr:font-obfuscate></code></pre>
</div>
<div id="tr-create-font-subset" class="section scrollspy">
<h2 class="header">tr:create-font-subset</h2>
<p>This pipeline creates fontsubsets. The characters used
in each font will be displayed in a character set. The subset is created
using the pyftsubset phython script from fonttools https://github.com/fonttools.
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/fontsubsetter/xpl/fontsubsetter.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-css-tools.html">css-tools</a></p>
</li>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><tr:create-font-subset xmlns:tr="http://transpect.io">
<p:input port="source" primary="true"/>
<p:input port="expand-css"/>
<p:output port="result" sequence="true" primary="true"/>
<p:option name="script-path" select="'../../../scripts/pyftsubset.sh'"/>
<p:option name="min-file-size-kb" select="0"/>
<p:option name="debug" required="false" select="'yes'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</tr:create-font-subset></code></pre>
</div>
<div id="epub-html-splitter" class="section scrollspy">
<h2 class="header">epub:html-splitter</h2>
<p>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">Sample invocation (for debugging purposes):</p>
<pre xmlns:p="http://www.w3.org/ns/xproc" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">calabash/calabash.sh
-i source=file:/$(cygpath -ma ../content/output/debug/epubtools/create-ops/pre-split.html)
-i meta=file:/$(cygpath -ma a9s/publisher/series/epubtools/heading-conf.xml)
-o result=tmp.html -o report=report.xml -o files=files.xml
file:/$(cygpath -ma epubtools/modules/html-splitter/xpl/html-splitter.xpl)
base-uri=file:/$(cygpath -ma ../content/output/debug/epubtools/create-ops/pre-split.html)
debug=yes
debug-dir-uri=file:/$(cygpath -ma ../content/output/debug)</pre>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">Calabash seems to suppress some XSLT errors, for instance when a stylesheet is looping.
Therefore it might be
necessary to replace collection()[…] with document(…) in the XSL (alternative variable
declarations are already
included in the xsl file, commented out) and run saxon from the command line, for
example like this:</p>
<pre xmlns:p="http://www.w3.org/ns/xproc" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">saxon -xsl:epubtools/modules/html-splitter/xsl/html-splitter.xsl -it:main \
collection-uri=file:/path/to/debugdir/epubtools/html-splitter/…/splitter-input.catalog.xml) \
-s:[any.xml] debug=yes debug-dir-uri=file:/other/path/to/debug/dir</pre>
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/html-splitter/xpl/html-splitter.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:html-splitter xmlns:epub="http://transpect.io/epubtools">
<p:input port="source" primary="true"/>
<p:input port="conf" sequence="true" primary="false"/>
<p:input port="meta" primary="false"/>
<p:input port="css-xml"/>
<p:output port="result" primary="true"/>
<p:output port="files" primary="false"/>
<p:output port="report"/>
<p:output port="unused-css-resources" sequence="true"/>
<p:output port="splitting-report" sequence="true"/>
<p:option name="base-uri" required="true"/>
<p:option name="target" select="'EPUB2'"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
<p:option name="pull-up-epub-type-to-body" required="false" select="'false'"/>
</epub:html-splitter></code></pre>
</div>
<div id="epub-insert-amzn-region-magnification" class="section scrollspy">
<h2 class="header">epub:insert-amzn-region-magnification</h2>
<p> This pipeline adds Amazon's Region Magnification markup to each
<code xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">div</code> which includes the <code xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">magnification</code> class:
<pre xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink"><code><div class="magnification">
<p id="p-1-02">A quick brown fox jumps over a lazy dog.</p>
</div></code></pre>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">The script adds Region Magnification markup according to <a href="https://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf" target="_blank">Amazon's Kindle Publishing Guidelines</a>.
</p>
<pre xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink"><code><div id="amzn-id-myBook-1-txt" class="source-mag"><a class="app-amzn-magnify" data-app-amzn-magnify="{"targetId":"magTarget-amzn-id-myBook\
_000019-1","sourceId":"magSource-amzn-id-myBook-1","ordinal":1}">
<p id="p-1-02">A quick brown fox jumps over a lazy dog.</p>
</a></div><div id="amzn-id-myBook-1-magTarget" class="target-mag">
<p>A quick brown fox jumps over a lazy dog.</p>
</div></code></pre>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">Please note that you later need to execute a bash script which escapes the quotes.
The script can be found here: <code>scripts/escape-for-amzn-region-magnification.sh</code></p>
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/html-splitter/xpl/insert-amzn-region-magnification.xpl"/></code></pre>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:insert-amzn-region-magnification xmlns:epub="http://transpect.io/epubtools">
<p:input port="source" sequence="true"/>
<p:output port="result" sequence="true"/>
<p:option name="amzn-region-magnification" select="'false'"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</epub:insert-amzn-region-magnification></code></pre>
</div>
<div id="epub-split-css" class="section scrollspy">
<h2 class="header">epub:split-css</h2>
<p>
This pipeline is used to split the CSS based on the submitted value of the option
<code xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">css-handling</code>.
With the value <code xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">regenerated-per-split</code>, the CSS is analyzed and splitted for each HTML chunk. Commonly
used CSS properties are stored to a global CSS stylesheet, whereas unused CSS properties
are filtered.
With the value <code xmlns:p="http://www.w3.org/ns/xproc" xmlns:tr="http://transpect.io" xmlns:css="http://www.w3.org/1996/css" xmlns:epub="http://transpect.io/epubtools" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">unchanged</code> CSS and HTML remain unchanged.
Per default, a new CSS stylesheet is generated from the CSS XML representation.
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/html-splitter/xpl/split-css.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-css-tools.html">css-tools</a></p>
</li>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:split-css xmlns:epub="http://transpect.io/epubtools">
<p:input port="source" sequence="true" primary="true"/>
<p:input port="css-xml" primary="false"/>
<p:output port="result" sequence="true" primary="true"/>
<p:output port="unused-css-resources" sequence="true" primary="false"/>
<p:option name="target" required="true"/>
<p:option name="css-handling" required="true"/>
<p:option name="svg-scale-hack" required="true"/>
<p:option name="basename" required="true"/>
<p:option name="html-subdir-name" required="true"/>
<p:option name="common-source-dir-elimination-regex" required="true"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</epub:split-css></code></pre>
</div>
<div id="tr-check-links" class="section scrollspy">
<h2 class="header">tr:check-links</h2>
<p>
This step checks whether links are available.
TO DO: additional report. Perhaps chooseable link attribute names.
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/link-checker/xpl/link-checker.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><tr:check-links xmlns:tr="http://transpect.io">
<p:input port="source" primary="true"/>
<p:output port="result"/>
<p:option name="only" select="''"/>
<p:option name="never" select="''"/>
<p:option name="debug-dir-uri" select="'debug-dir-uri'"/>
<p:option name="status-dir-uri" select="'status'"/>
</tr:check-links></code></pre>
</div>
<div id="epub-zip-package" class="section scrollspy">
<h2 class="header">epub:zip-package</h2>
<p> This step expects a file manifest as input and creates a zip-package. The file manifest
should have
been this form:
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/modules/zip-package/xpl/zip-package.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
<li>
<p><a href="modules-xslt-util.html">xslt-util</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:zip-package xmlns:epub="http://transpect.io/epubtools">
<p:input port="ocf-filerefs"/>
<p:input port="opf-fileref"/>
<p:input port="ops-filerefs"/>
<p:input port="meta"/>
<p:output port="result" primary="true"/>
<p:output port="files" primary="false"/>
<p:option name="base-uri" required="true"/>
<p:option name="debug" select="'no'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
</epub:zip-package></code></pre>
</div>
<div id="epub-convert" class="section scrollspy">
<h2 class="header">epub:convert</h2>
<p>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:cxf="http://xmlcalabash.com/ns/extensions/fileutils" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">This step takes a HTML file as input and converts it to an epub file. You need a configuration
for the HTML splitting and
the OPF metadata. Examples can be found in the sample directory. Invoke this step
on the command line with:</p>
<pre xmlns:p="http://www.w3.org/ns/xproc" xmlns:cxf="http://xmlcalabash.com/ns/extensions/fileutils" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink"><code>calabash/calabash.sh -i source=sample/b978-3-646-92351-3.xhtml
-i conf=sample/hierarchy.xml -i meta=sample/epub-config.xml epub-convert.xpl </code></pre>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:cxf="http://xmlcalabash.com/ns/extensions/fileutils" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">Note that it’s advisable to make all file inputs absolute URIs, by using <code>cygpath</code> on Cygwin or <code>readlink -f</code>
on Unixy systems. For bash, this is, e.g., <code>source=file:/$(cygpath -ma sample/b978-3-646-92351-3.xhtml)</code> </p>
<p xmlns:p="http://www.w3.org/ns/xproc" xmlns:cxf="http://xmlcalabash.com/ns/extensions/fileutils" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:epub="http://transpect.io/epubtools" xmlns:tr="http://transpect.io" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:j="http://marklogic.com/json" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xlink="http://www.w3.org/1999/xlink">8/2023: new feature: if HTML contains a >div>, >section> or >nav> element with
<pre>@class="as-nav"</pre> and
<pre>@epub:type="loi"</pre> (or "lot") that section is removed from content and moved into the navigation page
as >nav> element.
This works not for EPUB2. Structure is expexted as >ol>>li>>a href="link-to-fig">Fig
1: xyz>/a>>/li>>/ol>.</p>
</p>
<h4>Import</h4>
<pre><code class="language-markup"><p:import href="http://transpect.io/epubtools/xpl/epub-convert.xpl"/></code></pre>
<h4>Dependencies</h4>
<ul>
<li>
<p><a href="modules-schematron.html">schematron</a></p>
</li>
<li>
<p><a href="modules-xproc-util transpect.github.io.html">xproc-util transpect.github.io</a></p>
</li>
<li>
<p><a href="modules-xslt-util.html">xslt-util</a></p>
</li>
</ul>
<h4>Synopsis</h4>
<pre><code class="language-markup"><epub:convert xmlns:epub="http://transpect.io/epubtools">
<p:input port="source" primary="true"/>
<p:input port="conf" sequence="true" primary="false"/>
<p:input port="meta" primary="false"/>
<p:input port="schematron"/>
<p:input port="attach-cover-xsl"/>
<p:input port="custom-schematron" sequence="true"/>
<p:input port="cover-svg"/>
<p:input port="create-svg-cover-xsl" primary="false"/>
<p:output port="result" primary="true"/>
<p:output port="chunks" primary="false"/>
<p:output port="opf" primary="false"/>
<p:output port="files" primary="false"/>
<p:output port="report" sequence="true" primary="false"/>
<p:output port="html"/>
<p:output port="baseuri" primary="false"/>
<p:output port="input-for-schematron" primary="false"/>
<p:option name="target" select="''"/>
<p:option name="terminate-on-error" select="'yes'"/>
<p:option name="clean-target-dir" select="'no'"/>
<p:option name="debug" select="'no'"/>
<p:option name="use-svg" required="false" select="''"/>
<p:option name="create-a11y-meta" required="false" select="'yes'"/>
<p:option name="debug-dir-uri" select="'debug'"/>
<p:option name="status-dir-uri" select="'status'"/>
<p:option name="id-in-report-heading" select="'false'"/>
<p:option name="create-font-subset" required="false" select="'true'"/>
<p:option name="create-svg-cover" required="false" select="'false'"/>
<p:option name="convert-svg-cover" required="false" select="'false'"/>
<p:option name="pull-up-epub-type-to-body" required="false" select="'false'"/>
</epub:convert></code></pre>
</div>
<div id="d42807e308" class="status">
<h2 class="header status"></h2>
<p class="last-updated">GitHub sync date: 2025-01-08+01:00</p>
</div>
</div>
<div class="col hide-on-small-only m3 l2">
<div class="toc-wrapper pin-top" style="top: 0px;">
<div style="height: 1px;">
<ul id="tr-toc" class="table-of-contents">
<li><a href="#epub-create-ocf" class="active">epub:create-ocf</a></li>
<li><a href="#epub-create-opf">epub:create-opf</a></li>
<li><a href="#epub-create-ops">epub:create-ops</a></li>
<li><a href="#tr-font-obfuscate">tr:font-obfuscate</a></li>
<li><a href="#tr-create-font-subset">tr:create-font-subset</a></li>
<li><a href="#epub-html-splitter">epub:html-splitter</a></li>
<li><a href="#epub-insert-amzn-region-magnification">epub:insert-amzn-region-magnification</a></li>
<li><a href="#epub-split-css">epub:split-css</a></li>
<li><a href="#tr-check-links">tr:check-links</a></li>
<li><a href="#epub-zip-package">epub:zip-package</a></li>
<li><a href="#epub-convert">epub:convert</a></li>
<li><a href="#d42807e308"></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="page-footer grey">
<div class="container">
<div class="row">
<div id="tr-footer-1" class="col s12 m6 l4">
<h5 class="white-text">GitHub</h5>
<p class="white-text">Checkout the transpect repositories on GitHub and use transpect in your project.
Give us feedback, create issues and make pull requests.</p>
<p><a target="_blank" href="https://github.com/transpect" class="btn red">GitHub</a></p>
</div>
<div id="tr-footer-2" class="col s12 m6 l4">
<h5 class="white-text">Twitter</h5>
<p class="white-text">News from le-tex’ XML machine room. Mostly related to
XSLT/XPath 2+, XProc, Relax NG, Schematron, and our
open-source framework transpect.
</p>
<p><a target="_blank" href="https://twitter.com/intent/user?screen_name=letexml" class="btn red">Follow @letexml</a></p>
</div>
<div id="tr-footer-3" class="col s12 m6 l4"><a target="_blank" href="http://www.le-tex.de"><object id="letex-logo" type="image/svg+xml" data="icons/logo-le-tex.svg">Your browser does not support SVG</object></a></div>
</div>
</div>
<div class="footer-copyright grey darken-1">
<div class="container">
<div class="row">
<div id="tr-footer-copyright-1" class="col s12 m6 l6">
<p class="white-text left">le-tex publishing services GmbH, <span class="current-year">2025</span></p>
</div>
<div id="tr-footer-copyright-2" class="col s12 m6 l6">
<p>
<a class="white-text right" href="http://www.le-tex.de">http://www.le-tex.de</a>
<a rel="me" href="https://fosstodon.org/@letexml" aria-label="Mastodon"></a>
</p>
</div>
</div>
</div>
</div>
</footer><script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script><script type="text/javascript" src="js/prism.js"></script><script type="text/javascript" src="js/materialize.min.js"></script><script src="js/init.js"></script></body>
</html>