Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 05-06-2016, 01:01 PM   #1
Doonge
Connoisseur
Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.
 
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.
Doonge is offline   Reply With Quote
Old 05-06-2016, 01:14 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the KoboUtilities and KoboTouchExtended plugins
kovidgoyal is offline   Reply With Quote
Old 05-06-2016, 01:40 PM   #3
Doonge
Connoisseur
Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.Doonge ought to be getting tired of karma fortunes by now.
 
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.
Doonge is offline   Reply With Quote
Old 05-06-2016, 02:37 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
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.
jackie_w is offline   Reply With Quote
Old 05-06-2016, 10:30 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Doonge View Post
What's in Kobo Utilities that I should pay attention to? I didn't find anything at first glance.
Dunno, I just mentioned it as being possibly relevant.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 04:56 PM.


MobileRead.com is a privately owned, operated and funded community.