Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-04-2021, 06:24 AM   #1
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
Question 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!!
Elvys is offline   Reply With Quote
Old 09-04-2021, 07:49 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Advert
Old 09-04-2021, 12:43 PM   #3
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
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.
Elvys is offline   Reply With Quote
Old 09-04-2021, 12:50 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 09-04-2021, 01:42 PM   #5
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
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!
Elvys is offline   Reply With Quote
Advert
Old 09-04-2021, 01:56 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Actually with the latest versions of Sigil, Saved Searches will import and export csv.
KevinH is offline   Reply With Quote
Old 09-04-2021, 02:10 PM   #7
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
You're totally right. Even better!
Elvys is offline   Reply With Quote
Old 09-04-2021, 03:11 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 09-04-2021, 05:43 PM   #9
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Elvys View Post
I'm new to the forum, so hello everyone!
Hey. Welcome.

Quote:
Originally Posted by Elvys View Post
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.
You'd probably be able to use Regex to accomplish most of this.

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>
and change it into:

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>
4. Go into your Glossary file, and make sure each of those words has an id.

So if your glossary had this:

Code:
<p>Alabama: A state in the United States</p>
<p>Bengals: A type of animal.</p>
You'd want to ultimately change it to:

Code:
<p id="Alabama">Alabama: A state in the United States</p>
<p id="Bengals">Bengals: A type of animal.</p>
To accomplish this, do a similar Search/Replace:

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.

Quote:
Originally Posted by KevinH View Post
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.
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.
Tex2002ans is offline   Reply With Quote
Old 09-09-2021, 07:08 AM   #10
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
Quote:
Originally Posted by Tex2002ans View Post
You'd probably be able to use Regex to accomplish most of this.
I'm not very versed in Regex syntax, but your guide is very, very helpful.
I'll sure give it a try.

Thank you very much!!
Elvys is offline   Reply With Quote
Old 09-09-2021, 07:11 AM   #11
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
Quote:
Originally Posted by KevinH View Post
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.
Didn't know about neither of those features. Both great additions.
Thank you very much for your help!!
Elvys is offline   Reply With Quote
Old 09-15-2021, 04:18 AM   #12
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Elvys View Post
fantasy books, which often come with a glossary of terms at the end.
One easy thing to do is move the glossary at the front of the book.

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.
AlanHK is offline   Reply With Quote
Old 09-23-2021, 05:44 AM   #13
Elvys
Member
Elvys began at the beginning.
 
Elvys's Avatar
 
Posts: 16
Karma: 10
Join Date: Sep 2021
Location: Spain
Device: Kobo Sage
Quote:
Originally Posted by AlanHK View Post
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.
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.
Elvys is offline   Reply With Quote
Reply

Tags
footnotes, glossary, links


Forum Jump

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


All times are GMT -4. The time now is 01:10 AM.


MobileRead.com is a privately owned, operated and funded community.