![]() |
#1 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
File Splitting-->Rename Files-->Link filenames broken
This might already be discussed somewhere, but I didn't find it.
My tale: I created my html text in Notepad++, one big file for the entire book, with Sigil chapter-break split markers included. All my footnote tags and ID's are included, and look like this. They all use ch01.xhtml as the filename, because the file has not been split yet. Code:
<a href="../Text/ch01.xhtml#fnt01" id="fnc01">[1] Load this into Sigil v 7.4 or 7.3 (or copy-paste). (I am using the portable version from PortableApps.com, in case this has any bearing on the subject.) Go to Edit->Split On Markers. Successfully split into 73 files. Sigil has set EVERY footnote link and back link to this: Code:
<a href="../Text/ch01_0069.xhtml#fnt01" id="fnc01">[1]
I must manually edit each one to match the correct chapter name/number. If I use bulk-rename to ch01; ch02, ch03, etc; it then sets the filenames in all the links to ch70. So of course, every footnote call goes to the footnotes in Chapter 69/70. Every backlink returns to the anchor ID in Chapter 69/70. (Excepting the ones in Chapter 69/70, which travel to and from Chapter 01.) The same thing happens if I edit the filenames in the links to the "future" filenames before I load the text into Sigil. Is this a normal outcome, or have I done something wrong? For future use, do I need to split the file up and set the links BEFORE I load into Sigil? EDITED TO ADD: I used to do this successfully in v 6.x. When creating the file in Notepad++, I would set the link filenames to the "future" filename, and Sigil would leave them alone. But now it is updating links when files are re-named, and something has gone wrong with my world... Last edited by GrannyGrump; 01-14-2014 at 04:17 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Since it is one big file, you can omit the filename from the links. That might do it after splitting.
|
![]() |
![]() |
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
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:
This (change) has to be a really odd side effect of the OP's work flow. (AFAIK this is the first report in 3 years) |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I can always manage to find ways to make Sigil trounce some links when doing a lot of splitting/merging/renaming. I've just never been able to come up with a step-by-step to reproduce it.
|
![]() |
![]() |
![]() |
#5 |
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)
|
Try seeing how calibre handles it in a conversion?
|
![]() |
![]() |
![]() |
#6 | ||
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Quote:
eschwartz said Quote:
EDITED TO ADD: Just on the off chance it might make a difference, I tried again with my *non-portable* version 7.2 installation. The same thing happened. I can't believe I'm the only victim! Has nobody had this happen with any of the 7.x versions? Last edited by GrannyGrump; 01-14-2014 at 10:26 PM. Reason: additional info |
||
![]() |
![]() |
![]() |
#7 |
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)
|
If you turn it into a one-file epub, then do an epub-to-epub conversion, calibre will split at the chapter breaks, as found by xpath, using the header tags.
|
![]() |
![]() |
![]() |
#8 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Ah, I see (understandable when I finally pay attention to what you say!)
Should I remove the Sigil split markers before I try the Calibre conversion? |
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Granny
All I do to programatically split a file is insert a Sigil Split Marker using REGEX To split before a <h3 tag (add more terms to the REGEX if H3 is used elsewhere) search : <h3 Replace: <hr class="sigil_split_marker" /> <h3 when complete (I do a save for good times), the press F6 to cause the split. I have never had a mangle like you show. (XP, W7, or Linux) |
![]() |
![]() |
![]() |
#10 | |
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)
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Sigil split markers are just a <hr /> with a unique class name that Sigil will see and split at (and remove)
|
![]() |
![]() |
![]() |
#12 | |
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)
|
Quote:
Well, then, definitely get rid of it. I think I agree with theducks that the best way to make those markers is with a regex, that way you don't create them until/unless it's necessary. |
|
![]() |
![]() |
![]() |
#13 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@theducks -- I have tried this on my home computer (Asus laptop running Win8 [ewww]) and on a borrowed Dell running Vista (double ewww). Identical results.
@eschwartz-- Thanks for that info. I will try the Calibre conversion this evening at home, and hopefully it works. If not, I will have to come up with a better work-flow. This occasion isn't too bad, because there are only about 45 links, so not too much to handle manually. But I need to find out why it happens, and stop it from happening with a book with lots more links. |
![]() |
![]() |
![]() |
#14 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Well, I tried a few rough tests converting epub --> epub with Calibre. First attempt was different, but just as mangled as the Sigil output. But now I see the problem.
In both Sigil and Calibre, I see that I cannot start renumbering footnotes with #01 on each chapter. I will have to start with 1 and number straight through to 45. Then, it keeps the anchors attached to the correct splits/chapters. I think I was expecting a miracle from the software. (hey, a person can dream, can't they?) Thanks to all for your help. eschwartz, your Calibre tip helped lift the curtain of confusion. |
![]() |
![]() |
![]() |
#15 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
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:
![]() id='42' error id='f42' good Some Crafty REGEX run on a per file from the Calibre editor can rename those 'duplicate' ids Find: \.html\#(\d+) <change the file type to match, both places Replace: .html:#a\1 <- Change to a unique letter(s) for each file processed REGEX can't to math, so you might come up with an ![]() ![]() |
|
![]() |
![]() |
![]() |
Tags |
link filenames broken, sigil file splitting |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
rename files | richreads | Sigil | 2 | 01-01-2013 04:53 PM |
How to mass rename ebook file | vivid80 | Calibre | 2 | 06-29-2012 07:22 PM |
rename file in calibre library | betavita | Library Management | 4 | 05-20-2012 05:09 AM |
rename files | kawayama | Sigil | 9 | 12-22-2011 12:30 AM |
filenames and file duplication | CheriePie | Calibre | 12 | 02-28-2009 12:35 PM |