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 02-04-2019, 12:43 AM   #1
youcantoo
Junior Member
youcantoo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
Angry Need help with anchor link

Am using anchor links but keep getting the following error when splitting at markers. I do not understand what the error is actually trying to tell me

Quote:
The href #editorial found in ebook-template.html does not exist (and there may be more). Splitting or merging under these conditions can result in broken links.
Do you still wish to continue?
this is a sample of the the code that is being used

Code:
<li><a href="#editorial">From The Chief Editor's Desk</a></li><br>
 <ol>
  <li><a href="#page01">Casual Python, Part 1</a></li>
  <li><a href="#page02">PCLinuxOS Recipe Corner: Slow Cooker Asian Beef</a></li>
  <li><a href="#page03">ms_meme's Nook: Daddy Boot Up That Sixty-Four Bar</a></li>
  <li><a href="#page04">Short Topix: Assaults On Privacy Continue Unchecked</a></li>
  <li><a href="#page05">Inkscape Tutorial: Some Useful And Fun Extensions</a></li>
  <li><a href="#page06">Configuring CUPS-PDF</a></li>
  <li><a href="#page07">A Guided Tour Of The Data Facebook Uses To Target Ads</a></li>
  <li><a href="#page08">Alternatives To Dropbox, Part 3</a></li>
  <li><a href="#page09">PCLinuxOS Family Member Spotlight: masinick</a></li>
  <li><a href="#page10">One Way To Duplicate Your Installation On Another Computer</a></li>
  <li><a href="#page11">ms_meme's Nook: Swinging PCLOS Blues</a></li>
  <li><a href="#page12">PCLinuxOS Bonus Recipe Corner: Italian Sausage With Tomatoes And Penne</a></li>
  <li><a href="#page13">Configuring Late Model Epson Printers</a></li>
  <li><a href="#page14">Victory! Illinois Supreme Court Protects Biometric Privacy</a></li>
  <li><a href="#page15">PCLinuxOS Puzzled Partitions</a></li>
  <li><a href="#page16">Screenshot Showcase</a></li>
 </ol>

<hr class="sigil_split_marker" />
<!-- editorial -->
 <a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
can someone point me in the right direction.

Thanks for any and all help.
youcantoo is offline   Reply With Quote
Old 02-04-2019, 01:28 AM   #2
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,154
Karma: 6100569
Join Date: Jul 2012
Device: Kobo Forma, Nook
Here's the two relevant chunks:

Code:
<li><a href="#editorial">From The Chief Editor's Desk</a></li><br>
Code:
<hr class="sigil_split_marker" />
<!-- editorial -->
 <a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
What href="#editorial" is saying is:

Jump to the id="editorial" within the the same exact file.

Because you are trying to SPLIT the id="editorial" into a different file, Sigil is warning you about it.

You can split it anyway, your links will break, and you can manually correct your links. Or if you want it automated by Sigil, you can specify the file within the href.

Let's say the file all this information is in a Chapter01.xhtml file:

Chapter01.xhtml

Code:
<li><a href="../Text/Chapter01.xhtml#editorial">From The Chief Editor's Desk</a></li><br>

[...]

<hr class="sigil_split_marker" />
<!-- editorial -->
 <a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
What the updated href is saying now:

Look for the id="editorial" in THIS SPECIFIC FILE (Chapter01.xhtml).

When you then split it, Sigil should auto-update your links for you:

After Sigil Split

Chapter01.xhtml

Code:
<li><a href="../Text/Chapter02.xhtml#editorial">From The Chief Editor's Desk</a></li><br>
Chapter02.xhtml

Code:
<!-- editorial -->
 <a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
Now you can see, the new link says:

Go look in Chapter02.xhtml, and jump to the id="editorial".

Last edited by Tex2002ans; 02-04-2019 at 01:34 AM.
Tex2002ans is offline   Reply With Quote
Old 02-04-2019, 09:08 AM   #3
KevinH
Wizard
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: 3,235
Karma: 1958102
Join Date: Nov 2009
Device: many
Maybe we (Sigil) should see if we can better deal with naked fragments? I will look at the split code.
KevinH is online now   Reply With Quote
Old 02-04-2019, 09:50 AM   #4
KevinH
Wizard
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: 3,235
Karma: 1958102
Join Date: Nov 2009
Device: many
As far as I can tell from just eyeballing the code, the HasUndefinedURLFragments test code should properly handle this testcase as it detects empty filenames in URLs and assigns it to the filename being processed.

