02-12-2010, 04:52 PM | #1 |
Enthusiast
Posts: 48
Karma: 62
Join Date: Jan 2010
Device: HANLIN V3
|
New to Sigil, frustrated: bad TOC
As a clueless n00b I have been wandering about in Google-land trying to find out how to generate a working TOC for an epub doc. I have a readable epub doc with many sections and chapters and would really like a decent TOC for navigation.
In my wanderings I read that Sigil should recognise the H1 and H2 tags as hierarchical chapter/section markers and generate a correct toc.ncx (I sure wouldn't want to construct one by hand). So I painstakingly edited over 60 .xhtml files by hand to h1-ify and h2-ify the titles of sections and subsections of the book. Ugh. I re-epubbed the dir (many thanks to the MR member who contributed the neat little applescript for zipping up a dir into proper epub format!) and read the resulting epub with Sigil. To my hair-tearing frustration it did not even read the entire document, but stopped after the first section. No error message, nothing. And the TOC of course contains only the structure up to that first section. I'm beginning to have a real hate/hate relationship with Sigil -- it's slow as molasses to respond to text edits and I have not yet seen any way in which it helpfully automates any epub editing task. But maybe I need to get to know it better. In any case -- what causes Sigil to stop reading an epub one section into the doc? Is there any cmd line tool for generating a correct toc.ncx once I have h1 and h2 tags in the xhtml content files? And btw, I introduced "chapter breaks" in Sigil while doing some wysi editing of the book, to get clean page breaks between subsections. Could this be mucking up the TOC recognition? Calibre can read/view this epub in its entirety but with no TOC at all (more hair tearing) -- why does it "see" the doc differently from Sigil? Anyway, I am baffled and discouraged, and looking hopefully for a cmd-line or other tool that will auto-generate toc.ncx from xhtml source, so I don't have to write my own :-) Am I alone in finding Sigil rather opaque, feature-poor, and confusing? (And why is the "Preferences" menu option disabled, while I'm griping?) |
02-12-2010, 05:23 PM | #2 |
The Grand Mouse 高貴的老鼠
Posts: 72,194
Karma: 308792702
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Bear in mind that Sigial is not even in beta yet.
However, it certainly ought to read in all of an ePub. Are you sure all your epub files are declared in the manifest? Sigil is quite strict about only reading files that are actually declared to be in the ePub, not just all the files it finds in there. |
Advert | |
|
02-12-2010, 06:39 PM | #3 | |||||
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Oh boy...
Quote:
You probably hit a bug somewhere. Read this wiki page, then create a new issue on the tracker. Quote:
The editing speed is directly linked to the size of the document loaded in the Book View. So that will be faster in 0.2.0 too. Quote:
Quote:
Quote:
It's written by an overstressed and overworked grad student who doesn't get nowhere near the amount of sleep he should. I'm always open for suggestions, and even more for well-written patches. Because a preferences screen has yet to be created. Again, it's 0.1.9. Bear with me. |
|||||
02-12-2010, 06:42 PM | #4 | |
Enthusiast
Posts: 48
Karma: 62
Join Date: Jan 2010
Device: HANLIN V3
|
Quote:
if "the manifest" = content.opf, then each of the xhtml files is indeed noted as an item in that list. tellya what, is there an epub sanity checker out there that emits diagnostic messages (something like the various html and xml checkers, but for epubs)? maybe that would give me a better clue than Sigil's mute, obstinate refusal to read past the 3rd file or so. point taken though, I should be less hard on Sigil noting that it is pre-beta :-) I'm still trying to figure out what it's good for; Calibre can convert pretty much any of the popular document formats to epub (though the result is sometimes ugly code), and from there on, standard cmd-line tools seem to work as well as Sigil... vim with spellcheck is pretty good for catching OCR errors, for example. I attach the problem epub file in case any kind soul feels like pointing out what I have obviously done wrong... |
|
02-12-2010, 06:49 PM | #5 | |
Enthusiast
Posts: 48
Karma: 62
Join Date: Jan 2010
Device: HANLIN V3
|
Quote:
what I'd really like to know is how toc.ncx gets generated... whether Sigil is supposed to do that based on h1 and h2 tags in the xhtml files, or whether Sigil needs some external agent to generate toc.ncx before it can navigate the toc correctly. I'll prowl the wiki when I have some leisure time and do a little more self-education. anyway, apologies Valloric for griping peevishly about a free app supported by one Lone Stranger. I'll shutupsky and go look at the wiki before I make a bigger fool of myself |
|
Advert | |
|
02-12-2010, 06:49 PM | #6 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
take a look at the incredibly useful epubcheck validator from threepress.org : http://threepress.org/tools/ it will show errors, and there are some explanations on the side of the page. i just ran your epub through it and there's an un-closed H1 tag in your content004.xhtml file (line 13). that could be causing the problem.
sigil is at the very very beginning of its development, but for a completely free, open source, community-feedback-based app developped by "an overstressed and overworked grad student who doesn't get nowhere near the amount of sleep he should" for sheer love of the art (and love of epub, presumably, and maybe some other crazy ideas), i think it's already a pretty amazingly useful app. i suspect if you take a bit of time to see what it can do you'll start to like it a lot too, despite its current shortcomings. it's a completely different beast from calibre, by the way ; calibre is a converter, whereas sigil is an editor. |
02-12-2010, 07:02 PM | #7 | |
Enthusiast
Posts: 48
Karma: 62
Join Date: Jan 2010
Device: HANLIN V3
|
Quote:
java -jar /Users/de/Documents/EPC/epubcheck-1.0.3.jar f AgCiv.epub Epubcheck Version 1.0.3 ERROR: AgCiv.epub/OEBPS/content.opf(9): unfinished element ERROR: AgCiv.epub/OEBPS/text/content004.xhtml(13): unknown element "H1" from namespace "http://www.w3.org/1999/xhtml" ERROR: AgCiv.epub/OEBPS/text/content004.xhtml(13): The element type "H1" must be terminated by the matching end-tag "</H1>". ERROR: AgCiv.epub/OEBPS/text/content004.xhtml: The element type "H1" must be terminated by the matching end-tag "</H1>". Check finished with warnings or errors! hmmm. the strange thing is that there are h1's in content files 000 through 003 which don't raise a flag; and that the h1 tag is, in fact, properly closed by a /h1 tag. now, is epubcheck also broken? or am I missing one of those odd "delayed action" syntax errors ...? |
|
02-12-2010, 07:06 PM | #8 | ||
Enthusiast
Posts: 48
Karma: 62
Join Date: Jan 2010
Device: HANLIN V3
|
Quote:
Quote:
I have a feeling I'm going to feel insanely stupid when I finally realise what it is I'm looking at and not seeing. |
||
02-12-2010, 07:07 PM | #9 | ||
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
One of the benefits of being awake for 24+ hours: you find it hard to get angry.
Quote:
But Sigil currently includes HTML Tidy and runs it on your HTML files before loading them. This usually fixes any problems, but it's not perfect. Quote:
You should really attach that epub file of yours on a new issue on the tracker. The more bug reports I get, the more bug fixes I can implement. EDIT: I see you added it to a post. That's a step in the right direction, but I prefer having it on the tracker. It means I can easily search for it later and watch for regressions. Sadly, there's not much there. User documentation is non-existent. Some have lately offered to write it, but I said to hold off until 0.2.0 ships. I don't want people going through the trouble of writing docs that will become obsolete in about two weeks. |
||
02-12-2010, 07:12 PM | #10 | |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
Quote:
Code:
<H1>Section One: Before Civilization</h1> i see also that you've got a LOT of extraneous code in there (i didn't go far, but in the first paragraph alone i see a few tags that are unnecessary, like when you have this sort of series : <p class="calibre2">< i class="calibre3" >Neandertals did not paint their caves with the images of animals. But perhaps they had no< / i > < i class="calibre3" > [...] (example of unnecessary tags in bold, and since the entire pagraph is in italic you could just have one class on the p tag). those are not drastic problems but they certainly do muck up the code and can make it harder to find the real problems. also, i see you downloaded the tool and used it locally ; i recommend you use the online tool, first because i think there is a more recent version than the one you downloaded (1.5 ? not sure), second because the explanations could be helpful for you. edit : also, i and b tags are deprecated, and should be remplaced by em and strong. not critical for your problem but nonetheless might be worth keeping in mind... |
|
02-12-2010, 07:17 PM | #11 | ||
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
Quote:
|
||
02-12-2010, 07:19 PM | #12 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
But surely Tidy should have caught that... hm, "should have"... Last edited by Valloric; 02-12-2010 at 07:21 PM. |
|
02-12-2010, 07:19 PM | #13 | |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
Quote:
|
|
02-12-2010, 07:20 PM | #14 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
before you panic, i opened that file in dreamweaver to check it, first so i could easily localise the line in question, and second because i know tidy could fix it before i see it. so maybe it's not sigil's fault. although, i guess tidy should have fixed it, when it was opened in sigil previously...
|
02-13-2010, 07:42 AM | #15 | |
The Grand Mouse 高貴的老鼠
Posts: 72,194
Karma: 308792702
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
ERROR: /Users/pdurrant/Desktop/test.epub/OEBPS/content.opf(9): unfinished element ERROR: /Users/pdurrant/Desktop/test.epub/OEBPS/text/content004.xhtml(13): unknown element "H1" from namespace "http://www.w3.org/1999/xhtml" ERROR: /Users/pdurrant/Desktop/test.epub/OEBPS/text/content004.xhtml(13): The element type "H1" must be terminated by the matching end-tag "</H1>". ERROR: /Users/pdurrant/Desktop/test.epub/OEBPS/text/content004.xhtml: The element type "H1" must be terminated by the matching end-tag "</H1>". Check finished with warnings or errors! The unfinished element in content.opf just means some required metadata hasn't been set yet. The unterminated h1 needs fixing. But I seem to see everything in this ePub in Sigil. And what's more, this ePub was saved from Sigil. Could it be you attached the truncated ePub and not the original ePub? The manifest is the section in the content.opf file inside the <manifest> tag, and is a list of all the files in the ePub used in the content of the ePub. Perhaps I'm just not seeing the problem - I just checked that the last bit (Permissions) displayed in Sigil. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC and Index links in Sigil | Bamber | ePub | 10 | 11-11-2010 02:12 PM |
Calibre ePub TOC and Sigil | salasnet | Calibre | 3 | 09-26-2010 05:34 PM |
Sigil Toc editor | Enesco | Sigil | 16 | 09-23-2010 06:41 AM |
sigil and toc | bobcdy | Sigil | 5 | 10-17-2009 04:29 PM |
TOC in Sigil | KindleKid | Sigil | 8 | 08-19-2009 04:30 PM |