View Single Post
Old 07-06-2012, 06:45 PM   #9
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by JJ Joseph View Post
Thanks, st_albert. This sounds useful. Is the "in-line TOC" simply another html (xml) file in the sequence of xml files that make up my book? I'm guessing that the links between the TOC and the chapters are name attributes or anchors? How do I "identify" this xml file in the <guide> section of the content.opf file (i.e. what is the syntax)?
Yes, you've got it. Suppose the content.opf file is in the /OEBPS directory, and the in-line TOC is in the file /OEBPS/Text/TOC.xhtml

Then the <guide> item would be
Code:
   <reference href="Text/TOC.xhtml" title="Table Of Contents" type="toc" />
and the TOC.xhtml file just contains hyperlinks pointing to the start of the various chapters, or whatever you want in the table of contents. For example, a line in the TOC.xhtml might look like:

Code:
<div><a class="toc-item" href="../Text/Rendlesham07.xhtml">Chapter 3  New, Old Venues</a></div>
Note that in the above case, the chapter 3 starts at the beginning of the Rendlesham07.xhtml file. If you wanted to point to somewhere else in that same file (e.g. for subheadings, whatever) you would use the usual #anchor syntax, as in:

Code:
 href="../Text/Rendlesham07.xhtml#sidebar"
like any hyperlink.

Last edited by st_albert; 07-06-2012 at 06:48 PM. Reason: typo
st_albert is offline   Reply With Quote