Mobileread
How to add to a TOC in MOBI/EPUB files?
#1  mb2u 12-06-2020, 11:55 AM
I have some reference material on MOBI and EPUB but its such a pain to try to find a particular spot because the Table of Contents isn't broken down enough. How can I add more detail to the existing TOC or do I need to start a fresh one? On paper things are so easy to find because it usually tells you at the top/bottom of each page the page number and chapter so you always know where you are. As this doesn't exist on digital documents without breaking up the flow (though it could be displayed as an option when needed!), I think I need to redo the TOC.

It has to integrate with the paper version, unlike most ereaders' attempt at showing you the "progress" bar. You can spend several minutes looking for a particular spot on an ereader. This is by far their weakest area that really needs to be addressed.

The problem may be people usually use ereaders for entertainment and not for learning. They get a book (often bought though millions are available for free if they venture away from Amazon, etc), read it and delete it. Its never read again. This is very profitable for the ebook seller! This is very expensive for the consumer!

With good organization (the manufacturers wanting to encourage consumption don't make it easy to organize lots of books at a time on their devices with only one level of folders/collections/groups usually available), you can have quite a pile of books on your ereader. What we need is to be able to organize all our material on our computer, then transfer the entire thing to the ereader. Or link the ereader and do it from the computer. Organizing on the ereader is a tortuous pain.
Reply 

#2  Doitsu 12-06-2020, 02:07 PM
Quote mb2u
How can I add more detail to the existing TOC or do I need to start a fresh one?
It's relatively easy to automatically generate a new TOC, if all headings are formatted as h1..h6 tags.

For example:

Code
<h1>Chapter 1</h1>
Unfortunately, that's rarely the case. Most likely your chapter headings look like this:

Code
<p class="calibre7"><span class="calibre8">Chapter 1</span></p>
If you're familiar with regular expressions, you can write a regular expression to replace the <p> tags with <h1> tags.

Once all headings are formatted as h1..h6 tags, you can re-generate the TOC:

a) Calibre Editor: Tools > Table of Contents > Edit Table of Contents > Generate ToC from all headings
b) Sigil: Tools > Table of Contents > Generate Table of Contents.

(Of course, you could also manually add/remove TOC entries in Calibre Editor or Sigil.)
Reply 

#3  mb2u 12-06-2020, 02:32 PM
I don't even see the "Calibre Editor" anywhere. I'm using version 5.6. Do I need to download Calibre Editor separately or is it in the main Calibre program? Using Win7.

And what is Sigil?
Reply 

#4  Doitsu 12-06-2020, 02:44 PM
Quote mb2u
I don't even see the "Calibre Editor" anywhere.
It comes with Calibre. To open it, right-click a book and select Edit book.

Quote mb2u
And what is Sigil?
Sigil is a stand-alone epub editor. Here's the download link for the latest version.
Reply 

#5  mb2u 12-06-2020, 03:07 PM
Does this tell you anything? Its numbered on the left column. Here are the first 6 sections. "Matthew" is the name of the chapter.

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MATTHEW</title>
<meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/>
<link href="../stylesheet.css" type="text/css" rel="stylesheet"/><style type="text/css">
Reply 

#6  Doitsu 12-06-2020, 03:29 PM
Quote mb2u
Does this tell you anything?
That's just the preamble. The actual text starts somewhere after the <body> tag. For example:

Code
<xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title></title>
</head><body> <p>This is the first paragraph.</p>
No offense, but it might be easier for you, if you simply downloaded free New Testament epubs with better TOCs.
American Bible Union
King James
Others
Reply 

#7  Hitch 01-09-2021, 02:06 AM
Quote Doitsu
That's just the preamble. The actual text starts somewhere after the <body> tag. For example:

Code
<xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title></title>
</head><body> <p>This is the first paragraph.</p>
No offense, but it might be easier for you, if you simply downloaded free New Testament epubs with better TOCs.
American Bible Union
King James
Others
Doits, don't you think he should ask the mods to move this to the Workshop subforum?

Hitch
Reply 

Today's Posts | Search this Thread | Login | Register