Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-23-2016, 10:48 AM   #16
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You could be right. It does't really affect me at all (mostly because I almost never have url frags in my ebook links).

I just worry about new users making a dog's lunch of things without realizing it. I know we can't save everyone from themselves, but I can't really see any downside to giving them a heads-up that they're about to do something risky, either.

Yes the problematic link is technically broken already, but it will still get a reader to the right file even if the target id doesn't exist.

I think the way the software currently works is fine, too. I just don't think a "here's what can go wrong IF..." warning could hurt either. It's a pretty drastic procedure to be kicked off with no confirmation.

Last edited by DiapDealer; 06-23-2016 at 11:10 AM.
DiapDealer is offline   Reply With Quote
Old 06-23-2016, 11:04 AM   #17
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
I think the way the software currently works is fine, too. I just don't think a "here's what can go wrong IF..." warning could hurt either. It's a pretty drastic procedure to be kicked off with no confirmation.
I also think the way the software currently works is fine, but it would even be better, if Sigil displayed a warning, if a document contained missing or invalid fragment ids and a user tried to split it at chapter markers.

Not seeing a missing/invalid fragment id warning would also give users peace of mind that splitting files isn't likely to break any links.
Doitsu is offline   Reply With Quote
Advert
Old 06-23-2016, 12:10 PM   #18
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi Diapdealer

Quote:
but it will still get a reader to the right file even if the target id doesn't exist.
;-)

Not all of the time. Think of starting with one big xhtml file with unique ids and then splitting it into many files. The one big file no longer exists and you end up having no idea of which of the smaller file to actually link to since the id does not actually exist!

So it looks like some sort of id/fragment check function needs to included right at the same point we do a well-formed check to make sure things are hunky-dory before splitting.

That should be doable as we already have routines to get all ids defined across the book (using multiple threads so it is done concurrently) so before splitting we could walk the urls with fragments and verify if an "id" exists in that particular file.

KevinH
KevinH is offline   Reply With Quote
Old 06-23-2016, 12:31 PM   #19
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I meant the "broken" link (file exists but fragment id does not) before any splitting.

Such a link will still take the reader to the beginning of that file (even if it includes an undefined url fragment id).

It's LESS broken before the splitter gets a hold of it.

Out of curiosity ... what does the splitter function currently do to a link that includes a non-existent file (but has no fragment)?

Last edited by DiapDealer; 06-23-2016 at 12:34 PM.
DiapDealer is offline   Reply With Quote
Old 06-23-2016, 12:38 PM   #20
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
It will not match on it and therefore won't touch it.
KevinH is offline   Reply With Quote
Advert
Old 06-23-2016, 12:41 PM   #21
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
So it looks like some sort of id/fragment check function needs to included right at the same point we do a well-formed check to make sure things are hunky-dory before splitting.
That sounds doable. But would it nag any time the well-formed check fired (and frag ids were undefined)?

I really wouldn't want an undefined fragment id to prevent a user from saving the epub, or performing other automated tasks. It seems to me that splitting/merging is the only time such a thing would be critical. No?
DiapDealer is offline   Reply With Quote
Old 06-23-2016, 01:49 PM   #22
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
I am thinking of here:

void MainWindow::SplitOnSGFSectionMarkers()

Right after it does this:

Code:
        // Check if data is well formed before splitting.
        if (!html_resource->FileIsWellFormed()) {
            QMessageBox::warning(this, tr("Sigil"), tr("Cannot split: %1 XML is not well formed").arg(html_resource->Filename()));
            return;
        }
So it would only get invoked when a person intentionally tries to split a file but before the file is actually physically split.

KevinH
KevinH is offline   Reply With Quote
Old 06-23-2016, 06:00 PM   #23
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: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Makes sense. I've you've not already dived into it, I wouldn't mind taking a bit of a stab at it. It doesn't seem like it's a very critical thing, so there's not a lot of pressure to get to get it done in a hurry.

Quote:
That should be doable as we already have routines to get all ids defined across the book (using multiple threads so it is done concurrently) so before splitting we could walk the urls with fragments and verify if an "id" exists in that particular file.
Would that routine be m_Book->GetIdsInHTMLFiles() ?
DiapDealer is offline   Reply With Quote
Old 06-23-2016, 06:54 PM   #24
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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi DiapDealer,
This bug is all yours. The other place to look for code is in Dialogs/ReportsWidgets at the LinksWidget.cpp which tests links. I have not looked at it yet. The UpdateAnchors code calls something in XhtmlDoc.cpp to get all the Ids but there mght be an interface in Book that invokes it as well.

KevinH
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating links in an existing epub-text? Chris_ Editor 3 07-06-2015 06:10 PM
When you split a file does Sigil update links? JimmyG Sigil 2 10-31-2013 01:02 PM
How to create TOC, what does split on SGF markers mean? neonbible Sigil 18 01-23-2011 06:22 AM
Existing links forum removed Alexander Turcic Announcements 0 11-17-2002 04:06 PM
Existing links now updated Alexander Turcic Announcements 0 10-27-2002 08:55 AM


All times are GMT -4. The time now is 02:25 AM.


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