Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-04-2016, 09:18 PM   #1036
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
The Toolbag PI treats those as Naked spans (ignores id= part)
Yes indeedy, I can do it there with Click image for larger version

Name:	Capture.JPG
Views:	306
Size:	29.9 KB
ID:	146875

I'd still like it in Modify because a) I could do it in bulk and b) I always run Modify over new epubs to remove the crud like covers and non cd metadata.

To use the Toolbag I have to fire up the editor, click a button and tell the toolbag what to do (every time - hint, hint DD).

But at least now when they do irritate me, which is in the editor, I can get rid of them toot sweet

Thanks for the tip.

BR
BetterRed is offline   Reply With Quote
Old 03-05-2016, 12:43 AM   #1037
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
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
Quote:
Originally Posted by BetterRed View Post
So my question is, can Modify be adjusted to remove these unreferenced spans.
The problem with that IDea* is that Modify doesn't build a table of IDs such that it can look and see which ones get referenced and which don't. It's an in-the-moment tool, not a holistic one, and this is one of the shortcomings of that approach. Since removing referenced spans would be A Very Bad Thing for navigation, the only remaining practical option Modify has is to assume that ID attributes are significant and must be preserved.

I run into a similar situation all the time with CSS classes. As a result, sometimes I end up running my "cleanup" script (applying Modify with a certain profile, including strip-spans) multiple times while processing a particularly obnoxious book. It's annoying, but there's really no help for it.

* Hee. Cheap puns are fun.
Rev. Bob is offline   Reply With Quote
Advert
Old 03-05-2016, 01:05 AM   #1038
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@Rev. Bob thanks for the feedback, I can get by with DD's tool.

BR
BetterRed is offline   Reply With Quote
Old 03-23-2016, 07:25 AM   #1039
chrisridd
Guru
chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.
 
chrisridd's Avatar
 
Posts: 928
Karma: 2146660
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
Something I often find myself doing with purchased epubs is "normalising" the font sizes. It would be nice if this could be automated.

What I mean by this is that all the font-size declarations in the CSS are altered (almost always increased, what is it with publishers and small fonts?) so that the body text is all CSS "medium". So I'd normally do something like this:

xx-small -> x-small
x-small -> small
small -> medium
medium -> large
large -> x-large
x-large -> xx-large
xx-large -> xx-large (not sure it matters)

Of course there are also relative font sizes specified in percentages, which would be a similar sort of problem.

Identifying "body text" is probably statistical - counting the declarations used by "most" divs and ps in the text will give a good idea. I just open a good-sized chapter in Sigil and look at the start of the source and have a stab :-)
chrisridd is online now   Reply With Quote
Old 03-23-2016, 10:40 AM   #1040
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by chrisridd View Post
Something I often find myself doing with purchased epubs is "normalising" the font sizes. It would be nice if this could be automated.

What I mean by this is that all the font-size declarations in the CSS are altered (almost always increased, what is it with publishers and small fonts?) so that the body text is all CSS "medium". So I'd normally do something like this:

xx-small -> x-small
x-small -> small
small -> medium
medium -> large
large -> x-large
x-large -> xx-large
xx-large -> xx-large (not sure it matters)

Of course there are also relative font sizes specified in percentages, which would be a similar sort of problem.

Identifying "body text" is probably statistical - counting the declarations used by "most" divs and ps in the text will give a good idea. I just open a good-sized chapter in Sigil and look at the start of the source and have a stab :-)
I convert named sizes to (my value) em
font-size: 'medium' just gets removed, since that is my Base font size the I set in <body>

BTW I run the 'chained' (Group) Saved Search feature in Sigil to do this

Last edited by theducks; 03-23-2016 at 10:42 AM. Reason: added comment
theducks is offline   Reply With Quote
Advert
Old 03-23-2016, 11:41 AM   #1041
chrisridd
Guru
chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.
 
chrisridd's Avatar
 
Posts: 928
Karma: 2146660
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, Marvin 3
Quote:
Originally Posted by theducks View Post
BTW I run the 'chained' (Group) Saved Search feature in Sigil to do this
Oh, I hadn't noticed this feature in Sigil before - thanks! That will make this a whole lot easier!!

chrisridd is online now   Reply With Quote
Old 03-25-2016, 10:10 AM   #1042
Francois_C
Zealot
Francois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipse
 
Francois_C's Avatar
 
