05-04-2023, 12:45 PM | #1 |
Member
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 |
05-04-2023, 06:03 PM | #2 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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. |
Advert | |
|
05-04-2023, 06:18 PM | #3 |
Well trained by Cats
Posts: 30,442
Karma: 58055868
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 . |
05-04-2023, 07:34 PM | #4 |
Wizard
Posts: 1,353
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
05-04-2023, 08:09 PM | #5 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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. |
Advert | |
|
05-04-2023, 09:10 PM | #6 |
Grand Sorcerer
Posts: 6,216
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. |
05-04-2023, 09:17 PM | #7 | |
Well trained by Cats
Posts: 30,442
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Another, would be: Headless server. But honestly, don't you want to see (quality inspect) the final products? |
|
05-04-2023, 09:50 PM | #8 | |
Wizard
Posts: 1,353
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
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. |
|
05-05-2023, 04:43 AM | #9 | |
Member
Posts: 11
Karma: 10
Join Date: Oct 2021
Device: none
|
Quote:
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. |
|
Tags |
backward compatibility, cli, ebook-convert, epub3, ncx |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Incorporating NCX file into Epub3 book for backward compatibility | tbrosz | Conversion | 9 | 05-03-2023 12:24 PM |
table of content file link not add in toc.ncx file | bhambhu | Conversion | 0 | 01-14-2016 02:40 AM |
how to set the index of the file using calibre CLI | kindleren | Conversion | 3 | 02-21-2012 10:53 PM |