
: Sub-chapters based on h2 tags in ePub file 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
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
More posts by @Bryan

: Is it possible to create a sidebar in a reflowable EPUB3? Is there a way to create a responsive sidebar in EPUB3, for example there would be a sidebar in tablet view but if the EPUB was

: What design patterns exist for responsive web design of ebooks? What design patterns, best practice etc. exist for responsive web design of ebooks? I am creating an ebook with HTML5/CSS3/JavaScript
1 Comments
Sorted by latest first Latest Oldest Best
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