07-16-2009, 11:19 PM | #46 | |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
|
|
07-17-2009, 12:16 AM | #47 | |
Banned
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
Quote:
rbmake is really, really flexible. I wouldn't be surprised if a combination of scripting, switches and smart sourcing couldn't be done, as the utility is (unmodified), to produce what you want. Are you a Linux guy, or Windows? In Linux, this would be very doable. In Windows, you have a more limited command-line. What is the basic structure of an OPF? It's the "index" file of the ebook, right? If it is, all you'd have to do is: a) unzip the source files b) parse the OPF for contents and metadata c) call rbmake with the list of pieces of the book, meta and with appropriate switches Okay, step b is a bit Underpants-Gnomish, but not impossible at all. Step b would be pretty easy in my text-editor. (Actually, it can do all three steps.) Step c might not even need much (or any) done in step b to be effective with rbmake : you can tell it where to begin in an URL tree and what to include using wildcards. It does all the searching and concatenation for you. Play with it, you'll be surprised. m a r |
|
Advert | |
|
07-17-2009, 09:52 AM | #48 |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
"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. |
07-17-2009, 10:24 AM | #49 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
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>
|
|
07-17-2009, 10:33 AM | #50 |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Best example of HTML formatting for Kindle??? | delphidb96 | Amazon Kindle | 13 | 02-15-2011 06:22 AM |
HTML formatting | MarcusStringer | ePub | 17 | 04-06-2010 11:23 AM |
html2mobi - html formatting | brunovg | Kindle Formats | 2 | 12-13-2009 05:56 AM |
HTML formatting | john folkard | Calibre | 1 | 08-18-2009 10:15 AM |
line formatting formatting question | daesdaemar | Workshop | 9 | 02-06-2009 11:47 AM |