View Single Post
Old 05-31-2018, 01:32 PM   #8
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
I will push this change to master to prevent any crash.
Can't wait!

Thanks for hunting down the bug and the quick fix.

I wonder if there are any other related case-sensitive bugs lurking in there?

What if an external program created an EPUB that gets loaded into Sigil, and it has both Copyright.xhtml + copyright.xhtml?

I forget, do the EPUB specs specify filenames being case-sensitive?

Quote:
Originally Posted by JustinThought View Post
Kinda getting off topic here, though. This maybe would be more appropriate in the workshop forum. But maybe this'll help you avoid some of those issues.
This is also why I like discussing different workflows. We all have weird little quirks or ways we use the program that wasn't originally intended.

But it's how we all get better at making books and make Sigil better overall.

I'm pretty excited because I recently brought a completely new Sigil user aboard. And she's looking at the program with completely fresh eyes.

When she caused Sigil to crash because of this capitalization bug, I was thinking: "Eh? It's been stable for so long. What did you do wrong?"

Sometimes when we've been using the programs for so long, we get used to doing it way A or using workarounds XYZ, and become completely blind to way B.

Quote:
Originally Posted by KevinH View Post
Replacing multiple possibly linked in html can result in lost footnotes, orphan images, orphan multi-media. Using global rename on the old ePub in Sigil before merging should also work.
But that should be up to the user.

I imagine it being like a Save As prompt:

You get a popup: "That filename already exists. Are you sure you want to overwrite?" Yes.

Where the current functionality is like: "That filename already exists." And the only choice is to say "Yes, I know. Yes, I know" over and over and over again until it goes away.

Global Rename is also not the best of solutions. Imagine a book full of filenames like this (HTML articles pulled from a site):

- titlepage.html
- copyright.html
- The Guatemalan Economic Miracle and the Man Who Helped It Happen.html
- Adam Heydel, A Mises Student From Poland.html
- A Chinese Gentleman and the Conscience of a Generation.html
- [...]

They are already organized in a certain chapter order in the current EPUB.

Case A

You are trying to replace with alternate versions.

If you were able to just Add Existing + be able to overwrite, this would be no problem. And the chapter order stays completely in tact.

(You could also Skip All and retain current functionality.)

Case B (KevinH)

If you mass rename the files in the current EPUB, you completely lose the information of the filenames:

- titlepage.html
- copyright.html
- Chapter01.html
- Chapter02.html
- Chapter03.html

(or you can manually rename each file individually to TRY to keep a similar name [appending "-2" to the end]. The more files there are, the more time this takes.)

Now when you add the new files:

- titlepage.html
- copyright.html
- Chapter01.html
- Chapter02.html
- Chapter03.html
- A Chinese Gentleman and the Conscience of a Generation.html
- Adam Heydel, A Mises Student From Poland.html
- The Guatemalan Economic Miracle and the Man Who Helped It Happen.html

Now you have to drag/drop the new chapters into their old positions, and/or figure out "Chapter02.html" <-> "Adam Heydel, A Mises Student From Poland.html". Then delete the "Chapter02.html" file.

The more files there are, the more of a pain point this becomes.

Case C (JustinThought)

New EPUB. Insert new files.

I sometimes do this too, but the biggest disadvantage is you lose the order of the chapters.

When you add in files, it inserts them all alphabetically, so you might get something like this:

- A Chinese Gentleman and the Conscience of a Generation.html
- Adam Heydel, A Mises Student From Poland.html
- copyright.html
- The Guatemalan Economic Miracle and the Man Who Helped It Happen.html
- titlepage.html
- [...]

Now you have to manually move the chapters around again.

Case D/E

I know I know, this is getting in the weeds, but there are two other potential workarounds:
  • Just open up the EPUB as a ZIP and shove the new files in.
    • I've been known to do this sometimes. But as a non-technical/new-to-Sigil user? There's no way you want them doing this.
  • Create new EPUB, shove all new files in, copy/paste old content.opf into new content.opf. Hope everything goes according to plan. :P

ORRRRRRRRRRRRRRRR we could just go with the genius that is Case A.

Last edited by Tex2002ans; 05-31-2018 at 01:35 PM.
Tex2002ans is offline   Reply With Quote