I will play around with this testcase to see what is going on.
KevinH is online now   Reply With Quote
Old 02-04-2019, 02:03 PM   #5
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: 19,822
Karma: 101452854
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
As far as I can tell from just eyeballing the code, the HasUndefinedURLFragments test code should properly handle this testcase as it detects empty filenames in URLs and assigns it to the filename being processed.
It's been a while since I looked at it, but I was under the same impression. It's the fragments that don't have corresponding id's that tends to mess things up (and HasUndefinedURLFragments was designed to warn about).

Not to say there might not be a bug in my code.

When playing with the OP's sample code, Sigil, indeed, does not choke on the #editorial frag/id. It chokes on the first #pagexx frag/id that's missing from the sample. In my experience, Sigil will handle splitting a file similar to this so long as every fragment has a matching id. It shouldn't matter if the filename is not included.

I fear the sample code isn't entirely representative of the specific warning message the OP is getting.

Last edited by DiapDealer; 02-04-2019 at 02:20 PM.
DiapDealer is online now   Reply With Quote
Old 02-04-2019, 02:43 PM   #6
KevinH
Wizard
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: 3,235
Karma: 1958102
Join Date: Nov 2009
Device: many
Okay, I just tested this with the following testsplit.epub (see attached), and Sigil properly handles split at markers with no error messages and properly groks and updates naked fragments..

So the test case presented to us is somehow suspect. In fact the presence of a unclosed br tag in the test case and li tags not inside an ol lead me to believe that the structure of the original html file was quite broken (or was broken when extracted) but still an unclosed br is not valid xhtml.

Normally before running split on such a xhtml file, you should make sure you have actual xhtml code (for example br is a self-closing tag and needs to be closed in xhtml) and that it passes is actually parseable. Spliting unparseable broken code is not in anyone's best interest.

My guess is the actual case had an undeclared fragment, and Sigil did what it was supposed to and warned about it.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p><a href="#editorial">From The Chief Editor's Desk</a></p>
 <ol>
  <li><a href="#page01">Casual Python, Part 1</a></li>
  <li><a href="#page02">PCLinuxOS Recipe Corner: Slow Cooker Asian Beef</a></li>
  <li><a href="#page03">ms_meme's Nook: Daddy Boot Up That Sixty-Four Bar</a></li>
  <li><a href="#page04">Short Topix: Assaults On Privacy Continue Unchecked</a></li>
  <li><a href="#page05">Inkscape Tutorial: Some Useful And Fun Extensions</a></li>
  <li><a href="#page06">Configuring CUPS-PDF</a></li>
  <li><a href="#page07">A Guided Tour Of The Data Facebook Uses To Target Ads</a></li>
  <li><a href="#page08">Alternatives To Dropbox, Part 3</a></li>
  <li><a href="#page09">PCLinuxOS Family Member Spotlight: masinick</a></li>
  <li><a href="#page10">One Way To Duplicate Your Installation On Another Computer</a></li>
  <li><a href="#page11">ms_meme's Nook: Swinging PCLOS Blues</a></li>
  <li><a href="#page12">PCLinuxOS Bonus Recipe Corner: Italian Sausage With Tomatoes And Penne</a></li>
  <li><a href="#page13">Configuring Late Model Epson Printers</a></li>
  <li><a href="#page14">Victory! Illinois Supreme Court Protects Biometric Privacy</a></li>
  <li><a href="#page15">PCLinuxOS Puzzled Partitions</a></li>
  <li><a href="#page16">Screenshot Showcase</a></li>
 </ol>

<hr class="sigil_split_marker"/>
<!-- editorial -->
 <a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
<p id="page01">Page 01 </p>
<p id="page02">Page 02 </p>
<p id="page03">Page 03 </p>
<p id="page04">Page 04 </p>
<p id="page05">Page 05 </p>
<p id="page06">Page 06 </p>
<p id="page07">Page 07 </p>
<p id="page08">Page 08 </p>
<p id="page09">Page 09 </p>
<p id="page10">Page 10 </p>
<p id="page11">Page 11 </p>
<p id="page12">Page 12 </p>
<p id="page13">Page 13 </p>
<p id="page14">Page 14 </p>
<p id="page15">Page 15 </p>
<p id="page16">Page 16 </p>
</body>
</html>
Attached Files
File Type: epub testsplit.epub (2.4 KB, 17 views)

Last edited by KevinH; 02-04-2019 at 04:40 PM.
KevinH is online now   Reply With Quote
Old 02-05-2019, 12:04 PM   #7
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,245
Karma: 500084
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by Tex2002ans View Post

What the updated href is saying now:

Look for the id="editorial" in THIS SPECIFIC FILE (Chapter01.xhtml).

