![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Bulk Change CSS in mutiple ePubs
I realize this is a long shot, but thought I'd ask anyway: the Quality Check plugin has identified ~500 epubs in my library where the CSS contains "line-height: 1;" or "line-height: 1em;". I'd like to change all of these to "line-height: 0;" but the thought of editing 500+ files one at a time is daunting. I've searched for a Windows utility that will do a batch search and replace but after downloading and trying six of them without finding one that will do the job, I'm about to give up. Does anyone know of a Windows utility (preferably free) that will search and replace the text inside epub files? I've tried grepWin, FAR, FNR, TextCrawler, and others without luck. Of course, I'd love it if the Quality Check plugin would allow a simple search and replace (since it already does the search part so quickly and reliably), but I also realize that's not likely to happen. So...can't hurt to ask, right? Thanks.
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use
calibre-debug --expode-book file.epub which will unpack file.epub into a temp dir and then wait for you to type y after making your changes and then recreate the epub from the temp dir. You can automate it by using something like expect to pass in the y automatically after running the replace tool. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And this change https://github.com/kovidgoyal/calibr...b4ef814c4ad0ea
should make it much simpler to automate. |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 839
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
This commit is great gift for me!
--explode-book and --implode-book with specified folders – that's what I was looking for! Now I will be able to unpack the ebook, pass it through my edits/changes and pack it back. Thank you! |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You're welcome
![]() |
![]() |
![]() |
![]() |
#9 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,206
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I've attached two screen shots, one from ADE 4.5 on my PC and the other from my KA1. Just a titch unreadable, IMNSHO. Last edited by DNSB; 07-30-2017 at 06:26 PM. |
|
![]() |
![]() |
![]() |
#10 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Moderator Notice
Far as I can tell these posts have nothing to do with the Quality Check plugin, so I moved them into a new thread. BR |
![]() |
![]() |
![]() |
#11 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
I always remove any line-height properties except for initial capitals and superscripts/subscripts, which I had been setting to 1. I've found that 0 works better for those. If I remove line-height from paragraph styles, I don't run into the problem you show in your images at all. So the only line-height properties remaining in my epubs are for <span> or <sup>/<sub> and 0 works great for those.
|
![]() |
![]() |
![]() |
#12 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
IMHO line-height: 1 is non-standard and not friendly to older eyes (even those that can read at normal font size). 1.2 is standard
I also set the line height in <body> and then only for Exceptions like icallaci has outlined ![]() ![]() Code:
<h3 class="chapno">1 <br /> A Chapter w/Title</h3> |
![]() |
![]() |
![]() |
#13 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Given that icallaci reads with a Kobo, you don't want line-height in <body>. In fact, you want line-height removed where possible because Kobo has a line-height slider in the Aa settings.
|
![]() |
![]() |
![]() |
#14 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,206
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Code:
sub { font-size: 0.675em; vertical-align: sub; vertical-align: -20%; } sup { font-size: 0.675em; vertical-align: super; vertical-align: 35%; } |
|
![]() |
![]() |
![]() |
#15 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Even when I read on Android, removing the line-height seems to default to whatever leading or line-height is built into the font itself, so I've never run into a problem with this. But, yes, I mostly read with a Kobo, which allows me to set the line-height for a font if I don't like the default spacing between lines. Works for me, and Kovid's super-duper --explode-book/--implode-book duo is fantastic!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bulk MDE - Change Cover | BetterRed | Calibre | 2 | 01-20-2017 01:22 AM |
Bulk delete custom metadata inside epubs | senhal | Library Management | 8 | 02-17-2016 12:01 PM |
App, tool or way to Bulk extract export all videos, images & content from Epubs? | crashnburn | ePub | 5 | 01-11-2016 03:20 PM |
Color HTML/CSS in Nook Color ePubs | taneal1 | Nook Developer's Corner | 0 | 12-06-2015 03:56 AM |
bulk change file extension, but not name | Fedwin | Sigil | 33 | 03-14-2015 05:51 AM |