epub 3 no longer support NCX
For navigation NCX is outdated but for backward compatibility it is used in epub or kindle ebook pack.
epub v3.0 recommend inetrnal TOC as NCX for navigation. But for backward compatibility you can put ncx file in OPS directory. For this features you should design TOC by using OL tag. Nested ol tag makes navigation on or off...
<nav epub:type="toc" id="contents">
<h2 class="hcontents">Contents</h2>
<ol>
<li><a href="cover.xhtml">Cover</a></li>
<li><a href="title.xhtml">Title</a></li>
<li><a href="copyright.xhtml">Copyright Page</a></li>
<li><a href="preface.xhtml">Preface</a></li>
<li><a href="forward.xhtml">Foreword</a></li>
<li><a href="part01.xhtml">Part One</a>
<ol>
<li><a href="chap1.xhtml">Chapter One</a></li>
<li><a href="chap2.xhtml">Chapter Two</a></li>
<ol>
<li><a href="chap3.xhtml#sect1">Section One</a></li>
<li><a href="chap3.xhtml#sect2">Section Two</a></li>
</ol>
</li>
</ol></li>
<li><a href="ref.xhtml">References</a></li>
<li><a href="index.xhtml">Index</a></li>
</ol>
</nav>
</body>
</html>
Structure of Internal Table of Contents:
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
xmlns:epub
=
"http://www.idpf.org/2007/ops"
>
<
head
>
<
title
>TOC Example</
title
>
</
head
>
<
body
>
<
section
epub:type
=
"frontmatter toc"
>
<
header
>
<
h1
>Contents</
h1
>
</
header>
<h2 class="hcontents">Contents</h2>
<ol>
<li><a href="cover.xhtml">Cover</a></li>
<li><a href="title.xhtml">Title</a></li>
<li><a href="copyright.xhtml">Copyright Page</a></li>
<li><a href="preface.xhtml">Preface</a></li>
<li><a href="forward.xhtml">Foreword</a></li>
<li><a href="part01.xhtml">Part One</a>
<ol>
<li><a href="chap1.xhtml">Chapter One</a></li>
<li><a href="chap2.xhtml">Chapter Two</a></li>
<ol>
<li><a href="chap3.xhtml#sect1">Section One</a></li>
<li><a href="chap3.xhtml#sect2">Section Two</a></li>
</ol>
</li>
</ol></li>
<li><a href="ref.xhtml">References</a></li>
<li><a href="index.xhtml">Index</a></li>
</ol>
</nav>
</body>
</html>
Update the OPF:
<manifest> <item id="toc" href="contnt.xhtml" media-type="application/xhtml+xml" properties="nav"/> </manifest>Including the TOC in the flow of reading
|
< spine > < itemref idref = "toc" /> < itemref idref = "chapter_001" /> ... </ spine >
|
Comments
Post a Comment