![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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) |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#10 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,367
Karma: 78877538
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
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. |
![]() |
![]() |
![]() |
#13 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#14 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)
|
Wait... so you agree with him?
|
![]() |
![]() |
![]() |
#15 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |