11-19-2012, 01:27 AM | #1 |
Zealot
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
|
Linked TOC -- code
After some wavering I decided to have a separate TOC-chapter in my book. Also to have it linked. So I borrowed some code from another e-book.
Can anybody see if I did something wrong? (Sigil does not protest.) <?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="../Styles/style.css" rel="stylesheet" type="text/css" /> <title>My book</title> </head> <body xml:lang="SV" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <h1 id="heading_id_2">TOC</h1> <div> <p><a href="../Images/cover.jpg">Cover</a></p> <p><a href="../Text/Title.htm">Title</a></p> <p><a href="../Text/Chapter1.xhtml">Chapter one</a></p> <p><a href="../Text/Chapter2.xhtml">Chapter two</a></p> AND SO ON </div> </body> </html> The original was a bit different, I just removed what I didn´t understand. It began like this: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>A Briefer History of Time</title> <meta name="Adept.resource" value="urn:uuid:381f5f04-b26a-460c-8278-f55cae532600" /> <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" /> <style type="text/css"> /*<![CDATA[*/ @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } /*]]>*/ </style> </head> <body class="calibre"> <div class="calibre1" id="toc"> <p class="fmh">Table of Contents</p> <p class="cfmh"><a href="../Text/Hawk_9780307417848_epub_tp_r1.htm">Title Page</a></p> ETC. |
11-19-2012, 09:38 AM | #2 |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
is the filename 'Chapter1' or 'chapter1' ?
Case will bite you every time BTW If the NCX works, why not Let Sigil (6) generate the HTML TOC? Tool: Table of Contents : ... |
11-20-2012, 01:14 AM | #3 |
Zealot
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
|
Yes, I am careful with case in case something goes very wrong.
Sure, Sigil can generate TOC, but I want an actual chapter/ file of TOC inside the book as well. |
11-20-2012, 03:23 AM | #4 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Sigil can also create an HTML TOC file in your book as well, using the menu Tools -> Table of Contents -> Create HTML Table of Contents as theducks said. You have to re-run it each time you use Generate TOC or modify the toc.ncx file.
|
11-20-2012, 03:24 AM | #5 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@GraciousMe - as theducks said - look at Tools->Table of Contents and you will see a "Create HTML Table of Contents" option that was added for 0.6.
Edit: meme beat me |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linked copy in internal TOC changed to blue upon conversion | PatNY | Conversion | 2 | 05-03-2012 11:31 AM |
Linked endnotes in epub | virtual_ink | ePub | 30 | 08-30-2011 04:47 PM |
Use Regex to Code an Inline TOC, from an External TOC's .ncx File | mostlynovels | ePub | 2 | 03-16-2011 12:15 PM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |
How to create linked TOC? | squawker | Sony Reader | 1 | 03-04-2007 08:20 AM |