When you then split it, Sigil should auto-update your links for you:
I originally built my ebooks as a single html file (zipped with images if there were any) so I regularly used the # in links. When I switched to Sigil-built epub, what Tex describes here is exactly the way it worked (and continues to work) for me. Indeed, one of the things I loved about Sigil was the way it split a file so neatly, recapitulating the CSS link and handling hotlinks across the new divide.
Notjohn is offline   Reply With Quote
Old 02-05-2019, 12:17 PM   #8
KevinH
Wizard
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: 3,235
Karma: 1958102
Join Date: Nov 2009
Device: many
It still works that way. It handles href="#editorial" just fine during the split (see my test case). The problem is the op posted a snippet of xhtml that "showed the problem" when in fact, it does not. So the op must have edited the snippet of xhtml in a way to make an id="editorial" exist when it did not in the original. Otherwise he would not have received that warning.

To illustrate this remove the id="page09" attribute from my test case shown above and Sigil will now happily warn you that an href="#page09" does not have a valid destination and so is a broken link that can not be updated.
KevinH is online now   Reply With Quote
Old 02-05-2019, 03:47 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,154
Karma: 6100569
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Notjohn View Post
I originally built my ebooks as a single html file (zipped with images if there were any) so I regularly used the # in links. When I switched to Sigil-built epub, what Tex describes here is exactly the way it worked (and continues to work) for me.
Yeah, I swear that's how split worked for all the years I've used split.

youcantoo or Notjohn, do you attach an actual EPUB that actually recreates OP's issue?

I tested on a few of my latest books, and the split code works exactly like KevinH said. And it leaves me scratching my head, because I know I've seen the OP's issue many times over the years. (Although I just throw away all link code and recreate clean links on my own, so it never really bothered me.)

(I'm going to dig through some of my EPUBs and see if I can get a good testcase. And I'll definitely keep my eye out on this in the future.)

Quote:
Originally Posted by KevinH View Post
So the test case presented to us is somehow suspect. In fact the presence of a unclosed br tag in the test case and li tags not inside an ol lead me to believe that the structure of the original html file was quite broken (or was broken when extracted) but still an unclosed br is not valid xhtml.
Could be, could be...

I know Finereader sometimes creates some poor code (and maybe this is when I'm splitting files and seeing the error, when it's still in an invalid state).

Last edited by Tex2002ans; 02-05-2019 at 03:57 PM.
Tex2002ans is offline   Reply With Quote
Old 02-05-2019, 07:37 PM   #10
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: 19,822
Karma: 101452854
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Remember that it's a warning and not an error.

Before I added the frag warning, Sigil would silently mess things like this up in the background. You only found out later that something bad had happened.

Splitting can result in invalid "naked," (file-less) frags if their corresponding target is missing, but Sigil never really had an issue with "naked" frags that started out valid and had valid targets before the spit operation was initiated.

Last edited by DiapDealer; 02-06-2019 at 06:05 AM.
DiapDealer is online now   Reply With Quote
Old 02-06-2019, 04:01 AM   #11
youcantoo
Junior Member
youcantoo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
Thanks for everyones help

I am looking through the code and have spotted several minor mistakes. I will get them corrected over the next few days and will let you know if it works. I do want to thank each and everone of you for your comments and suggestions.
youcantoo is offline   Reply With Quote
Old 02-06-2019, 07:29 AM   #12
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: 19,822
Karma: 101452854
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
In addition to making sure the xhtml is valid before performing operations like this, there's a Links Report (Tools->Reports) which has "Target ID" and "Target Exists?" columns that can be very helpful in (pre)diagnosing potential Splitting issues.

Last edited by DiapDealer; 02-07-2019 at 05:27 AM.
DiapDealer is online now   Reply With Quote
Old 02-06-2019, 11:00 AM   #13
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,245
Karma: 500084
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by Tex2002ans View Post
youcantoo or Notjohn, do you attach an actual EPUB that actually recreates OP's issue?
I can't! Sigil has yet to let me down in this respect (or any other that immediately comes to mind).
Notjohn is offline   Reply With Quote
Old 02-07-2019, 02:43 AM   #14
youcantoo
Junior Member
youcantoo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
Quote:
Originally Posted by DiapDealer View Post
In addition to making sure the xhtml is valid before performing operations like this, there's a Links Report (Tools->Reports) which has "Target ID" and "Target Exists?" columns that can very helpful in (pre)diagnosing potential Splitting issues.

Thanks for the information
youcantoo 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
Why do mismatched link and anchor work? Abull Editor 3 06-13-2014 01:00 AM
epub iBook link-anchor dicknskip Sigil 1 04-04-2013 01:28 AM
Anchor in Kindle quocsan Kindle Formats 4 10-22-2012 10:03 PM
simple anchor link question affa ePub 1 04-20-2011 04:29 AM


All times are GMT -4. The time now is 02:37 PM.


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