View Single Post
Old 04-06-2017, 03:12 AM   #10
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: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
Let me see if I can get at least the right line of the file to come up. Would that help?
Jumping to the correct line is a "good enough" solution (at least for all of the use-cases I could think of). When I noticed Calibre jump directly to the <a> link I just took that as icing on the cake!

The real thing that was making me pull my hair out was Sigil just jumping to the top of the HTML files.

Quote:
Originally Posted by BetterRed View Post
I occasionally edit texts with a lot of links to endnotes, references etc. I never did 'get' what Sigil's Links Report was supposed to do for me, but when Kovid produced his Links report I 'got' it immediately.

I'd have to do a side-by-side comparison to say anything further as its been a while since I've used either.
Just like the Word List, the Links Report can be used to catch all the inconsistent usages in the <a> tags.

See attached EPUB for all these examples:

Click image for larger version

Name:	LinksReport2.png
Views:	189
Size:	18.0 KB
ID:	156029

Example #1: Take your FBI example, maybe they link throughout the book as:

Spoiler:
Code:
<a href="http://fbi.gov/"> FBI.gov</a>
<a href="http://fbi.gov/">FBI.gov </a>
<a href="http://fbi.gov/">FBI.gov</a>
<a href="http://fib.gov/">FBI.gov</a>
<a href="http://fbi.gov/">fbi.gov</a>
<a href="http://fbi.gov/">fib.gov</a>


Spaces very easily creep their way into <a> when using the mouse + WYSWIG editors. These things stand out like a sore thumb when sorted. :P

And a typo (fib.gov) can also easily sneak in the href (this is very hard to spot just looking through the Code View).

Example #2: In the case of this specific book I was working on, there was an article that referenced (Author Year) with a link to the specific book/paper:

Spoiler:
Code:
(<a href="http://example.com">Tex 2002</a>)
(<a href="http://example.com">Tex 2002)</a>
<a href="http://example.com">(Tex 2002</a>)
<a href="http://example.com">(Tex 2002)</a>


After sorting, you could see it show up in the list as:

Spoiler:
Code:
(Tex 2002
(Tex 2002)
Tex 2002
Tex 2002)


Example #3: It is also very helpful when you do things like changing footnotes from <sup>##</sup> -> [##].

If I sort and see a giant list of:

Spoiler:
Code:
4
[1]
[2]
[3]
[5]


I can go take a closer look. That single digit number should not be there!

Example #4: The "Target Exists?" column is also fantastic for catching missing footnotes:

Spoiler:
Code:
<p>This is the beginning.<a href="#fn1" id="ft1">[1]</a></p>

<p>And the middle.<a href="Endnotes.xhtml#fn2" id="ft2"><sup>2</sup></a></p>

<p>And this is more middle.<a href="#fn3" id="ft3">[3]</a></p>

<p>And this is the end.<a href="#fn4" id="ft4">[4]</a></p>

<hr/>

<p class="footnote"><a href="#ft1" id="fn1">[1]</a> Footnote #1.</p>
<p class="footnote"><a href="#ft3" id="fn3">[3]</a> Footnote #3.</p>


you can sort "Target Exists?" and see "no" in the column, then you can investigate.

Example #5: You can also sort all the links by "Target File" and take a very close look at external websites.

For example, if there are lots of Youtube links, you may want to check to see if those still exist, what the titles are, etc. etc.

(This particular article pointed to a Youtube Embed link instead of just pointing directly to the normal Youtube video.)

This sort of stuff is EASILY spotted in the Report.

Side Note: Calibre's Links Report also lets you click on the links right there and open them up in your browser. Pretty helpful.

Side Note #2: I don't know when it was added, but Calibre's Tools > External Links > Check External Links is absolutely fantastic for catching HTTP 403/404 Errors.

When you import/work from a collection of web articles it helps you can then go hunting and replacing with newer/working ones (for example, there may be broken Facebook/Twitter links, or a site has updated and hasn't redirected links properly).

Quote:
Originally Posted by KevinH View Post
I checked the code and 'Target Text', 'Target's Target File', 'Target's Target ID' or 'Match' are only filled in when the target of a link is itself an achor tag with a link someplace else (or back).

So that appears to work as designed. I will test this tomorrow and verify that.
Yep, they work as intended. See attached EPUB. I put together a variety of different links.

Those columns are used if you do something like link to a separate Endnotes file:

Spoiler:
Code:
---Chapter01.xhtml---

<p>And the middle.<a href="Endnotes.xhtml#fn2" id="ft2"><sup>2</sup></a></p>

---Endnotes.xhtml---

<h2>End Notes</h2>

<p class="footnote"><a href="Chapter01.xhtml#ft2" id="fn2">[2]</a> Footnote #2.</p>
Attached Files
File Type: epub ExampleLinksReport2.epub (2.4 KB, 152 views)

Last edited by Tex2002ans; 04-06-2017 at 03:20 AM.
Tex2002ans is offline   Reply With Quote