08-11-2019, 06:14 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jul 2014
Device: Kindle e-ink
|
Sigil Index of first lines
I'm using Sigil for the first time to create a poetry book and there is a requirement for an index of first lines. I have marked the first lines of the poem as an index entry and then created the index.
I think I must be doing something wrong. In the index the first line appears but without a link. The link is provided by clicking on a number 1 that appears next to all the entries. The html looks like Code:
<div class="sgc-index-entry"> first line of the poem <a href="link to the poem">1</a> </div> < Code:
div class="sgc-index-entry"> <a href="link to the poem"> first line of the poem</a> </div> Can anybody help? |
08-11-2019, 09:30 PM | #2 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Step 1: Open up the Find/Replace (Ctrl+F) or press the menu Search > Find & Replace.
Step 2: Make sure you have the Mode box set as Regex. If you want to be safe, only have the Index open in Sigil, and change the 2nd dropdown to "Current File". This will make sure it won't go replacing through your entire book (although it shouldn't). Step 3: Put this in the fields: Search: <div class="sgc-index-entry">\s+(.+?)\s+(<a href="[^"]+">)\d+</a>\s+</div> Replace: <div class="sgc-index-entry">\2\1</a></div> What that will do is take your example code, and convert it into: Code:
<div class="sgc-index-entry"><a href="link to the poem">first line of the poem</a></div> Alternate #3: Personally, what I would do is use: Replace: <p class="indexfirstline">\2\1</a></p> and adjust the CSS. The code would be much more readable. Last edited by Tex2002ans; 08-11-2019 at 09:36 PM. |
Advert | |
|
08-16-2019, 07:44 AM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jul 2014
Device: Kindle e-ink
|
Thank you very much. Both methods work for me and saved a considerable amount of time. - Edmundb
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Index editor: where does sigil save the list? | 1v4n0 | Sigil | 2 | 01-08-2015 01:42 PM |
Sigil Plugin Index | Thasaidon | Plugins | 0 | 10-04-2014 07:41 AM |
Some lines center in Sigil but are LJ in readers | philip_rhoades | Sigil | 6 | 06-04-2014 04:32 AM |
Sigil Index and anchor formatting | mncowboy | Sigil | 2 | 03-13-2013 07:22 PM |
TOC and Index links in Sigil | Bamber | ePub | 10 | 11-11-2010 02:12 PM |