epub2epub

XProc library for migrating mostly older EPUBs to newer EPUB standards

Repository
Git URL https://github.com/transpect/epub2epub.git
SVN URL https://github.com/transpect/epub2epub
Base URI http://transpect.io/epub2epub/

Source ⬇

e2e:apply-custom-xslt

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/apply-custom-xslt.xpl"/>

Dependencies

Synopsis

<e2e:apply-custom-xslt xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source" primary="true"/>
  <p:input port="stylesheet" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:apply-custom-xslt>

e2e:copy-resources

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/copy-resources.xpl"/>

Dependencies

Synopsis

<e2e:copy-resources xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="outdir"/>
  <p:option name="remove-chars-regex" select="'\s'"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:copy-resources>

e2e:create-config

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/create-config.xpl"/>

Dependencies

Synopsis

<e2e:create-config xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result"/>
  <p:option name="outdir"/>
  <p:option name="epub-version" select="'3.0'"/>
  <p:option name="html-subdir-name" select="'content'"/>
  <p:option name="remove-chars-regex" select="'\s'"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
</e2e:create-config>

e2e:epub2epub

Pipeline to migrate an EPUB2. Consumes an EPUB file and converts output suitable for processing with the epubtools module to generate a new EPUB.

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/epub2epub.xpl"/>

Dependencies

Synopsis

<e2e:epub2epub xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="stylesheet" primary="false"/>
  <p:input port="css" sequence="true" primary="false"/>
  <p:input port="alt-xml" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="html" primary="false"/>
  <p:output port="opf" primary="false"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:output port="input-for-schematron" sequence="true" primary="false"/>
  <p:option name="href"/>
  <p:option name="outdir" select="'out'"/>
  <p:option name="create-epub" select="'yes'"/>
  <p:option name="epub-version" select="'EPUB3'"/>
  <p:option name="html-subdir-name" select="'content'"/>
  <p:option name="toc-page" select="4"/>
  <p:option name="hide-toc" select="'yes'"/>
  <p:option name="repair-heading-order" select="'yes'"/>
  <p:option name="remove-cover" select="'no'"/>
  <p:option name="remove-files-list" select="''"/>
  <p:option name="remove-chars-regex" select="'([\p{Zs}]|%20)'"/>
  <p:option name="html-lang" select="'en'"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:epub2epub>

e2e:error-handler

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/error-handler.xpl"/>

Dependencies

Synopsis

<e2e:error-handler xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="pipeline-step"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:error-handler>

e2e:include-alt-xml

This pipeline patches alt texts into a HTML document.

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/include-alt-xml.xpl"/>

Dependencies

Synopsis

<e2e:include-alt-xml xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source" primary="true"/>
  <p:input port="alt-xml" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:include-alt-xml>

e2e:load-html

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/load-html.xpl"/>

Dependencies

Synopsis

<e2e:load-html xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source" primary="true"/>
  <p:output port="result" primary="true"/>
  <p:output port="html" primary="false"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="href"/>
  <p:option name="remove-cover" select="'no'"/>
  <p:option name="wrap-cover" select="'yes'"/>
  <p:option name="remove-chars-regex" select="'\s'"/>
  <p:option name="repair-heading-order" select="'yes'"/>
  <p:option name="html-lang" select="'en'"/>
  <p:option name="toc-page" select="4"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:load-html>

e2e:load-rootfile

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/load-rootfile.xpl"/>

Dependencies

Synopsis

<e2e:load-rootfile xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="remove-cover" select="'no'"/>
  <p:option name="remove-files-list" select="''"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:load-rootfile>

e2e:ncx-to-nav

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/ncx-to-nav.xpl"/>

Dependencies

Synopsis

<e2e:ncx-to-nav xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result"/>
  <p:option name="toc-page" select="4"/>
  <p:option name="hide-toc" select="'no'"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
</e2e:ncx-to-nav>

e2e:patch-css

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/patch-css.xpl"/>

Dependencies

Synopsis

<e2e:patch-css xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source" primary="true"/>
  <p:input port="css" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:option name="href"/>
  <p:option name="hide-toc" select="'no'"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:patch-css>

e2e:repair-heading-order

This step fixes the heading hierarchy. For example, having an h1 followed directly by an h3 is not ideal for accessibility. This step repairs the hierarchy at once.

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/repair-heading-order.xpl"/>

Dependencies

Synopsis

<e2e:repair-heading-order xmlns:e2e="http://transpect.io/epub2epub">
  <p:input port="source"/>
  <p:output port="result"/>
</e2e:repair-heading-order>

e2e:unzip

Import

<p:import href="https://raw.githubusercontent.com/transpect/epub2epub/main/xpl/unzip.xpl"/>

Dependencies

Synopsis

<e2e:unzip xmlns:e2e="http://transpect.io/epub2epub">
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="href" required="true"/>
  <p:option name="outdir" required="true"/>
  <p:option name="remove-files-list" select="''"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="terminate-on-error" select="'no'"/>
</e2e:unzip>

GitHub sync date: 2026-10-19+02:00