return output_html, toc, chars
-def transform(wldoc, verbose=False,
- style=None, html_toc=False,
- sample=None, cover=None, flags=None, hyphenate=False):
+def transform(wldoc, verbose=False, style=None, html_toc=False,
+ sample=None, cover=None, flags=None, hyphenate=False, ilustr_path=''):
""" produces a EPUB file
sample=n: generate sample e-book (with at least n paragraphs)
functions.reg_mathml_epub(zip)
+ for filename in os.listdir(ilustr_path):
+ zip.write(os.path.join(ilustr_path, filename), os.path.join('OPS', filename))
+
# write static elements
mime = zipfile.ZipInfo()
mime.filename = 'mimetype'
</div>
</xsl:template>
+ <xsl:template match="ilustr" mode="inline">
+ <xsl:apply-templates select="." />
+ </xsl:template>
+
+ <xsl:template match="ilustr">
+ <img>
+ <xsl:attribute name="src">
+ <xsl:value-of select="@src" />
+ </xsl:attribute>
+ <xsl:attribute name="alt">
+ <xsl:value-of select="@alt" />
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="@alt" />
+ </xsl:attribute>
+ </img>
+ </xsl:template>
+
<!--===========================================================-->
<!-- Tagi PARAGRAFOWE -->
<!--===========================================================-->
def transform(wldoc, verbose=False, sample=None, cover=None,
- use_kindlegen=False, flags=None, hyphenate=True):
+ use_kindlegen=False, flags=None, hyphenate=True, ilustr_path=''):
""" produces a MOBI file
wldoc: a WLDocument
epub = document.as_epub(verbose=verbose, sample=sample,
html_toc=True, cover=cover or True, flags=flags,
- hyphenate=hyphenate)
+ hyphenate=hyphenate, ilustr_path=ilustr_path)
if verbose:
kwargs = {}
else: