![]() |
#1 |
Junior Member
![]() 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 ![]() <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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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). ![]() |
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Agreed, kill it
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. ![]() |
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#10 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#14 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |