Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-14-2014, 05:07 AM   #1
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
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]
The last footnotes occur in what will be Chapter 70.


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]
, with the exception of the links in ch01_0069.xhtml, which it (incorrectly) left set at ch01.xhtml.

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 05:17 AM.
GrannyGrump is offline   Reply With Quote
Old 01-14-2014, 07:11 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,183
Karma: 7180223
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Since it is one big file, you can omit the filename from the links. That might do it after splitting.
Toxaris is offline   Reply With Quote
 
Advertisement
Old 01-14-2014, 01:28 PM   #3
theducks
Grand Sorcerer
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: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Toxaris View Post
Since it is one big file, you can omit the filename from the links. That might do it after splitting.
My experience is splitting a Relative link, always breaks things. Orphans: ..\Text\#foo

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)
theducks is offline   Reply With Quote
Old 01-14-2014, 01:47 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,539
Karma: 44002482
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.
DiapDealer is offline   Reply With Quote
Old 01-14-2014, 04:29 PM   #5
eschwartz
Irrational Optimist
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: 8,353
Karma: 14774587
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?
eschwartz is offline   Reply With Quote
Old 01-14-2014, 11:16 PM   #6
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Quote:
Originally Posted by Toxaris View Post
Since it is one big file, you can omit the filename from the links. That might do it after splitting.
Well, that suggestion got my hopes up, but it didn't work. All the tags got assigned to ch70 again.

eschwartz said
Quote:
Try seeing how calibre handles it in a conversion?
I'm not sure what you mean. Could you give a brief explanation?

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 11:26 PM. Reason: additional info
GrannyGrump is offline   Reply With Quote
Old 01-14-2014, 11:55 PM   #7
eschwartz
Irrational Optimist
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: 8,353
Karma: 14774587
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.
eschwartz is offline   Reply With Quote
Old 01-15-2014, 01:20 AM   #8
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
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?
GrannyGrump is offline   Reply With Quote
Old 01-15-2014, 01:23 AM   #9
theducks
Grand Sorcerer
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: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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)
theducks is offline   Reply With Quote
Old 01-15-2014, 01:25 AM   #10
eschwartz
Irrational Optimist
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: 8,353
Karma: 14774587
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 GrannyGrump View Post
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?
I don't believe calibre knows/cares what to do with them. They won't damage anything, but you might want to get rid of them simply because they are extra. (Sigil would get rid of them by turning them into file splits, but I think calibre would simply ignore them.)
eschwartz is offline   Reply With Quote
Old 01-15-2014, 01:43 AM   #11
theducks
Grand Sorcerer
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: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Sigil split markers are just a <hr /> with a unique class name that Sigil will see and split at (and remove)
theducks is offline   Reply With Quote
Old 01-15-2014, 01:47 AM   #12
eschwartz
Irrational Optimist
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: 8,353
Karma: 14774587
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 theducks View Post
Sigil split markers are just a <hr /> with a unique class name that Sigil will see and split at (and remove)
So it would show up as a big line at the end of every page?

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.
eschwartz is offline   Reply With Quote
Old 01-15-2014, 01:50 AM   #13
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
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.
GrannyGrump is offline   Reply With Quote
Old 01-17-2014, 05:13 AM   #14
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 570
Karma: 2673214
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.
GrannyGrump is offline   Reply With Quote
Old 01-17-2014, 02:06 PM   #15
theducks
Grand Sorcerer
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: 15,268
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by GrannyGrump View Post
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.
The link id needs to start with a letter or FC flags errors
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 Idea to use in the actual FN label [C2-1) (chapter2: note 1)
theducks is offline   Reply With Quote
Reply

Tags
link filenames broken, sigil file splitting

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rename files richreads Sigil 2 01-01-2013 05:53 PM
How to mass rename ebook file vivid80 Calibre 2 06-29-2012 08:22 PM
rename file in calibre library betavita Library Management 4 05-20-2012 06:09 AM
rename files kawayama Sigil 9 12-22-2011 01:30 AM
filenames and file duplication CheriePie Calibre 12 02-28-2009 01:35 PM


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


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