Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-03-2020, 09:24 AM   #1
Hayansan
Junior Member
Hayansan began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2019
Device: Kindle
TOC generating problem in Sigil

Without making a new epub,
if you just open an HTML file and then save it as your new epub.
In this case, there is no toc.ncx in your epub.

So if you add some head tags on your document for making a TOC(Table of Contents) and then 'Generate Table of Contents', Sigil crashes. Because there is no toc.ncx file in your epub.

<solution1>
Without making a new epub,
when a user just opens an HTML file and then saves it as his/her new epub,
let Sigil automatically make and add a toc.ncx frame file in the epub.
<solution 2>
When Sigil generates a Table of Contents without the file toc.ncx,
it has to forcefully make toc.ncx file first and then generate TOC.
Hayansan is offline   Reply With Quote
Old 01-03-2020, 09:48 AM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Hayansan View Post
Without making a new epub,
if you just open an HTML file and then save it as your new epub.
In this case, there is no toc.ncx in your epub.
1. What's your operating system and your Sigil version?
2. Were you working on an epub2 or epub3 book?
Doitsu is offline   Reply With Quote
Advert
Old 01-03-2020, 10:15 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
And how did you add the html file to Sigil without it being included into an empty epub that under epub 2 would have a toc.ncx. What are you using to "save this html file as an epub" in the first place. Did you create a valid epub or not?

So you really skipped a lot of steps here on how to make Sigil crash in a repeatable way?
KevinH is offline   Reply With Quote
Old 01-03-2020, 10:56 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Open Sigil to a new, default epub2.
File->Open (change file type to HTML files) then open an html file.
Save epub2 without an ncx.
Generate ToC (click OK for empty ncx)

We really should get rid of the Open HTML Files option. I see no benefit to it over adding an existing xhtml file to a new epub (which has the benefit of actually working correctly).
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 11:48 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Agreed, kill it
KevinH is offline   Reply With Quote
Advert
Old 01-03-2020, 12:09 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Let's check around a bit to be sure. Someone may be using a batch file to automatically open HTML or Text files in Sigil for some reason. I can't see what the advantage might be myself.

I'm also imagining both the Open HTML and the Open Text file options have been broken in this regard for quite some time. Neither would have any logic to let Sigil know if it should be handled as an epub2 or an epub3. Which I believe has been mandatory info for a lot of Sigil's functionality for a few years now.

I just checked and we ARE still registering Sigil as a candidate for opening .htm|.html|.xhtml files with the Windows installer (but not .txt files). Easy enough to remedy, but I just want to make sure we're not overlooking some sort of use-case.

Last edited by DiapDealer; 01-03-2020 at 12:15 PM.
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 12:29 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Hayansan View Post
<solution1>
Without making a new epub,
when a user just opens an HTML file and then saves it as his/her new epub,
let Sigil automatically make and add a toc.ncx frame file in the epub.
<solution 2>
When Sigil generates a Table of Contents without the file toc.ncx,
it has to forcefully make toc.ncx file first and then generate TOC.
<solution3>
Add your existing html file (File->Add->Existing Files) to an empty epub that already has all the correct structure and avoid the whole problem.
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 12:52 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
The only other approach is to take the code used in ImportEPUB.cpp that checks for an ncx and if not present creates one and copy it into ImportHTML.

I will see how doable that is. If easy, we can keep it around, if not easy, we can kill it.Yes txt import should go away.

Doitsu has a wonderful Github variant Markdown import plugin that that would replace any need for txt input.
KevinH is offline   Reply With Quote
Old 01-03-2020, 01:22 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I will see how doable that is. If easy, we can keep it around, if not easy, we can kill it. Yes txt import should go away.
Agreed.
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 01:47 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Ah ... it seems the ImportHTML code can work in two ways, one is to add to an already existing book (and that code is used by AddExisting... so we can not remove it) and the second is to create a book of its own. It is the latter code of this class that has the problems.
KevinH is offline   Reply With Quote
Old 01-03-2020, 01:53 PM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
So as I suspected, this scenario (and probably some others like it) has been broken for some time, no?
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 02:11 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
So as I suspected, this scenario (and probably some others like it) has been broken for some time, no?
Answering my own question: apparently no. It looks like Sigil v1.0.0 is the first release where this is broken.
DiapDealer is online now   Reply With Quote
Old 01-03-2020, 02:12 PM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Okay, just pushed a hopeful "fix" for this to master. I still need to test it but it should do the trick and at least prevent the crash.
KevinH is offline   Reply With Quote
Old 01-03-2020, 02:12 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Actually it broke when we made the NCX optional for epub3 and further broke it in 1.0
KevinH is offline   Reply With Quote
Old 01-03-2020, 02:29 PM   #15
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Can an html5 file be opened as an epub3? So far, All xhtml files I open seem to create epub2s. I'm just wondering if opening an html5 file will result in us being back in the same boat with the nav document in an epub3.
DiapDealer is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Generating Toc DKCrotty Sigil 42 10-03-2016 06:48 AM
Problem generating TOC ronin712 Calibre 11 09-06-2015 11:53 PM
Generating a TOC in Sigil question ralphiedee Sigil 2 12-04-2012 05:42 AM
PROBLEM TOC VALIDATION ERROR IN SIGIL Ibn ePub 7 06-06-2012 03:28 AM
Help generating TOC Diabolikul Conversion 3 01-26-2012 10:42 AM


All times are GMT -4. The time now is 01:18 PM.


MobileRead.com is a privately owned, operated and funded community.