Quote:
Originally Posted by Nate the great
"Spine file" is a good way to think of it. It's an XML file that contains all the metadata for the ebook as well as a manifest of of the component html file(s), optional cover image, etc.
My main ebook creation tool right now is MobiCreator. I like it for a bunch of reasons, one of which is that it makes an OPF file as an intermediate step. After making the Mobi ebook, I then use the OPF file with html2epub to make the epub version.
|
You don't actually need a "spine file". You can include a very simple spine inside the OPF file, itself.
Here's a crude OPF template I made for a pet project (
FLAG). I doubt the OPF would work all that well inside an epub but it's a fairly good source of metadata when using Calibre's command-line conversion utilities.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0"
unique-identifier="BookId">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>%%TITLE%%</dc:title>
<dc:creator opf:role="aut">%%AUTHOR%%</dc:creator>
<dc:language>en-US</dc:language>
<dc:publisher>%%PUBLISHER%%</dc:publisher>
<dc:identifier id="BookId">urn:uuid:%%IDENTIFIER%%</dc:identifier>
<dc:subject>%%SUBJECT%%</dc:subject>
<dc:date opf:event="publication">%%DATE_PUB%%</dc:date>
<dc:date opf:event="modification">%%DATE_MOD%%</dc:date>
<dc:description>%%SUMMARY%%</dc:description>
</metadata>
<manifest>
<item id="id1.1" href="chapter1.xhtml" media-type="application/xhtml+xml"/>
<item id="id1.2" href="chapter2.xhtml" media-type="application/xhtml+xml"/>
<item id="id1.3" href="chapter3.xhtml" media-type="application/xhtml+xml"/>
<item id="id1.4" href="chapter4.xhtml" media-type="application/xhtml+xml"/>
<item id="id1.5" href="chapter5.xhtml" media-type="application/xhtml+xml"/>
<item id="id2" href="style.css" media-type="text/css"/>
<item id="id3" href="cover.png" media-type="image/png"/>
</manifest>
<spine>
<itemref idref="id1.1"/>
<itemref idref="id1.2"/>
<itemref idref="id1.3"/>
<itemref idref="id1.4"/>
<itemref idref="id1.5"/>
</spine>
</package>