Quote:
Originally Posted by kovidgoyal
I think I good solution is to add the infrastructure to allow users to add their own custom OPF -> output format tool via an option to "Add external tool"
Once the infrastructure is in place it will be easy to add profiles for imp and mobi based on impmake and mobigen.
Unfortunately, all my current calibre hacking time is allocated to other things, so the only way this will get done is if someone contributes a patch.
the way I envison it working is via "recipes" for tools. A recipe should define the command line options the tool accepts (at the very least a way to define the output file). Calibre can have a nice GUI to aid in the creation of recipes. Once a recipe is created, calibre will create a generic config dialog (like the LRF config dialog) based on the defined options and a user specified path to the actual binary and then it will be able to run the tool to convert any of the supported iinput formats into the desired output format (calibre already has code to generate an OPF file given an HTML file + metadata). calibre can ship with built-inrecipes for a couple of well known tools like mobigen and impmake.
|
I think that's a very good approach. That allows us to reuse all the smart XXX -> OPF/EPUB tools already in calibre, and then use something else externally for the rest. Also, now that calibre will be storing the ebooks in a directory structure it will be easier to serve books via impserve.
What I'd like to propose is this:
- add support for creating tool recipes (via plugins??) and specify which formats they are able to create [with a given OPF as input].
- add support for the configuration for the above [if they need any], otherwise initially we can just require the creation of a new recipe.
- add a new type of tool recipe (which should be selectable from the menu) which can be autostarted [obviously this should be configurable] when calibre starts (e.g. for impserve which will serve the ebooks from the ebooks directory, eb1150 for handling the usb proxy). This can be a seperate process or a new thread in calibre itself (I'd prefer the latter approach).
- add support for the 1100 similiar to the prs500 as it is a "push" USB protocol, unlike the 1150/1200 which requires a proxy (impserve) to get it working.
If that is acceptable to Kovid, then that would mean first-class support for the 1100/1150/1200 [including content creation + serving] which I had hoped to do around a year ago but never got around to do

I'd appreciate some pointers on which parts of the code would need to be customized (or maybe we could just mail/chat here or on IRC) to take up the discussion.