Can I create hyperlinks to jump between books/chapters in HTML-based projects?


I am making a custom bible dictionary project with HTML files as the main source. For simplicity, the project will only have one book collection (C01) and one book (B001), and the rest of the HTML files containing entries of the dictionary would be treated as chapters of the book.

The project’s structure in SAB

And the first chapter of the book (B001.1) will be an index from which user can scroll down or search and filter the list, then “jump” to the desired entries (chapters) of the dictionary.

The index (Chapter 1)

A sample of the dictionary entries (Chapter 2 onwards)

Now, the problem is I can’t find a way to make hyperlinks that can jump to any of these chapters. Here’s what I’ve tried thus far to no avail:

Direct link to files or anchors in project directory:

  • <a href="_00000_Abadon.html">Text</a>
  • <a href="#Abadon">Text</a>

Markdown/USFM style:

  • <a href="B001.1">Text</a>
  • <a href="C01/B001.1">Text</a>

Inspired by SAB-exported HTMLs:

  • <a href="01-B001-1">Text</a>
  • <a href="C01-01-B001-001">Text</a>

Deep link (would work from browsers but will do nothing from within the app):

  • <a href="kamus-alkitab://C01/B001.1">Text</a>

Does anyone know how to make links between books/chapters in HTML?

I can see what you are trying to do.

I’d suggest that you don’t make Chapter 1 but instead use the Content Menu to create the links to the chapter for that word.

SAB is designed for USFM. USFM documents work well. DOCX documents are converted to SFM and work well. HTML and EPUB are not converted and are presented as is. I have seen linking not working in HTML. Converting your data to SFM would probably solve that issue. Also if you use SFM you can use \cp after the chapter number.

\c 1
\cp Abandon

So in the top menu instead of 1 showing the word Abandon would show. So you would have another way to find a word.

Are you trying to Deep link to your own app or to another app?

I’d like to look more at your project, since the HTML files lists so many files yet you have only added one book. That is for my own learning, but it may help you too.

Hi Ian.

Thanks for your feedback.

I’ve already tried using the built-in Contents Menu for this but because of how large it is (18,000 entries) the app takes more than 10 seconds to load on each launch. In contrast, making a chapter 1 page containing the same number of indexes would load faster (3-5 seconds on average), but I have no way to jump to anywhere from that page. But reading your suggestion gives me an idea to make a separate SFM book for that purpose. That way, I can make use of the markdown syntax to jump to other books/chapters. Maybe I’ll try that, though I’ll lose the ability to filter the list because I can’t use JS with SFM.

As for the contents, currently I’m sticking to HTML because there are certain features that would be lacking should I convert them to USFM such as the ability to jump to the top of the page or to jump to specific sections of the page.

And as I’ve mentioned on the previous post, I’ve only added one book for the project for simplicity (and I guess efficiency of storage). I’ve tried separating the content files into different books but that results in significantly larger APK file. From what I can tell, it is because I’ve also had to duplicate the CSS file for each of those books. Putting the files under one book, on the other hand, allows me to specify only one CSS file to rule them all. I haven’t seen any other way to do this.

I plan to deep link the biblical reference in this app to the bible app that we’ve developed also with SAB. But for now, I just redirect all of those reference to our bible website.

And sure, I can send you a copy of this project with several samples of its contents. Please look into it. Very much appreciated.

Yes your filter JS is very nice. A pity to loose that.

Thanks for your project. I have learned that I missed an addition to SAB that I should know about.

The page internal links and external links work fine.

The index.html page you have used deep linking, but that is meant to come from outside of the app to inside.

Have you just tried using just the ID/name in the Index links? href="#Abadon_top" That sort of links work within a page and SAB seems to be treating all the HTML files as one book. Out of time to test.