05-06-2016, 01:01 PM | #1 |
Connoisseur
Posts: 80
Karma: 1184732
Join Date: Nov 2013
Device: Kobo Glo
|
CSS shiv on sending to device
I've read the post it and I'm ready to develop this functionality (which mean I'll have to learn a bit of python I guess, but it's fine).
One common problem I see for people who edit ebooks is how they deal with the lack of some specific css properties, and how they twist the HTML code to accomodate. Such examples are :before, :after, :first-letter and :first-of-type pseudo elements; but also font-variant: small-caps (tricky) and text-transform: uppercase. I read on two devices: my Kobo e-reader and my computer (I use a browser plugin, which is very css friendly). I don't need trickery on the browser plugin, but I need it on the Kobo. Hence I was thinking that it would be nice if I could add a routine when I send books to my Kobo (I use Calibre to manage them) which automatically edit the ebooks to fit with the device deficiencies. I have no idea if such thing would be categorized as plugin or recipe or editor or conversion (I'm a little bit confused by the categories here). I'm writing to see if someone more experienced already know if it's not feasible, or some quick tips about what I would need to import from Calibre library (I'd need to be able to know how to insert my code in the "send book to device" routine, how to get the device type, and if there's a javascript-like DOM parser). Pure regex solution is a no go (I know regex), I need DOM. Best regards. |
05-06-2016, 01:14 PM | #2 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look at the KoboUtilities and KoboTouchExtended plugins
|
05-06-2016, 01:40 PM | #3 |
Connoisseur
Posts: 80
Karma: 1184732
Join Date: Nov 2013
Device: Kobo Glo
|
Thanks the KoboTouchExtended seems to be a good starting point.
What's in Kobo Utilities that I should pay attention to? I didn't find anything at first glance. |
05-06-2016, 02:37 PM | #4 |
Grand Sorcerer
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@Doonge,
I use this 'Modify CSS' option from the KoboTouch driver. I mainly send standard epubs rather than kepubs. I think it's also available in the KoboTouchExtended driver. There are also some css-related patches available in the Kobo Patcher (some for epubs, some for kepubs) which may be of interest to you. I don't think any of the above is going to be much use for those css pseudo items though. You might have better luck with SmallCaps. With some manual effort (per book) it is possible to get the Kobo to display a proper SmallCaps font (which you'd need to sideload first) without resorting to embedding fonts in every book. |
05-06-2016, 10:30 PM | #5 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Template for sending to device | Thomas_AR | Library Management | 61 | 06-24-2015 11:06 PM |
Generic "Sending to Device" template not kicking in on Folder Device | At_Libitum | Library Management | 2 | 11-01-2013 07:12 AM |
Conversion Upon Sending to Device | ohemeffgee | Conversion | 2 | 11-12-2012 06:10 PM |
Sending Ebooks to Device. | ErikaGC | Devices | 1 | 08-11-2011 04:40 PM |
Sending magazines to Device | mitch13 | Library Management | 1 | 04-04-2011 10:17 AM |