View Single Post
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