![]() |
#1 |
Voracious reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
how to automatize routine modifications to epubs?
I'm always performing the same fixes to my epubs before reading them, and I was wondering if there's a way to automatize all the work (or at least part of it).
The operations I normally do manually within calibre's editor are: — "beautify" all the files (this is needed mainly for the searches&replaces to work properly) — fix the ellipsis in all text files — remove line-height and text-alignment: justify in all the css — set all non-zero values for text-indent to 1em — some other stuff very similar to the previous points I already have a bunch of saved searches, but given that all these operations don't require discretion, is there a plugin or a smarter way to manage all this? Thanks ![]() |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 631
Karma: 7544528
Join Date: Apr 2013
Location: Berlin
Device: PRS 350, Kobo Aura
|
I changed the modifyEpub plugin for similar things. If you know a little bit of python, this is quite easy.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Voracious reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Something you can do is to put all the searches a group and run the group. That still means you need to open the book in the editor, but it reduces the steps involved. A thought would be to find someone to write a plugin that can execute saved searches on a set of books without opening the books in the editor. I have no idea if there is support in the calibre framework to do this, so I don't know how possible it is. If you are lucky, just this suggestion will prompt someone to do it. I'm just hoping I can resist the urge. |
|
![]() |
![]() |
![]() |
#5 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,304
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can use the Look & Feel->Transform styles tool to accomplish the CSS changes automatically during a conversion. And the Search & Replace tool to do the ellipses also in the conversion dialog.
The transform Styles tool is also available in the editor. |
![]() |
![]() |
![]() |
#7 | |
Voracious reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Along similar lines, is it possible for a user to modify/replace the code that Calibre uses to generate the titlepage.xhtml file when converting a Kindle book to EPUB?
I'm currently handling this by storing my preferred code in a snippet so I can replace the stock XHTML with relative ease, but that still means opening every book in the editor, one by one by one. I'm looking for a way to automate the process. |
![]() |
![]() |
![]() |
#9 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,003
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
those take precedence |
|
![]() |
![]() |
![]() |
#10 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,003
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
BTW those (titlepage and jacket) will also be used when 'sending to device', so no pressing need to convert/edit
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
|
![]() |
![]() |
![]() |
#12 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,003
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
The Polish feature, by the look of it, has nothing to do with what I'm after. I don't know why this is such a hard concept to communicate.
I don't want to make a new cover image - based on metadata or anything else. I don't want to add a new HTML page or jacket to the book. I don't want to have to repeat some process for every book, one at a time, as a manual step. I simply want to replace the standard XHTML code that Calibre uses in the first place when it generates a cover page. I want to change that default page's formula so that whenever I convert a Kindle book to EPUB, Calibre will use my HTML instead of whatever it's using now. By definition, that page has to be stored somewhere in Calibre. I just want to know where. This shouldn't involve using a plugin - just learning the location of an existing file or script. Unless, that is, the XHTML in question is hardcoded into a combiled binary, such that changing it would require recompiling the software... which would be a weird choice. |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
|
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
I am unfortunately not running from source; depending on the machine, I'm running either a Portable build or the Win64 compile. Any idea what file that module ends up in?
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automatic routine when sending book to device (Kobo) | Doonge | Development | 4 | 11-14-2014 08:20 PM |
What’s your “image rehab” routine? | GrannyGrump | Workshop | 58 | 11-23-2013 03:01 AM |
help with some modifications | moller | Kindle Developer's Corner | 3 | 10-12-2012 02:31 PM |
Different Send to Device routine based on the library. | iatheia | Library Management | 10 | 01-24-2012 12:06 PM |
iLiad Registry modifications | Martijn | iRex Developer's Corner | 7 | 03-27-2008 05:37 PM |