bell notificationshomepageloginedit profileclubsdmBox

10.01% popularity   0 Reactions

I have an ePub file that I generate in which I have chapters and sub-chapters.

I found here an example of how to create sub-chapters in the ncx file.

I quote here the answer of @macjohn

<meta content="2" name="dtb:depth"/>
<navPoint class="chapter" id="chapter1" playOrder="1">
<navLabel><text>Chapter 1</text></navLabel>
<content src="file1.xhtml"/>

<navPoint class="subchapter" id="sub1" playOrder="2">
<navLabel><text>Subchapter 1</text></navLabel>
<content src="file2.xhtml"/>
</navPoint>
</navPoint>

The thing is that in my case the chapters are in xhtml files, but the sub-chapters are just within <h2> </h2> tags in the xhtml files of the chapters.

So my question is, how can I add sub-chapters in the ncx file based on the h2 tags and not on an external file ?


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (1)

Login to follow story

More posts by @Bryan

1 Comments

Sorted by latest first Latest Oldest Best

 

@Steve

10% popularity   0 Reactions

Calibre editor has a graphical interface that lets you edit the ToC of a given ebook file (the ToC editor itself is accesible also from the default window, without the need to open the full editor).

You can select different ways to create the ToC, I think that in your case you should experiment by selecting "major headings" or "all headings".


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

Back to top