View Single Post
Old 04-15-2012, 01:14 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,212
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
ProDigit, what you are trying to do is find shortcuts to do what you want to do when those shortcuts won't work because what you want to remove from toc.ncx are things that HAVE to be there. Why not just leave them be since they HAVE to be there?

Also, why are you so concerned with saving a few bytes here and there? Will any of your readers fail to open the ePub? Nope, they won't. Also, making an internal (page with a lit of links) is not more efficient then a properly made toc.ncx even if the internal ToC is smaller in size.

One way to optimize things (that works) is to remove all the tabs/spaces in front of all the lines.

So instead of having this
Code:
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"
xml:lang="en">
  <head>
    <meta name="dtb:uid"
    content="95e823ba-8f88-4c44-9f9d-b22ff04d5358" />
    <meta name="dtb:depth" content="3" />
    <meta name="dtb:generator" content="calibre" />
    <meta name="dtb:totalPageCount" content="0" />
    <meta name="dtb:maxPageNumber" content="0" />
  </head>
  <docTitle>
    <text>Table of Contents</text>
  </docTitle>
  <navMap>
    <navPoint id="d362620c-c3f8-45e2-8e63-2a62a2757f81"
    playOrder="1">
      <navLabel>
        <text>The Holy Bible</text>
      </navLabel>
you have this
Code:
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"
xml:lang="en">
<head>
<meta name="dtb:uid"
content="95e823ba-8f88-4c44-9f9d-b22ff04d5358" />
<meta name="dtb:depth" content="3" />
<meta name="dtb:generator" content="calibre" />
<meta name="dtb:totalPageCount" content="0" />
<meta name="dtb:maxPageNumber" content="0" />
</head>
<docTitle>
<text>Table of Contents</text>
</docTitle>
<navMap>
<navPoint id="d362620c-c3f8-45e2-8e63-2a62a2757f81" playOrder="1">
<navLabel>
<text>The Holy Bible</text>
</navLabel>
You could also shorten the id as long as the id is unique.
JSWolf is offline   Reply With Quote