← Back to team overview

calibre-devs team mailing list archive

Re: Unified conversion tool

 

Hi Marshall,

On Tuesday 23 December 2008 06:08:07 Marshall T. Vandegrift wrote:
> Hi Kovid, etc:
>
> I've been playing around with some ideas for creating a fully unified
> conversion/generation tool -- something that's flexible enough to do
> everything the current suite does, but using a modular infrastructure
> allowing re-use (and re-arrangement) of parts in different conversion
> pipelines.
>

Let me stop you right there and ask, why? The way I envison all future 
converters working is:

They call any2epub, and then convert the resulting EPUB to whatever format. 
That means all content manipulation modules are automatically reused (as part 
of any2epub), and can be controlled by any2epub's options (which all of them 
will share). I'd really rather not end up with a completely unusable mess like 
the CLI to the various video encoders. 

This architecture also leverages the fact that all transformations use HTML as 
a middle stage. EPUB in calibre is just HTML+metadata, so it is the ideal 
middleman. 


> For experimenting with CSS flattening, I've already extended my OEBBook
> and backing "container" classes to further simplify content
> manipulation.  Any content transform reduces then to a callable which
> accepts an OEBBook object and transforms it in-place.  The remaining
> bits to sort out are the command-line and Python programmatic
> interfaces.  Well, and the suite of transforms :-).  But some more solid
> ideas for the former gelled in my mind while sleeping.
>

We can certainly make the transformation modules output format independent, 
but I don't think we need a CLI for them, since presumably each output format 
converter knows what transformations it needs.

Kovid.
-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________




References