Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-30-2014, 05:59 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Removing Unused ID=" " 's?

Is there a clever RegEx way to remove any unused (aka 'orphaned') ID's?

Possibly [Check Book] could handle it with a warning that ID="filepos991221" is not used. Remove or Remove all unused ID's??"

Sometimes I want to cleanup an epub and it seems like almost every <div>, <a> and etc. has an ID on it

I know they probably don't hurt anything, but 1) I like to be tidy, and 2) they do make the file a little larger

Last edited by phossler; 07-30-2014 at 07:24 PM.
phossler is offline   Reply With Quote
Old 07-30-2014, 10: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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
ids are not just link targets, they can also be used by CSS. They are also often used by bookmarking/annotation tools to make bookmark locations more reliable. So generally speaking, you should not be removing them.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-30-2014, 10:16 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,398
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I remove unused IDs and I've never had a problem. But you do have to be careful and not remove any IDs you think are unused to find out there are links to some of those IDs.
JSWolf is offline   Reply With Quote
Old 07-30-2014, 11:07 PM   #4
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@kovid - I understand the risks, but I just got through cleaning an epub that was littered with ID's that seemed to be paper book page number markers

@JSWolf -- if I'm not sure, I Cut it and then run [Check Book]. If I'm wrong, I can Paste it back.

Still it's tedious, and the computer is SO much more accurate than I (hint, hint)
phossler is offline   Reply With Quote
Old 07-30-2014, 11:12 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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@phossler: It is for things like this that I made a plugin framework for the editor. There are many things that I dont think are important enough to spend time adding to the core.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-31-2014, 08:51 AM   #6
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Understand -- Not a problem

There is some posts I was reading about a Merge ePub PI being enhanced to include cleanup things like unneeded <span>....</span> pairs, etc.

Will your eventual S&R using functions (I believe that's what you called it) be able to find "ID=".*" and return the Count and if Count=1, replace it with 'Nothing' ?

Last edited by phossler; 07-31-2014 at 09:03 AM.
phossler is offline   Reply With Quote
Old 07-31-2014, 10:47 AM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by phossler View Post
@kovid - I understand the risks, but I just got through cleaning an epub that was littered with ID's that seemed to be paper book page number markers
Instead of removing the start of printed page ids, you could instead build a page-map.xml from them or use the in the ncx with pagelist tags and add back the original support for proper pages. This would be an easy editor plugin.

Alternatively before removing them, you should probably look for a pagemap.xml file and examine the ncx file to make sure they are not referenced there, otherwise you will break the page mapping feature.

KevinH
KevinH is offline   Reply With Quote
Old 07-31-2014, 10:31 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,398
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I don't find page mapping to be all that useful. ADE's page numbering works well enough to have an idea of where I am in the book, how large the book is, and how much more I have to go.
JSWolf is offline   Reply With Quote
Old 08-01-2014, 07:42 AM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
You have obviously never had to universally cite a reference to a particular passage in the book that people reading on other devices or in print can actually find.

This is common in academic settings and one of the reasons for supporting print page mapping in ebooks.

Quote:
Originally Posted by JSWolf View Post
I don't find page mapping to be all that useful. ADE's page numbering works well enough to have an idea of where I am in the book, how large the book is, and how much more I have to go.
KevinH is offline   Reply With Quote
Old 08-01-2014, 09:08 AM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,398
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by KevinH View Post
You have obviously never had to universally cite a reference to a particular passage in the book that people reading on other devices or in print can actually find.

This is common in academic settings and one of the reasons for supporting print page mapping in ebooks.
I don't read reference books on an eInk reader.
JSWolf is offline   Reply With Quote
Old 08-01-2014, 09:22 AM   #11
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,367
Karma: 78877538
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by JSWolf View Post
I don't read reference books on an eInk reader.
+1

In fact I would think that even if I *DID* I would still get a hard-copy edition and provide the citation using it's publisher data as opposed to that of the eBook edition.
PeterT is offline   Reply With Quote
Old 08-01-2014, 09:30 AM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by JSWolf View Post
I don't read reference books on an eInk reader.
Wow ... and that's relevant how?

FYI, citing passages by page and edition is not only for reference books.

Scholars often study the works and letters of famous authors in fiction and non-fiction from multiple time periods and need to cite passages.

And more generally, anyone simply may want to cite events or dialog from any book the are reading in parallel with friends many of them who read the print edition.
KevinH is offline   Reply With Quote
Old 08-01-2014, 09:49 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,398
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by KevinH View Post
Wow ... and that's relevant how?

FYI, citing passages by page and edition is not only for reference books.

Scholars often study the works and letters of famous authors in fiction and non-fiction from multiple time periods and need to cite passages.

And more generally, anyone simply may want to cite events or dialog from any book the are reading in parallel with friends many of them who read the print edition.
If there are multiple print editions with different age numbers, how will you know which print edition the page map uses? You don't as it doesn't say. Also, most eBook do not have a page map so for ePub, the only page numbering you have is that of ADE. So really, if you are going to be citing from multiple books and you feel you need to have a page number that aligns with some print edition, the forget eBooks.
JSWolf is offline   Reply With Quote
Old 08-01-2014, 10:06 AM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by JSWolf View Post
Also, most eBook do not have a page map so for ePub, the only page numbering you have is that of ADE. So really, if you are going to be citing from multiple books and you feel you need to have a page number that aligns with some print edition, the forget eBooks.
Wait... so you agree with him?
eschwartz is offline   Reply With Quote
Old 08-01-2014, 11:07 AM   #15
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
It's called metadata for a reason. Simply fill in dc:source with the isbn number of the specific print edition.

And, yes real commercial ebooks do this even for popular press fiction. for example most of the last 5 or so Jim Butcher ebooks do this quite nicely.



Quote:
Originally Posted by JSWolf View Post
If there are multiple print editions with different age numbers, how will you know which print edition the page map uses? You don't as it doesn't say. Also, most eBook do not have a page map so for ePub, the only page numbering you have is that of ADE. So really, if you are going to be citing from multiple books and you feel you need to have a page number that aligns with some print edition, the forget eBooks.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New "remove unused css" tool BobC Editor 4 01-25-2014 09:06 PM
Removing the "Welcome to Kobo" and "Kobo Read On" ePubs HarleyB Kobo Reader 12 08-31-2011 09:17 PM
Ended "Unused" BN Nook Color. Waba Flea Market 3 01-14-2011 10:21 AM


All times are GMT -4. The time now is 01:09 AM.


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