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 11-18-2012, 07:21 PM   #1
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
0.6 best way to insert hyperlinks??

Still experimenting with 0.6.

Have a question about the best method / technique to insert and maintain hyperlinks

Not the mechanics, that's very easy and strieght-forward thanks to the developers, but keeping the links right esp during chapter splits


If I split a a chapter the href's sometimes will point to the wrong file:
Example of what originally was Section0001 but now is Section0003

Code:
<!-- 'Original One' used to be in this file hence no file prefix

but after some Chapter Splitting, this file is now ../Text/Section0003.htm
instead of Section0001

Relinking them manually works but is tedious -->

 <div>
    <a href="#1">Original One</a><br />
  </div>

  <div>
    <a href="../Text/Section0001.html#1">Revised One</a><br />
  </div>
So, what is the best / easiest way to handle inserting and maintaining links?

Looking for ideas, suggestions, best practices, etc.

Thanks

Paul
phossler is offline   Reply With Quote
Old 11-18-2012, 10:51 PM   #2
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 2,384
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
Honestly what I do is just ignore links until everything else is done, all page and chapter splits, merges, etc. Only then do I go back and clean up the links as the final step.
Ripplinger is online now   Reply With Quote
 
Advertisement
Old 11-19-2012, 12:55 AM   #3
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
yes, I was thinking about that way also.

Insert the anchors as I go, and then the links at the end.

I guess I'd have to insert a "plain text" placeholder / reminder where the link will eventually go and then later actually insert the real links at the end when I'm done

Your thoughts?
phossler is offline   Reply With Quote
Old 11-19-2012, 01:16 AM   #4
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 2,384
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
If it's more than just chapter titles, you could insert any text as your placeholder, even just type <LINK> there, so you can easily search and find those locations later. If it's just for Chapter titles, I wouldn't bother with placeholders, but then I like to make a new page for each new chapter, so I wouldn't have to search through a page for the chapters. But you have multiple chapters on one page, use the placeholders.
Ripplinger is online now   Reply With Quote
Old 11-19-2012, 07:32 AM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
If you use clips, insert a link placeholder is very easy. If you use an odd character sequence you can avoid search ending up within a word.

It is not really so bad to do it at the end, since you will want to test your links anyway. I insert one, jump to the reference, insert the link there and jump back then go on. That way I can see them working.
mrmikel is offline   Reply With Quote
Old 11-19-2012, 07:57 AM   #6
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
The issue of broken anchor links where they consist of an href without a file prefix is really a bug/limitation in Sigil (that also occurred in 0.5.3). I will take a look at how easy that is to fix. Any valid anchor links which are fully quallified with a filename should be preserved no matter what split, merge or rename operations you perform, but this is one edge case which has been missed.

The other known case is NCX links not surviving merge operations, but that is intentional for the moment.

Edit: Actually I thought I had replicated a splitting issue like the OP posted, but subsequently realised it is actually behaving correctly (my href was to a different id than the one I thought, thereby being on the same page after the split and hence untouched). So if you are able to come up with a repro case where splitting does indeed break initially valid links then I would be interested to see it.

Last edited by kiwidude; 11-19-2012 at 08:28 AM.
kiwidude is offline   Reply With Quote
Old 11-19-2012, 06:29 PM   #7
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
Well ... here's what I was doing.

'Single File.epub' has 4 H1's with the links to the first 3 in the fourth. Works just as I'd expect. Everything in Section0001 (because there is only one)

Created an anchor in the first 3 H1's and links in the fourth (below):

Code:
  <h1 id="sigil_toc_id_22">Here there be links</h1>
  <div>
    This is&nbsp;<a href="#Link_One">link one</a>
  </div>
  <div>
    This is&nbsp;<a href="#Link_Two">link two</a>
  </div>
  <div>
    and this is&nbsp;<a href="#Link_Three">link 3</a>
  </div>
Then I split each H1 into a seperate chapter/file (Chapter Split.epub)

so this used to be in Section0001 with its anchor also in Section001.

Code:
<a href="#Link_One">link one</a>
However, now the above href is in Section0004 and its anchor is still in Section0001

Similarly for the other two href's -- their anchors are in Section002 and Section003

HTH

