← Back to team overview

calibre-devs team mailing list archive

Fully modular LIT->MOBI; plus: documentation!

 

Kovid etc,

I've pushed some new revisions up to lp:~llasram/calibre/pluginize.
I've implemented a cheesy version of the needed `ebook-convert` glue
code in calibre.ebooks.oeb.factory.main(), updated the OEBReader and
LitReader to Reader interface we last discussed, and converted
MobiWriter to the discussed Writer interface.  And it all works! -- it
can convert a LIT book to a Mobipocket book with no intermediate output
or Mobi-output-specific logic.

The only change from what we've discussed is that I'm not sure there's
actually any room for a set of "standard transforms" applied to all
conversions.  I think the combination of input and output format (or
just output format...) are going to need to cover everything.  Example
-- how the MobiWriter needs to normalize fonts with its own options.  If
that would be part of the "standard transforms" then we need some way of
allowing writers to cancel out or skip specific ones.

This raises the issue of transforms in user-provided plugins and how
they get into the conversion process.  I think the easiest thing to do
would be to have a Transform in the Writer TRANSFORMS list which just
proxies out to the set of user-provided transforms.  It can even occur
multiple times in the TRANSFORMS lists for plugins which should apply at
specific points in the pipeline (e.g., pre- or post-CSS-normalization).

And also among the revisions pushed is one which adds documentation to
almost all of the "public" interface aspects of OEBBook.  Hopefully it
will be helpful if anyone else wants to write conversion pipeline
plugins :-).

Anyway, please take a look at the code and me know if it looks like what
you've had in mind.

-Marshall



Follow ups