Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 07-16-2009, 11:19 PM   #46
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by rogue_ronin View Post
rbmake also supports regex search/replace, built in. Just add a rule to your basic rbmake script (or a separate regex file using the s switch) or OPT file to replace <div style="page-break-after:always"/> with either <hr size=0> or <hr new-page>. Or whatever your preferred output is. (Maybe you want to keep the div, just replace the style?)

You could have quite a list of standard replacements to make your work easier. (You could share too! )

rbmake can be told to recognize <hr size=0> or to ignore it, using the z switch.

If you're going to update the program, I think you want the RBhtml libraries. I've emailed with Wayne Davison a few times, he's super-approachable. (I think he might hang out here, too -- don't know why I think that...)

m a r
Actually, what I'd really like to do is add support for OPF files. This would give me a chance to really learn the file format. But I don't know that I'll have the time.
Nate the great is offline   Reply With Quote
Old 07-17-2009, 12:16 AM   #47
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
Quote:
Originally Posted by Nate the great View Post
Actually, what I'd really like to do is add support for OPF files. This would give me a chance to really learn the file format. But I don't know that I'll have the time.
Do you mean make RB from OPF? Which format do you want to learn? I'd like to know more about OPF myself -- I think it's going to be a target for my xhtml macro library (along with RB, FB2, etc.) ePub itself eventually, but it kills my brain right now.

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
rogue_ronin is offline   Reply With Quote
Advert
Old 07-17-2009, 09:52 AM   #48
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
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.
Nate the great is offline   Reply With Quote
Old 07-17-2009, 10:24 AM   #49
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
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:
Originally Posted by Nate the great View Post
"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>
ilovejedd is offline   Reply With Quote
Old 07-17-2009, 10:33 AM   #50
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by ilovejedd View Post
You don't actually need a "spine file". You can include a very simple spine inside the OPF file, itself.
I meant that the OPF was a spine file (sort of).
Nate the great is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:35 AM.


MobileRead.com is a privately owned, operated and funded community.