09-04-2021, 06:24 AM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
Automated Glosary Footnotes
I'm new to the forum, so hello everyone!
I'm been looking for a way to automatically create links to a glossary, but couldn't find any… I'm a big fan of fantasy books, which often come with a glossary of terms at the end. I find them very helpful because I'm terrible at remembering names. With eInk readers it's kind of a pain to go back and forth to check a word out, so I was trying to implement links on every word present on the glossary. I did it manually on Mistborn, but it was a lot of work. I was wondering if there is some plugin or software that can automate the process, finding every word in the glossary and creating links. I hope I explained myself… Thank you!! |
09-04-2021, 07:49 AM | #2 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Use Sigil's Index creation tool. Create a separate text list of the words you want in the glossary and the Index tool can be used to create the links.
Check out the Sigil User Guide for the details. |
09-04-2021, 12:43 PM | #3 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
I took a look at the index tool but if I'm not mistaking it does de oposite of what I'm trying to do. For example, if I index the name of a town, the index can show me all the pages where the town is mentioned.
What I want to accomplish is to get a link on the name of the town I can click while I'm reading to access that term on the glossary. |
09-04-2021, 12:50 PM | #4 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
So the equivalent of a inserting a footnote?
If so, if you have a list of terms you should be able to create a saved search group (one replaceall search and replace for each term in the list) to do what you want. You can create it in csv and import the saved search group to Sigil and run it. |
09-04-2021, 01:42 PM | #5 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
That's a good idea, it might work. It looks like CSV files are not an option for saved searches though, only INI files. I'll try to make one using find/replace.
Thanks for the tip! |
09-04-2021, 01:56 PM | #6 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Actually with the latest versions of Sigil, Saved Searches will import and export csv.
|
09-04-2021, 02:10 PM | #7 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
You're totally right. Even better!
|
09-04-2021, 03:11 PM | #8 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Note the new Controls part of saved searches so you can set case sensitive or not, regular expression or not, dot all, and etc. Even set the set of file types to work on. They are just two-character long codes that represents each setting. The user guide shows all ofthe new saved search controls.
In addition I recommend making a Checkpoint of uour epub before running your saved search group in case of mistakes so that a simple restore will allow you to try again. Last edited by KevinH; 09-04-2021 at 04:36 PM. |
09-04-2021, 05:43 PM | #9 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Hey. Welcome.
Quote:
1. Ctrl+F. This will open the Find panel. 2. Make sure you are on "Mode: Regex". 3. In the Find box, type this: \b(Alabama|Bengals|Cataclysms|Drinks|Eggnog)\b and in the Replace box, type this: <a href="../Text/Glossary.xhtml#\1">\1</a> * * * Side Note: You can add a big list of terms in the search, as long as you keep using the | between terms/names. In plain English, what this Regex says is: "Look for the word "Alabama" OR "Bengals" OR "Cataclysms" OR [...]" and Replace says: "Replace the word above + give it a link to the Glossary file." * * * This should take a sentence like this: Code:
<p>I went to Alabama to drink some Eggnog.</p> Code:
<p>I went to <a href="../Text/Glossary.xhtml#Alabama">Alabama</a> to drink some <a href="../Text/Glossary.xhtml#Eggnog">Eggnog</a>.</p> So if your glossary had this: Code:
<p>Alabama: A state in the United States</p> <p>Bengals: A type of animal.</p> Code:
<p id="Alabama">Alabama: A state in the United States</p> <p id="Bengals">Bengals: A type of animal.</p> Search: <p>([^:]+) Replace: <p id="\1">\1 That would take whatever's before the colon, and duplicate it into the paragraph's id. (This all depends on your book's code though, hopefully each paragraph has a class="glossary" or something easier to make it stand out.) * * * Usage Note: DO NOT do this in an ebook for sale in the major retailers. ONLY do this on personal ebook copies. For more details on the problems/why, read these previous "glossary" topics: 2019: "Backlinks arrrrrrgh!" 2017: "cross links randomly become footnotes" Especially mine+Hitch's posts. We've discussed this "many-to-one" linking problem many times over the years. Oh yeah, definitely. Very easy to make major mistakes with huge changes like this. Last edited by Tex2002ans; 09-04-2021 at 05:58 PM. |
|
09-09-2021, 07:08 AM | #10 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
|
09-09-2021, 07:11 AM | #11 | |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
Quote:
Thank you very much for your help!! |
|
09-15-2021, 04:18 AM | #12 | |
Guru
Posts: 674
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Then in Kindle, if I highlight a word, then click the Search icon, the glossary entry is the first result, I can go to that, then use the back icon to return. No links need to be coded. Last edited by AlanHK; 09-15-2021 at 07:14 AM. |
|
09-23-2021, 05:44 AM | #13 |
Member
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
|
That sounds like a great solution for a Kindle. I own a Kobo and the process is not that seamless, requiring several taps, and it's particularly annoying going back to the page you were reading.
|
Tags |
footnotes, glossary, links |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automated Page turner | Isayk1988 | Amazon Kindle | 2 | 12-04-2020 05:37 AM |
Automated tag association | jon_joy_1999 | Library Management | 12 | 08-06-2015 09:45 AM |
Automated Emails | anamardoll | Writers' Corner | 2 | 03-03-2012 08:28 AM |
Unutterably Silly When automated suggestions go bad... | Ingrid | Lounge | 4 | 09-25-2009 04:06 AM |