Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (44 sloc) 1.58 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<!--
*** THIS FILE IS AUTOMATICALLY GENERATED *** from .ncx.erb!
For a detailed description of NCX usage please refer to:
http://www.idpf.org/2007/opf/OPF_2.0_final_spec.html#Section2.4.1
-->
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en-US">
<head>
<meta name="dtb:uid" content="BookId"/>
<meta name="dtb:depth" content="2"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head>
<docTitle>
<text> <!-- ::EDITME:: -->
Your Title Here
</text>
</docTitle>
<docAuthor><text> <!-- ::EDITME:: -->
Authors Here
</text></docAuthor>
<navMap>
<!-- The following creates NCX navPoints from the Chapter headings in your
LaTeX-generated table of contents.
-->
<% root = 'book_mobi' %> <!-- base filename of your main .tex file -->
<% counter = 0 %>
<% File.open("#{root}.4tc").each do |line| %>
<% if (line =~ /^\\doTocEntry\\toc(like)?chapter\{([0-9]*)\}.+\{(x1-[\w\d.]+)\}\{[^\}]+\}\{([^\}]+)\}\}/ ) %>
<% num,link,name = $2,$3,$4 %>
<% sanitize_name = name.gsub(/\W/, '_') %>
<% counter += 1 %>
<navPoint class="chapter" id="<%= sanitize_name %>" playOrder="<%= counter %>">
<navLabel>
<text><%= num %> <%= name %></text>
</navLabel>
<content src="<%= root %>.html#<%= link %>"/>
</navPoint>
<% end %>
<% end %>
</navMap>
</ncx>