Internal stucture of epubs

There are some serious issues with the internal structure of Editions EPUBs. What is wrong is a too extensive to succinctly express, other than to say navigation is completely broken in DN, MN, SN,and AN in the EPUBs generated 2023-05-23.

1 Like

It’s always better to give at least a few specifics when reporting a problem, even if you can’t explain everything.

In the DN and MN (the only ones I looked at) I can’t find a table of contents that lists all the suttas. There is only a super brief TOC that is just the .nav file. For example:

image

And the file that contains the body of the text starts with all of the chapter headings:

  <body>
    <h1 class="section-title heading" id="mn-mulapannasa">The First Fifty </h1>
    <h1 class="section-title heading" id="mn-majjhimapannasa">The Middle Fifty </h1>
    <h1 class="section-title heading" id="mn-uparipannasa">The Final Fifty </h1>
    <h2 class="section-title heading" id="mn-mulapariyayavagga">The Chapter on the Root of All Things </h2>
    <h2 class="section-title heading" id="mn-sihanadavagga">The Chapter on the Lion’s Roar </h2>
    <h2 class="section-title heading" id="mn-opammavagga">The Chapter of Similes </h2>
    <h2 class="section-title heading" id="mn-mahayamakavagga">The Greater Chapter on Pairs </h2>
    <h2 class="section-title heading" id="mn-culayamakavagga">The Lesser Chapter on Pairs </h2>
    <h2 class="section-title heading" id="mn-gahapativagga">The Chapter on Householders </h2>
    <h2 class="section-title heading" id="mn-bhikkhuvagga">The Chapter on Mendicants </h2>
    <h2 class="section-title heading" id="mn-paribbajakavagga">The Chapter on Wanderers </h2>
    <h2 class="section-title heading" id="mn-rajavagga">The Chapter on Kings </h2>
    <h2 class="section-title heading" id="mn-brahmanavagga">The Chapter on Brahmins </h2>
    <h2 class="section-title heading" id="mn-devadahavagga">The Chapter Beginning With Devadaha </h2>
    <h2 class="section-title heading" id="mn-anupadavagga">The Chapter Beginning with One By One </h2>
    <h2 class="section-title heading" id="mn-sunnatavagga">The Chapter Beginning with Emptiness </h2>
    <h2 class="section-title heading" id="mn-vibhangavagga">The Chapter on Analysis </h2>
    <h2 class="section-title heading" id="mn-salayatanavagga">The Chapter on the Six Senses</h2>
    <article id="mn1">
      <h3 class="sutta-title heading">
        <span class="sutta-heading acronym">MN 1</span>
        <span class="sutta-heading translated-title">The Root of All Things </span>
        <span class="sutta-heading root-title">Mūlapariyāyasutta</span>
      </h3>
      <p id="mn1:1.1"><span class="evam">So I have heard. </span>At one time the Buddha was staying near Ukkaṭṭhā, in the Subhaga Forest at the root of a magnificent sal tree. There the Buddha addressed the mendicants, “Mendicants!” </p>

So yes, Bhante @Sujato, this is a very serious error.

Also I noticed that for the MN and DN you have all of the suttas in a single file. I think we talked about this and you decided that since the epub spec didn’t insist on a maximum file size then it was fine. I know there may be technical considerations on your end, but I’d ask you to reconsider. Even when viewing on my laptop there was a “Loading…” message when trying to open the content. I’ve never seen that in all my years of working with epubs.

3 Likes

For the MN html file, the suttas are listed in the TOC, but only after the chapters:

https://htmlpreview.github.io/?https://raw.githubusercontent.com/suttacentral/editions/main/en/sujato/mn/html/Middle-Discourses-sujato-2023-05-23.html

Thanks for providing some examples.

I agree with the suggestion to break up the suttas into multiple xhtml files. Large files can be particularly problematic on e-ink devices.

3 Likes

If you are having a sutta ebook emergency and need something right away, you can use my book builder:

and copy paste the output to a html text file. Then Calibre can create a proper ebook from it. May need to fiddle with the settings to get a table of contents. Select the “Step down sutta headings” in the app above to get the suttas at <h2> level. Then in the conversion in Calibre you may need to play around a bit.

4 Likes

Wow, thanks for such a nice tool! I have been wanting an epub of Brahmali Bhikkhu’s Vibhanga for a while, and was able to make a usable epub with Pandoc in just a couple of minutes.

Anumodana!

2 Likes

Thanks everyone. The HTML file also has the headings wrong. It’s probably due to a recent DB upgrade, or at least, that’s what caused recent problems with the PDFs. We’re fixing it!

1 Like

Please forgive me if I’m trying to teach you how to suck eggs, but is there a way that a test on the TOC could be written any time the production is updated? I seem to recall another problem where the DN was built backwards.

I’d think that the TOCs are basically static, or static enough that a test would save more time than cost.

Thanks for all your hard work!

3 Likes

I just said exactly the same thing to Hongda! :egg:

4 Likes

I have fixed this bug, check it out when you have time :pray:

4 Likes

So far as I can see, they’re looking good now, sorry about the glitch. Please let us know of any other problems.

2 Likes

Is the DN missing from the editions page?

I am still seeing it…

1 Like

I’m seeing it now too.

1 Like