Changes

Jump to navigation Jump to search
1,127 bytes added ,  16:22, 31 August 2014
list also images in opf
== Create OPF ==
This The [http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm OPF file ] keeps the others together, it lists all resources of the ebook. You will have to adapt the listing of images (since I use only PDFs converted to PNG) and add fonts manually, if you ship any.
=== {{code|export2opf.xsl}} ===
<dc:title><xsl:value-of select='//metavariable[@name="title"]'/></dc:title>
<dc:language><xsl:value-of select='//document/@language'/></dc:language>
<dc:identifier id="BookId" opf:scheme="UUID">urn:uuid:xxxx3bbe3f04-4275-841f-44d7-7d3a4e0794a5</dc:identifier>
<dc:creator><xsl:value-of select='//metavariable[@name="author"]'/></dc:creator>
<dc:date><xsl:value-of select='//document/@date'/></dc:date>
<manifest>
<item id="cover-xhtmlhtml" href="cover.xhtmlhtml" media-type="application/xhtml+xml"/>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<item id="contentstyle" href="Styles/style.css" media-type="text/css"/> <item id="intro-xhtmlhtml" href="contentText/_intro.html" media-type="application/xhtml+xml" /> <xsl:for-each select='//section'> <item media-type="application/xhtml+xml"> <xsl:attribute name="id"><xsl:value-of select="translate(@location,':','_')"/>-html</xsl:attribute> <xsl:attribute name="href">Text/<xsl:value-of select="translate(@location,':','_')"/>.html</xsl:attribute> </item> </xsl:for-each> <xsl:for-each select='//image'> <item media-type="image/png" id="{@id}"> <xsl:attribute name="href">Images/<xsl:value-of select="substring-after(@name,'prd_hraban-temp-lilypond-')"/>.png</xsl:attribute> </item> </xsl:for-each> <!-- add fonts manually? -->
</manifest>
<spine toc="ncx">
<itemref idref="cover-xhtmlhtml" /> <itemref idref="contentintro-xhtmlhtml" /> <xsl:for-each select='//section'> <itemref> <xsl:attribute name="idref"><xsl:value-of select="translate(@location,':','_')"/>-html</xsl:attribute> </itemref> </xsl:for-each>
</spine>

Navigation menu