View Single Post
Old 12-19-2012, 07:49 PM   #3
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by holdit View Post
It seems that any epub done using epub2 needs to have a guide in the content.opf file
yes. also, one of the entries in the guide needs to have type="text" or type="bodymatter" declared.

Quote:
Originally Posted by holdit View Post
but I then read that any file in Epub3 needs to have a Landmarks code inserted in the toc.ncx
this is incorrect - the toc.ncx is no longer used (although continues to be supported) in epub3. the toc.ncx is going to be exactly like a toc.ncx in an epub2, and you don't need to add to it to make it conform to epub3. your landmarks are going to be inserted somewhere else.

Quote:
Originally Posted by holdit View Post
My question here is this, to distinguish the difference between epub2 and 3 where do I look for the code that will tell me this?
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" ... > as you noticed is one of the ways you can tell immediately.

Quote:
Originally Posted by holdit View Post
So it has to be epub3.
yep.

Quote:
Originally Posted by holdit View Post
can someone show me exactly how to add as the way I did ha\s to be wrong.

if you have the content.opf sorted out and it contains the guide element with at least one reference to the text/bodymatter, ie:

Code:
	<guide>
		<reference href="cover.html" title="Cover" type="cover"/>
		<reference href="page01.html" title="Chapter One" type="text"/>
	</guide>
then you're going to create a new html page that will contain all of the navigation elements (toc, landmarks, etc).

nav.html will look something like this:

Spoiler:
Code:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
	<head>
		<title>
			Navigation
		</title>
	</head>
	<body>
		<nav epub:type="toc">
			<ol>
				<li>
					<a href="cover.html">Cover</a>
				</li>
				<li>
					<a href="page01.html">Chapter One</a>
				</li>
				<li>
					<a href="page02.html">Chapter Two</a>
				</li>
			</ol>
		</nav>
		<nav epub:type="landmarks">
			<h2>
				Landmarks
			</h2>
			<ol>
				<li>
					<a epub:type="cover" href="cover.html">Cover</a>
				</li>
				<li>
					<a epub:type="bodymatter" href="page01.html">Chapter One</a>
				</li>
			</ol>
		</nav>
	</body>
</html>


you'll notice that <nav epub:type="toc"> is epub3's ncx, and <nav epub:type="landmarks"> is basically the guide from the opf.

once you've got that done, you'll need to declare nav.html in the <manifest> in the opf like any other html page, and also assign it the properties="nav":

Code:
<item href="toc.html" id="toc" media-type="application/xhtml+xml" properties="nav"/>
more good times here: http://idpf.org/epub/30/spec/epub30-...-def-types-toc

hope that helps
mzmm is offline   Reply With Quote