![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Multiple index entries pointing to the same location.
I am creating a book in which I have a need to create multiple index entries that all point to the exact same location in the book.
I have attached a simple example file to demonstrate my conundrum. It only has a title and three paragraphs of "Lorem ipsum" in it. There are two index entries. What I would like to figure out is how to add additional index entries that point to the Title, for example "My book title". Hence the two index entries in the book. I have tried adding a blank paragraph tag just before the title tag and pointing to that, but Sigill apparently does not want to do that. I have tried using a location in the first paragraph text for a second tag, but when I do that the title gets shifted up out of view when I follow the link in the index. Textbooks do this sort of thing all the time, so I don't think that it is a totally crazy idea. Is there a way in Sigil to create multiple index entries that all point to the same location? I am suspecting that I am missing something simple. Thanks for any ideas. Banjo (_)=='=~ |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
You are talking about an index, not a toc right?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
You can assign as many links as you want to the same location by linking to the same id in the target file.
How are you creating the index entries? Using a regex search or marking for index or ... ? |
![]() |
![]() |
![]() |
#4 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Quote:
I created the index by marking the tag contents for index with Tools => Index => Mark for Index and then clicking on the "Generate new index HTML file" button. If i manually edit the Index.xhtml file to add another pointer to the sigil_index_id, it will get wiped out the next time I generate the index. What am I missing? |
|
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Not much. Index building is normally done only when the book text is complete.
So build your index once, then augment it as needed with as many additional links as you desire. The Index generator tool just automates as much of the process as possible. Each index entry typically points to multiple references to a specific string. That is what the Index generator does by collecting the words you mark for it to include. I will take a look at your example once I get back to an actual machine and not just an iPad that I have now. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
I looked around a bit, and I found in the user guide for 1.19.10 it says that when you mark text for entry:
Quote:
Quote:
BTW, I am running 1.9.10 |
||
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Here is the only way I could get it to do what I think you want. But I am no index expert as I rarely use this tool.
Code:
<h1><a class="sigil_index_marker" style="display: none;" title="My Title">My Title</a><a class="sigil_index_marker" title="Title">Title</a></h1> Basically I had to insert an anchor around a new set of text and then style that anchor to not be displayed. There may be other ways. But in the end it may just be easier to edit the generated Index and under "My Title" put a link to the Title index entry under "See Title". |
![]() |
![]() |
![]() |
#8 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Quote:
I will take a look at the code when I get some time this week to see when this was dropped and how it was supposed to work. |
|
![]() |
![]() |
![]() |
#9 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Kevin,
Thanks a bunch. I'll try your solution and keep looking. |
![]() |
![]() |
![]() |
#10 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
The capability to use ";" for multiple index entries was intentionally removed way back in Sigil 0.71 in Feb of 2013 (so before my time).
https://github.com/Sigil-Ebook/Sigil...bc8313df0ba6e2 The comment to that change say it was removed to prevent invalid code generation. My guess is they just forgot to remove it from the Sigil User's Guide. I will make that change to the users guide since it was deliberately removed. |
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Looking closer. That feature was only meant for adding entries to the "Index Editor" and *not* for use with "Mark for Index". They removed it since regular expressions patterns are now supported in the Index Editor which means it can be used to match a number of variations of a word or phrase making the ";" approach obsolete.
So not a bug, but the Sigil Users Guide does need to be updated. The issue with your example epub is that the string "My Title" is no where in the document itself so it can not be found by a pattern. So my trick of using display hidden, is probably the only way to force creation of a "My Title" entry in the Index using the "Mark for Index" approach. |
![]() |
![]() |
![]() |
#12 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Kevin,
Thanks for looking into that. I tried the style="display: none;" method, and it did not work for me. It made the extra title invisible in the overview panel, but not in the book. Two readers on my system, Okular and FBReader, both showed the invisible title in the book. I will see if I can figure out a creative (or manual) way around my issue. If I come up with a solution that is better than the one I have, I will post. |
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
Try adding visibility:hidden after the display:none.
If that does not properly hide it then your e-reader is broken. |
![]() |
![]() |
![]() |
#14 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,701
Karma: 4500780
Join Date: Nov 2009
Device: many
|
According to spec, display:none should prevent even the layout of the tag. Not sure about your e-readers if they are ignoring it.
|
![]() |
![]() |
![]() |
#15 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Quote:
I copied the very same ebook onto my tablet and it works fine.... no visible second title..... using FBReader... ostensibly the same program I am using on this desktop. So I installed Calibre on the desktop, and it works fine in Calibre as well. I guess something is definitely FUBAR with a couple of my readers. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Empty entries in the index | libre75 | Sigil | 2 | 06-19-2019 05:07 PM |
Index not working for entries within <em> | 1v4n0 | Sigil | 10 | 10-30-2017 10:53 AM |
Error: Index has too many entries... | Katsunami | Conversion | 6 | 10-12-2013 10:06 AM |
Bug: entries with multiple formats trigger multiple conversions | flinx1 | Calibre | 12 | 05-21-2010 07:23 AM |