|
|
Thread Tools | Search this Thread |
09-06-2017, 02:57 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2017
Device: none
|
Newb is editing ToC code - Is filepos important in the href attribute?
Hi all,
Although I’ve never dealt with the internals of an eBook or Calibre, I’m helping a friend (who considers me more technically competent) to edit a Table-of-Contents that was missing a section. Tools:Table of Contents:Edit Table of Contents was simple to use - just created a new entry and pointed it to the destination. But there already was some sort of alternate ToC at the end of the e-book. I duplicated a block of ToC code (which pointed to a different section) and edited it as seemed appropriate. It apparently works but is missing one thing: filepos source: <a href="index_split_001.html#filepos1010”><span class="bold"> … or <a href="index_split_003.html#filepos6701”><span class="bold"> … my edit: <a href="index_split_002.html#"><span class="bold"> Seems to work, but is that numerical filepos important? Where can I find that position number for index_split_002.html? Or is that number just a comment, or redundant? Thank you. |
09-06-2017, 04:15 AM | #2 |
The Grand Mouse 高貴的老鼠
Posts: 72,511
Karma: 309063598
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
it's a reference to a position marked in the file. The 'filepos1010' is arbitrary - there's a matching destination in the file.
If your toc entries only need to point to the start of html files, then no # reference is needed. |
Advert | |
|
09-06-2017, 04:41 AM | #3 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
if you remove filepos, remove the #
it is part of the link/anchor Without the #filepos12345, it is just Top-o-File |
09-06-2017, 10:44 AM | #4 | |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
I just delete them all the TOC HTMLs in the editor and add my own TOC using the editor Insert TOC based on Hx tags |
|
09-07-2017, 01:39 AM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2017
Device: none
|
Thanks to everyone for the details of the href/#anchor (and re-assurances).
The (single) end-of-book ToC was rather complex and dense with code (I did not try the beautifier). Replacing it is certainly a thought. If I recall correctly when briefly toying with with Calibre's ToC generation, the result was a sparse, clean HTML page using li tags or maybe li class=. Must confess my ignorance to the community. I had no idea e-books were commonly HTML-based. Just never thought about what was under the hood. Also have to admit the last time I made a web-page it was by hand and pre-CSS... I think I'm going to try to find the time to get to know Calibre better. (Hope this forum wouldn't mind another question or two in future.) Last edited by jg56; 09-07-2017 at 01:43 AM. |
Advert | |
|
09-07-2017, 05:05 AM | #6 | |
Resident Curmudgeon
Posts: 76,402
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
09-07-2017, 10:57 AM | #7 | |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
But, there's a lot of PD books out there that have been run through Calibre multiple times over the years (I'm assuming by multiple people) to convert MOBI to EPUB to MOBI and EPUB and AZW3, etc., most probably in bulk You can usually spot such books by how many TOC's there are at the end, by classes that start with .caliber....., and by how complicated/redundant the style sheets are |
|
09-07-2017, 11:29 AM | #8 | |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
GIGO [rant] It astounds me, the number of coding flaws (and errors) in ebooks purported to have been professionally done. This includes BPH's. I don't count messy code, as long as it is valid. I don't grade grammar. I do count inconsistent style (CSS) usage (different chapters use different style names/values for the same type of content [/rant] |
|
09-07-2017, 11:34 AM | #9 |
Resident Curmudgeon
Posts: 76,402
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Most BPH's eBooks are coded using code like
Code:
<p class="CT" id="c01"><b>1</b></p> |
09-07-2017, 04:17 PM | #10 | |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
There is no need, if the NCX is correct. The HTML TOC is created from that. I am talking about code that either fails to validate or does not work as the code implies. |
|
Tags |
code, edit, filepos, table of contents, toc |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What does the filepos parameter do in an href? | lunixer | ePub | 6 | 03-16-2017 11:56 AM |
TOC attribute validation error | curiousgeorge | ePub | 3 | 04-18-2013 05:07 PM |
blank TOC page - attribute 'link' not declared for element 'body' | wyatt650 | Sigil | 4 | 04-18-2013 02:41 PM |
Editing code view in Sigil | JJ Joseph | Sigil | 8 | 06-09-2012 02:30 AM |
Use Regex to Code an Inline TOC, from an External TOC's .ncx File | mostlynovels | ePub | 2 | 03-16-2011 01:15 PM |