Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2023, 06:58 AM   #1
WV-Mike
Connoisseur
WV-Mike began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jul 2023
Device: None
Removing all TOC info and generating a new TOC

Greetings,
How do I remove all TOC tags from all files?

Such as:
<h3 id="sigil_toc_id_15">text</h3>

I would like to remove all TOC info and generate a new TOC.

Thanks,
WV-Mike
WV-Mike is offline   Reply With Quote
Old 09-06-2023, 08:30 AM   #2
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: 27,610
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Generating a new toc WILL remove any unnecessary toc ids and add any necessary new ones. There is no need to remove them all first before regenerating.
DiapDealer is offline   Reply With Quote
Advert
Old 09-06-2023, 10:02 AM   #3
WV-Mike
Connoisseur
WV-Mike began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jul 2023
Device: None
Quote:
Originally Posted by DiapDealer View Post
Generating a new toc WILL remove any unnecessary toc ids and add any necessary new ones. There is no need to remove them all first before regenerating.
I wish to remove the current TOC.
Thanks,
WV-Mike
WV-Mike is offline   Reply With Quote
Old 09-06-2023, 10:11 AM   #4
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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
What kind of toc? Are you talking about an epub3 nav or an epub2 ncx? If so those are required elements. An simple html toc can be deleted by deleting that particular file.

Otherwise recreating/regenerating it will replace it contents.
KevinH is offline   Reply With Quote
Old 09-06-2023, 10:15 AM   #5
WV-Mike
Connoisseur
WV-Mike began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jul 2023
Device: None
Quote:
Originally Posted by KevinH View Post
What kind of toc? Are you talking about an epub3 nav or an epub2 ncx?
It is an epub2 ncx.
I have tried repeatedly to delete the contents of the TOC but every time I try that Sigil crashes.

Thanks,
-mb
WV-Mike is offline   Reply With Quote
Advert
Old 09-06-2023, 10:20 AM   #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: 27,610
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by WV-Mike View Post
I wish to remove the current TOC.
Thanks,
WV-Mike
You also said you wished to regenerate a new ToC. As I said, removing the old one is not necessary before generating a new one with the automated tools. A newly generated Toc will need those ids as well.

If you wish to manually create your own toc, with your own ids, for some reason, there is no automated way to remove the old ids. You'll need to do that manually with some sort of regex and Find & Replace or something.
DiapDealer is offline   Reply With Quote
Old 09-06-2023, 11:32 AM   #7
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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
You can not delete the ncx in an epub2. It is required by the spec. How did you try to delete it? What exactly were you doing when Sigil crashed? I would like to prevent the crash from happening.
KevinH is offline   Reply With Quote
Old 09-06-2023, 11:34 AM   #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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
Did you try editing the NCX in CodeView by chance?
KevinH is offline   Reply With Quote
Old 09-06-2023, 12:27 PM   #9
WV-Mike
Connoisseur
WV-Mike began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jul 2023
Device: None
Quote:
Originally Posted by KevinH View Post
You can not delete the ncx in an epub2. It is required by the spec. How did you try to delete it? What exactly were you doing when Sigil crashed? I would like to prevent the crash from happening.
I was trying to manually delete the nxx contents.
WV-Mike
WV-Mike is offline   Reply With Quote
Old 09-06-2023, 12:27 PM   #10
WV-Mike
Connoisseur
WV-Mike began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jul 2023
Device: None
Quote:
Originally Posted by DiapDealer View Post
You also said you wished to regenerate a new ToC. As I said, removing the old one is not necessary before generating a new one with the automated tools. A newly generated Toc will need those ids as well.

If you wish to manually create your own toc, with your own ids, for some reason, there is no automated way to remove the old ids. You'll need to do that manually with some sort of regex and Find & Replace or something.
OK.
Thanks,
WV-Mike
WV-Mike is offline   Reply With Quote
Old 09-06-2023, 12:53 PM   #11
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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by WV-Mike View Post
I was trying to manually delete the nxx contents.
WV-Mike
How? By remving the file from the unzipped epub? ByRight Clicking on the ncx file in Sigil's BookBrowser and selecting delete? Or by opening the NCX in CodeView and manually selecting and deleting all content?

OnceI know what you did to cause the crash I can try to prevent the crash from happening at all.
KevinH is offline   Reply With Quote
Old 09-06-2023, 01:54 PM   #12
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Test:
* New EPUB2
* Insert <h1>test</h1>
* Create TOC
* Open NCX file in Code View
* Select all content and delete it

Result: crash
BeckyEbook is offline   Reply With Quote
Old 09-06-2023, 02:06 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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
@BeckyEbook Thanks. That was what I needed to know to start to track that one down.
KevinH is offline   Reply With Quote
Old 09-06-2023, 02:44 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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
I just tried this with 2.0.1 and it crashes. I tried it with Sigil-1.9.30 and the crash is successfully caught but I still get:

Sigil has encountered a problem.
Sigil may need to close.

Error info: std::exception
Sigil version: 1.9.30
Runtime Qt: 5.12.9
Compiled Qt: 5.12.9
System: macOS 13.5
Architecture: x86_64

So this is not a new bug. No one should be manually deleting the required ncx. I am tempted to prevent the ncx from being hand edited in CodeView at all, but some people do like to tweak things by hand.

I will need to see what if anything can be done.
KevinH is offline   Reply With Quote
Old 09-06-2023, 02:52 PM   #15
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: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
And it seems very resilient in that as long as it finds the ncx opening tag it will not crash.

I will try to precheck the string for the ncx opening tag and if not present add it.
That should prevent the crash.
KevinH is offline   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
calibre not generating toc nsfwaa2 Conversion 4 09-18-2016 02:55 AM
p.Heading3 is ignored when generating ToC? Panel Calibre 2 03-28-2016 05:52 AM
Generating HTML ToC Katsunami Editor 5 02-12-2014 03:02 PM
Help generating TOC Diabolikul Conversion 3 01-26-2012 10:42 AM


All times are GMT -4. The time now is 07:03 PM.


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