Paul
Attached Files
File Type: epub Single file.epub (2.5 KB, 29 views)
File Type: epub Chapter Split.epub (3.8 KB, 22 views)
phossler is offline   Reply With Quote
Old 11-20-2012, 04:21 AM   #8
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Using Split at Cursor just above the H1's in your single file epub works okay for me in the latest source. The filenames are added and are correct. I don't think anything in split changed since 0.6.0 but we'll re-test.

Now if you use just the code fragment in your post (the one without the id=Link_One in it), then when you split the filenames are not added - this is because the href points to a non-existent link so it can't find it again to re-link it. But this doesn't seem to be your issue.
meme is offline   Reply With Quote
Old 11-20-2012, 05:58 AM   #9
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
@meme - no there is definitely a problem in there. In fact possibly two issues.

Open the Single file.epub. In Book View, place the cursor on the line before "Heading 1c", and do a split.

Now if you click on "link one", you will find it works, and you think "hey, no problem". However note that (1) if you switch back to the Section0002.html file and try to click it again the link does not work a second time (nor does link two). And (2) if you switch to code view and look at the underlying html that they remain as href="#Link_One" without the file prefix which explains why it won't work for subsequent clicks.

So I'm not sure why it works for that first click, and it seems it isn't doing all the relinking completely as far as the hrefs are concerned.
kiwidude is offline   Reply With Quote
Old 11-20-2012, 06:09 AM   #10
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Yep, I see the issue - in Book View. Of course, I was working in Code View where I usually work and it splits ok there.
meme is offline   Reply With Quote
Old 11-20-2012, 06:34 AM   #11
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Yeah I think that it works in Code View but not in Book View is what fooled me with my original post above - where I thought I had replicated the problem and subsequently couldn't. I must have been in Book View that first time causing me to post.

It doesn't work in 0.5.3 in *either* view, so it looks like something that got "partially improved" with 0.6.
kiwidude is offline   Reply With Quote
Old 11-20-2012, 08:48 AM   #12
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
1. Thanks for looking at it

2. I wasn't saying it was a bug, I figured it was

a. Working the way it was programmed
b. Just one of those things

3. I usually check what I'm done so far by opening the saved .epub in ADE

4. If it is something that gets fixed, that's be great and will make it easier for us newbies to not make silly mistakes

Paul

Last edited by phossler; 11-20-2012 at 08:51 AM. Reason: Hit the wrong button on the **$#&*#^ keyboard
phossler is offline   Reply With Quote
Old 11-20-2012, 02:52 PM   #13
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
Thought occurs ... If I were to merge 2 or more files, would the file references be incorrect?

I usually do that kind of Chapter Splitting stuff in Book View, I'll have to try doing it in Code View, at least as a workaround


Paul
phossler is offline   Reply With Quote
Old 11-20-2012, 03:13 PM   #14
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,386
Karma: 43141350
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by phossler View Post
I usually do that kind of Chapter Splitting stuff in Book View, I'll have to try doing it in Code View, at least as a workaround
I recommend doing it in code view, regardless. That way, you know exactly which element you're splitting before/after.
DiapDealer is online now   Reply With Quote
Old 11-20-2012, 07:10 PM   #15
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 346
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
Quote:
I recommend doing it in code view, regardless. That way, you know exactly which element you're splitting before/after.
In 0.53 in Book view, it would split after the para the cursor was in. In 6 I found out it seems to split at the cursor point, even mid-para

Not better, not worse -- just different

As regards your reccomendation, I can see the merit in that, but I'm a WYSIWYG kind of person, and just not good enough to work in code view all the time.

But for anything complicated, I'll try that way

Paul
phossler is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi, I am new here, Who can tell me how to insert my signature? yakest Introduce Yourself 1 06-23-2011 01:12 AM
Metadata insert Bluebaize Calibre 4 06-22-2011 07:51 PM
Insert a Picture? MickeyC Feedback 6 06-13-2011 01:39 PM
Insert Hyperlinks in Feed Articles Bushwil Recipes 1 01-21-2011 03:51 PM
Insert metadata Landrovan Calibre 1 10-05-2009 02:36 PM


All times are GMT -4. The time now is 01:52 PM.


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