Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 05-04-2023, 11:45 AM   #1
ydonse
Member
ydonse began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Oct 2021
Device: none
Add NCX file in Epub3 with Calibre CLI

Hi everyone !

I've read a few threads that talk about the infamous ncx file. While I managed to generate it for epub 3 in the Calibre toc editor, I need to be able to do it with the command lines.

Since I don't see an obvious solution, I wonder if it might be possible to :

1.Generate an epub2
2. Generate an epub3
3. unzip the epub2
4. unzip the epub3
5. move the ncx file from the epub2 to the epub3 folder
6. convert the folder with the file into a new epub

I see easily how I can do the 5 first parts but I don't know if I can redo an epub after unzipping it.

Cheers everyone
ydonse is offline   Reply With Quote
Old 05-04-2023, 05:03 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
That would not work since the ncx file would not be listed in the epub3 opf file. Adding a file to an ePub container is not a simple drag and drop operation.

At this point, I don't think you can do this easily from the command line from what I can see in ebook-convert's command line options.
DNSB is offline   Reply With Quote
Old 05-04-2023, 05:18 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Why do so many posting here use the CLI?
I might understand a high volume publisher doing this.

But you CAN use the Editor without adding books to a Library and that is the has the full range of tools, which makes this easy .
theducks is offline   Reply With Quote
Old 05-04-2023, 06:34 PM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,094
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
Why do so many posting here use the CLI?
Honestly I wonder the same thing. I never understand this throwback to the 1990's and using CLI.
Must be a Linux thing.
Karellen is offline   Reply With Quote
Old 05-04-2023, 07:09 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Personally, I still have a love for using batch files for simple repetitive tasks that do not require human input. However, I tend to agree that all too many people are still stuck in the I need to use the command line to do every task mindset. OS/8 is no longer a popular operating system.

If nothing else, using Sigil or calibre's editor allows me to run epubcheck instead of waiting to find issues later. I have run epubcheck from a batch file when I was checking a mass of books but that was a special occasion.
DNSB is offline   Reply With Quote
Old 05-04-2023, 08:10 PM   #6
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@ydonse,

If you have any Python skills you could write a small Python script which would process epubs either individually or in bulk. Calibre already contains a lot of utilities specifically written for safe manipulation of epubs.
jackie_w is offline   Reply With Quote
Old 05-04-2023, 08:17 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Karellen View Post
Honestly I wonder the same thing. I never understand this throwback to the 1990's and using CLI.
Must be a Linux thing.
I understand the batch file use. Simple, another format...zippo need for changes.
Another, would be: Headless server. But honestly, don't you want to see (quality inspect) the final products?
theducks is offline   Reply With Quote
Old 05-04-2023, 08:50 PM   #8
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,094
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
But honestly, don't you want to see (quality inspect) the final products?
Yes, definitely.
I imagine a lot of users are more interested in quantity (thousands of books in their library), rather than quality. I can only imagine how badly formatted some of these books are.
We have all seen how bad a lot of the books out in the wild are. For example books where all the paragraph breaks have been stripped out and each chapter is a single paragraph. Ever tried reading one of those? So why would anyone want thousands of books that are barely legible in their library? I wouldn't.
Its like what I see on another forum, where users have tens of thousands of movies and tv shows. You could never watch (or read) that enormous quantity of media.
Karellen is offline   Reply With Quote
Old 05-05-2023, 03:43 AM   #9
ydonse
Member
ydonse began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Oct 2021
Device: none
Quote:
Originally Posted by DNSB View Post
That would not work since the ncx file would not be listed in the epub3 opf file. Adding a file to an ePub container is not a simple drag and drop operation.

At this point, I don't think you can do this easily from the command line from what I can see in ebook-convert's command line options.
That's what i feared, but maybe I can write in the opf file to add the ncx file ?

For all who wonder why I need to use cli instead of editor, it's indeed to treat publisher-like volumes of books. It doesn't prevent me to edit manually a book if needed, but the epub3 with no ncx file is a persistent problem.
ydonse is offline   Reply With Quote
Reply

Tags
backward compatibility, cli, ebook-convert, epub3, ncx


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorporating NCX file into Epub3 book for backward compatibility tbrosz Conversion 9 05-03-2023 11:24 AM
table of content file link not add in toc.ncx file bhambhu Conversion 0 01-14-2016 01:40 AM
how to set the index of the file using calibre CLI kindleren Conversion 3 02-21-2012 09:53 PM


All times are GMT -4. The time now is 12:13 PM.


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