I don't use kepubs all the time. And at the moment, I have a library I want to read as epubs and another as kepubs. Don't ask, it's just me. That means I change between the KoboTouch driver and the KoboTouchExtended driver depending on the library. And of course, I forget sometimes. So, I decided I wanted another way to do this.
The obvious way is to have something about the book to decide if to do the kepub transformation or not. The attached add the ability to use a template to do this. If the template is set, and it returns a non-empty value, then the book will be sent as a kepub. If the template returns an empty value the books will be sent as an epub. This is optional. There is an option to turn this on and off.
The template I am using is simple:
Code:
program:
current_library_name()=='Incoming'
But, it could be something else. For example, I don't find kepubs to have any real advantage for short stories. So, I could use:
Code:
program:
$$#words > 5000
And that would mean books with more than 5000 words would be sent to as kepubs.
While doing this, I had to make changes to the drivers configuration. I've always disliked it (sorry Joel) and broke down and reorganised it. The tab for the Extended driver is now organised into three sections:
- Send book as kepubs - This has a checkbox to enable or disable.
- Other Options - things that will happen whether the kepub transformation is done or not.
- Hyphenation - All the options related to hyphenation.
I think I have the arrangement correct. It should also be more obvious with some options as they will be enabled or disabled based on others. For example, only one of the two options for hyphenation can be enabled at one time. And if the hyphenation is selected, the hyphenation values will be enabled, but, not at other times. There is probably some combination of options that will get the wrong fields enabled.
I have been using this for a couple of weeks with no issues. I am happy the kepub template option works. I don't use the hyphenation or other options, so they have had only basic testing. If anyone finds the changes useful, please tell me. And if you find problems, or have suggestions, please tell me as well.