Posts: 106
Karma: 8300
Join Date: Jul 2012
Location: France
Device: Kobo Aura H2O, Kobo Touch, Kobo Mini
Quote:
Originally Posted by chrisridd View Post
what is it with publishers and small fonts?
…and also larger right margins: they probably naively try to emulate paper books (with a larger right margin, all pages look like a right page, whilst they should only think of making the best use of the screen surface in order to make reading easier and faster. To my mind, ebooks and ereaders are often made by people who don't like reading.

I also would love such a function in Calibre.

To the moment, I do the same as theducks, but I did not know the 'chained' (Group) Saved Search feature in Sigil either. Thanks, theducks!
Francois_C is offline   Reply With Quote
Old 03-25-2016, 10:13 AM   #1043
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Francois_C View Post
To the moment, I do the same as theducks, but I did not know the 'chained' (Group) Saved Search feature in Sigil either. Thanks, theducks!
It took me quite awhile to understand Group search
The instructions were not wrong. I was not in Borg mode (a common problem. Failed to assimilate )
theducks is offline   Reply With Quote
Old 03-25-2016, 06:57 PM   #1044
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by chrisridd View Post
Something I often find myself doing with purchased epubs is "normalising" the font sizes. It would be nice if this could be automated.

What I mean by this is that all the font-size declarations in the CSS are altered (almost always increased, what is it with publishers and small fonts?) so that the body text is all CSS "medium". So I'd normally do something like this:

xx-small -> x-small
x-small -> small
small -> medium
medium -> large
large -> x-large
x-large -> xx-large
xx-large -> xx-large (not sure it matters)

Of course there are also relative font sizes specified in percentages, which would be a similar sort of problem.

Identifying "body text" is probably statistical - counting the declarations used by "most" divs and ps in the text will give a good idea. I just open a good-sized chapter in Sigil and look at the start of the source and have a stab :-)
I do this using font size rescaling when converting books.
DoctorOhh is offline   Reply With Quote
Old 03-25-2016, 08:01 PM   #1045
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by chrisridd View Post
Something I often find myself doing with purchased epubs is "normalising" the font sizes. It would be nice if this could be automated.

What I mean by this is that all the font-size declarations in the CSS are altered (almost always increased, what is it with publishers and small fonts?) so that the body text is all CSS "medium". So I'd normally do something like this:

xx-small -> x-small
x-small -> small
small -> medium
medium -> large
large -> x-large
x-large -> xx-large
xx-large -> xx-large (not sure it matters)

Of course there are also relative font sizes specified in percentages, which would be a similar sort of problem.

Identifying "body text" is probably statistical - counting the declarations used by "most" divs and ps in the text will give a good idea. I just open a good-sized chapter in Sigil and look at the start of the source and have a stab :-)
you could simply bump the base font size in the CSS for
Code:
Body { font-size: 1.2em; }
Assumes 1em was default

no need to touch the other places
theducks is offline   Reply With Quote
Old 04-01-2016, 04:40 AM   #1046
Francois_C
Zealot
Francois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipseFrancois_C can illuminate an eclipse
 
Francois_C's Avatar
 
Posts: 106
Karma: 8300
Join Date: Jul 2012
Location: France
Device: Kobo Aura H2O, Kobo Touch, Kobo Mini
Quote:
Originally Posted by theducks View Post
you could simply bump the base font size in the CSS for
Code:
Body { font-size: 1.2em; }
Assumes 1em was default

no need to touch the other places
Of course: This is the first thing I try. But sometimes it does not work. Maybe my knowledge of HTML and CSS is not sufficient.
Francois_C is offline   Reply With Quote
Old 04-01-2016, 10:14 AM   #1047
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Francois_C View Post
Of course: This is the first thing I try. But sometimes it does not work. Maybe my knowledge of HTML and CSS is not sufficient.
Nah!

There is some really unnecessary coding that publishers include because THEY don't understand (care) inheritance or native defaults.


If you specify a font-size, it is an OVERRIDE of the previous-inherited size (no font-size: 1em; in a class, that cancels the <body> setting)

In most cases, I only specify what I want to CHANGE.
If I want a smaller font, I use a percentage (scales the body size)

I also use a unique, class for clarity when it encompasses the whole paragraph,
Code:
<p class="foo">Stuff</p>
instead of
Code:
<p class="foo"><span class="bold"><span class=:big">Stuff</span></span></p>
Bigger CSS, but smaller TEXT section files
theducks is offline   Reply With Quote
Old 04-02-2016, 06:21 AM   #1048
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Quote:
Originally Posted by theducks View Post
It took me quite awhile to understand Group search
The instructions were not wrong. I was not in Borg mode (a common problem. Failed to assimilate )
BTW, you can do it with the calibre editor too.
You only need to select more than one saved searches
Divingduck is offline   Reply With Quote
Old 04-04-2016, 07:37 AM   #1049
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
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
Quote:
Originally Posted by Divingduck View Post
BTW, you can do it with the calibre editor too.
You only need to select more than one saved searches
Could you expand on that a bit?
Rev. Bob is offline   Reply With Quote
Old 04-04-2016, 08:00 AM   #1050
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Rev. Bob View Post
Could you expand on that a bit?
You can select an arbitrary number of saved searches in the 'usual' way (ctrl+left mouse button click) and execute them - Find/Replace/Replace All.

I don't think there's a way to save the multi item selection so you can reuse.

BR
BetterRed is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Manage Series kiwidude Plugins 166 02-13-2024 11:31 AM
Modify ePub plugin dev thread kiwidude Development 346 09-02-2013 05:14 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 11:03 AM.


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