Copied from an identical Stack Overflow Question. (Didn't know there's an eBooks stack exchange now, woot!)
The Puzzle
I am working on an eBook file, or series of files, which should be compatible with the maximum range of eReaders on the market. This would include, for example:
- The e-ink Kindle family
- The Kindle App on iOS, Android (including Kindle Fire) and anywhere else
- iBooks for iOS
- The Nook
- The Nook App for iOS, Android, and anywhere else
- Kobo, possibly (haven't looked into this much)
So we're going for maximum compatibility with different eReaders, I hope that's clear.
Now, here's the issue:
The eBook file has a unique custom glossary which should be easily accessible to the reader.
Although it is one thing to have a glossary in the back of the eBook, all of the modern eReaders have some kind of dictionary functionality that is very accessible (put your cursor on a word, long-press on a word, etc.) so the glossary needs to be just as accessible to encourage usage by readers.
Hyperlinks
One way to do this would be hyperlinking each (or the first) occurrence of a term to the glossary entry in the back, and having hyperlinks in the glossary that go back to the occurrence(s).
Hyperlinks are supported by EPUB, as well as MOBI / AZN / KF8 / etc. for Kindle. The links can be styled so that they are unobtrusive (not underlined, dark gray or black, etc.)
This is the best solution I have been able to concoct so far.
However, having the hyperlinked words look different from the rest of the text could be distracting to the reader. If I use this method, and the hyperlinks are styled to look like the rest of the text, the reader will not know whether to navigate (press) so they will simply use the built-in dictionary (long-press).
(Also note that the newest Kindle software (latest Kindle Paperwhite) shows a little "Footnotes" popup window instead of navigating to the glossary. This is great, except for the fact that it says "Footnote", whereas it should say "Glossary", but this seems to be a Kindle software default--any hints on how to change this would be awesome.)
Modify Built-In Software
If there is any way to let the software know (iBooks / Kindle App / other software) that the book has a custom glossary, so that the default behavior is modified, this would be ideal. In other words, when you long-press the word, you don't just get the default popover (as in the Kindle software or iBooks) but you also get some way to look at the glossary definition.
Personally I know of no way that this can be done, but I'm asking in case anyone knows.
Javascript
Javascript is theoretically supported in EPUB 3, but in reality, out of the major eReading options, iBooks has support, and possibly Kobo (haven't looked into it) but nothing else does. Certainly not the rather antiquated MOBI format, and the KF8 format officially does not support JS.
The idea behind using JS would be to create a custom popover, whenever you tap or long-press a word that has a glossary entry. The custom popover would ideally allow you to choose between the built-in dictionary and the glossary entry. (See this example to get an idea.)
It seems like this would be feasible only in iBooks, and perhaps Kobo, to show the glossary entries. (The popover would just have the hyperlink in it, basically.) In iBooks, I'm not sure how I would activate the built-in dictionary from my own custom JS popover, because the default popover you get in iBooks is the iBooks app's own hook into the text, based on your long-press.
Anyway, this obviously doesn't have cross-platform support into the Kindle family, but I'm throwing it out there as an option.
In Summary
In summary, I'm looking for a way to allow a reader easy access to a glossary in an otherwise standard eBook file (EPUB, Kindle family) across a wide range of eReading options. The eBook will be purchased in a normal eBook store and downloaded through normal methods. An App is not a solution, because of their limited distribution capabilities.
Any potential way of solving this puzzle is welcome!
P.S. Wish I had 150 rep so I could make the tags "glossary" and "dictionary" -_-