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 ?