MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   Release : New Tool to Edit ePubs TOC, Edit with Sigil and keep you TOC (https://www.mobileread.com/forums/showthread.php?t=117809)

GeneS 02-01-2011 01:41 PM

1 Attachment(s)
Thanks, Nigol, for the update. And thank you, Nick, for the excellent rendition of "Lorna Doone."

It's apparent to me that I'm doing something wrong. I can use epubfixer to create a new TOC and save the file ... works beautifully. However if I make any subsequent modification to the text itself (using epubfixer or not) , and then save the modified file, the new TOC no longer works. Depending on how I've done the modifications, either my changed TOC disappears or if it is still there, clicking on a TOC entry results in incorrect results or an error message.

If I re-edit to Nick's new version of "Lorna Doone," the results are fine.

I've attached my epubfixer fixed version of a Project Gutenburg epub book by Thornton Burgess. Perhaps someone out there can tell me what I'm overlooking.
Thanks for any help.

Gene

nrapallo 02-01-2011 02:36 PM

1 Attachment(s)
Ok, I duplicated the first chapter name and renamed it "Chapters".

I then moved all the chapters titles listed on the TOC Editor screen onto this newly created level1 TOC entry (Chapters) thus creating level2 TOC entries for all those chapters.

I clicked Save and it works!

Try to do the same and compare to the one I've attached below.

Oh, one more change I made was to delete the empty paragraph block [<p>&nbsp;</p>] in "content0001.xhtml" so that the cover image displayed better in (windows) ADE. ;)

GeneS 02-01-2011 03:09 PM

1 Attachment(s)
Thanks, Nick.

I loaded the file you created into epubfixer, having checked 'Edit in Sigil' and 'Edit Table of Contents.'

Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil. When Sigil closed, the TOC came up in epubfixer. I applied and saved, then exited from epubfixer.

The attached file is the result and an example of what I'm referring to. The modified TOC is shown when I call up the file (I use the epub plugin in Firefox) but no longer points where it should.

Thanks.

Further edit: As long as I don't change the file structure, I can fix this by saving the toc.ncx file from the epub before I start and then replace it back into the modified file when I'm done, however I was hoping that this would be done as a part of the epubfixer process.

Nigol 02-01-2011 04:00 PM

Quote:

Originally Posted by GeneS (Post 1371743)
Thanks, Nick.

I loaded the file you created into epubfixer, having checked 'Edit in Sigil' and 'Edit Table of Contents.'

Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil. When Sigil closed, the TOC came up in epubfixer. I applied and saved, then exited from epubfixer.

The attached file is the result and an example of what I'm referring to. The modified TOC is shown when I call up the file (I use the epub plugin in Firefox) but no longer points where it should.

Thanks.

Please note that the text is in red (that is no good) only the anchor remains. I thought I had fixed that bug. I will check with your provided file.

nrapallo 02-01-2011 04:01 PM

Quote:

Originally Posted by GeneS (Post 1371523)
However if I make any subsequent modification to the text itself (using epubfixer or not), and then save the modified file, the new TOC no longer works.

Oh, I originally missed the part in bold above. I didn't modify the text with Sigil or otherwise. I hand edited with winrar and a text editor my deletion of the cover page's empty paragraph block. I didn't try the below with my version above. :o

Quote:

Originally Posted by GeneS (Post 1371743)
Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil.


Nigol 02-01-2011 04:21 PM

I just uploaded the Fix, it was so Stupid, I don't even know why it worked in the first place.

Sigil usually puts the text file in OEBPS/Text/content0001.xhtml, well I was looking for the filename in the manifest (to know where it is now). But instead of using a "/", I used a \ to separate the path from the filename.

I just hope that I did not break something else, so please let me know.

Update : It has nothing to do with the / (although that fixes it partially). It is only because your original file was in the folder "text" (look at the case), But sigil renamed it to "Text". Those are little things that you just can't think about, and you help me find them.

GeneS 02-01-2011 04:44 PM

Quote:

Originally Posted by Nigol (Post 1371868)
I just uploaded the Fix, it was so Stupid, I don't even know why it worked in the first place.

Sigil usually puts the text file in OEBPS/Text/content0001.xhtml, well I was looking for the filename in the manifest (to know where it is now). But instead of using a "/", I used a \.

I just hope that I did not break something else, so please let me know.


BINGO!!!
:thumbsup:
Works like a charm. Thanks for your work on this.

Nigol 02-01-2011 04:53 PM

Quote:

Originally Posted by GeneS (Post 1371924)
BINGO!!!
:thumbsup:
Works like a charm. Thanks for your work on this.

Just look at the update I posted, to just to let you Know the real reason, it was only because of text instead of Text.

nrapallo 02-01-2011 06:13 PM

1 Attachment(s)
OK, some personal comments/suggestions on the latest versions.....
  • In the Add screen you "remember" the setting for Show All and Show Anchors even after the program is closed. Personally, I would think those settings should be reset each time the programs starts, but not when the Add screen is opened/closed/re-opened while editing the same file. What do you think?
  • I know this may seem nit-picking, but while in the TOC Editor screen, the Add option perhaps should not be a right-menu option since it doesn't act on anything selected. I think, it would be better suited as an Add button on the TOC Editor screen. :dunno:
  • Can you consider assigning ePubFixer generated "id"s to all "href"s that don't have an existing "id". This way you can easily add "back links" to any hyperlink. For example, HarryT's "Pictures from Italy.epub" cannot be easily edited to add such "back links" to footnotes [1] and [2] (see attached image) as can my earlier "Lorna Doone.epub" modification. Any suggestions?
    EDIT: Perhaps just editing with Sigil to add such anchors would be easier.
Keep up the great work!

Nigol 02-01-2011 07:38 PM

I see that you have edited your post, you must have found the Check Version into the Setting Menu..:chinscratch:


Quote:

Originally Posted by nrapallo (Post 1372114)
OK, some personal comments/suggestions on the latest versions.....
[*]In the Add screen you "remember" the setting for Show All and Show Anchors even after the program is closed. Personally, I would think those settings should be reset each time the programs starts, but not when the Add screen is opened/closed/re-opened while editing the same file. What do you think?

I can agree with the Show All, but I kind of like the Show Anchors Always on. Maybe Add a Setting that could be selected what kind of settings you want to keep?

Quote:

Originally Posted by nrapallo (Post 1372114)
[*]I know this may seem nit-picking, but while in the TOC Editor screen, the Add option perhaps should not be a right-menu option since it doesn't act on anything selected. I think, it would be better suited as an Add button on the TOC Editor screen. :dunno:

A toolbar could be done, to have the same settings as the context menu. I will have to go hunting for suitable icons.

Quote:

Originally Posted by nrapallo (Post 1372114)
[*]Can you consider assigning ePubFixer generated "id"s to all "href"s that don't have an existing "id". This way you can easily add "back links" to any hyperlink. For example, HarryT's "Pictures from Italy.epub" cannot be easily edited to add such "back links" to footnotes [1] and [2] (see attached image) as can my earlier "Lorna Doone.epub" modification. Any suggestions?

I kind of understand what you want. But not sure. You want to be able to go to a footnote and go back to the original text. But unlike your previous file (where there was a Anchor for the footnote in the original file, this one does not have it). But what I can't understand is how you want me to fix this?

The program just gets all the id's in the html file, there is no editing of the html file being done, so like you said it might be easier to add them in sigil, because I do not think that adding id's to the html will do a good job. And just searching for the same text will add a lot of possible junk. But maybe I misunderstand what you are talking about.

The html parser I use does not really like nested tags and can very easily screw up the file (there are weird types of file, where calibre adds it's own tags, sigil adds it own, etc.) And for every tag added it considers it a separate line, so duplicating text etc. That is why I used HTML Tidy for the new split chapter function, to have it better formatted and "manually" selected the text, but it is so slow.

nrapallo 02-01-2011 09:34 PM

Quote:

Originally Posted by Nigol (Post 1372285)
I see that you have edited your post, you must have found the Check Version into the Setting Menu..:chinscratch:

Yeah, I noticed it in v1.3.2 and then edited my post. You must have implemented that "under the radar" ... :whistle:

Quote:

I can agree with the Show All, but I kind of like the Show Anchors Always on. Maybe Add a Setting that could be selected what kind of settings you want to keep?
I do like that too; I just didn't need the Show All selected every time. I'm fine with just Show Anchor being remember, no need for a setting/option. :)

Quote:

A toolbar could be done, to have the same settings as the context menu. I will have to go hunting for suitable icons.
I wouldn't go that far. Any button (like your Go or Save button) would do. I just would like immediate access to it, not through a right-menu click. I know, real nit-picking... :grin2:

Quote:

I kind of understand what you want. But not sure. You want to be able to go to a footnote and go back to the original text. But unlike your previous file (where there was a Anchor for the footnote in the original file, this one does not have it). But what I can't understand is how you want me to fix this?

The program just gets all the id's in the html file, there is no editing of the html file being done, so like you said it might be easier to add them in sigil, because I do not think that adding id's to the html will do a good job. And just searching for the same text will add a lot of possible junk. But maybe I misunderstand what you are talking about.
Yes, that's exactly what I had in mind, however, I didn't realize that you would THEN need to write that "id" back into the text. This is not ideal, given Sigil accomplishes that task much better.

Quote:

The html parser I use does not really like nested tags and can very easily screw up the file (there are weird types of file, where calibre adds it's own tags, sigil adds it own, etc.) And for every tag added it considers it a separate line, so duplicating text etc. That is why I used HTML Tidy for the new split chapter function, to have it better formatted and "manually" selected the text, but it is so slow.
:eek: OK, just forget I mentioned it.... ;)

Nigol 02-01-2011 09:42 PM

Quote:

Originally Posted by nrapallo (Post 1372494)
Yeah, I noticed it in v1.3.2 and then edited my post. You must have implemented that "under the radar" ... :whistle:

Nope it was there all along in 1.3. I might have to do youtube video or something.

And I wanted people to know (I forgot to re-write it in the readme). That with the Split Chapters, clicking Apply will split the chapters and show the new TOC (also updates the opf file) but not save the TOC (so you can see the new source, if it was split ok etc.) so clicking close will seriously screw the whole thing. So maybe just remove that apply button.

And since there are no urgent need for fixing, I will probably do a new update when there are more important features to add, other than simple annoyance fix.

With the new Tidy dll being used, anyone might like a Tidy Files functions? Or since it is already there in Sigil, it might not be needed. Any other thing that people will like? I usually just add features, as I convert some books and find some problem I cannot fix, but right now I found it pretty much does all I need.

I am thinking of fixing some of the detected text, because the html parser looks like it is missing some things, but other than that... I don't know (other than your suggestions).

nrapallo 02-02-2011 12:01 AM

:whistle: While you're waiting for comments on new features, do you mind revisiting my issue below:

Quote:

Originally Posted by nrapallo (Post 1361875)
Troubleshooting: If you open my Websters Dictionary 1913_ver21.epub, in the Add screen, the filename is truncated after the third hyphen and I can't tell which filename is being shown (they all look the same)

WARNING: It'll take a loooong time to open the Add screen on that one... :rolleyes:

Thanks!

konrad 02-02-2011 09:34 AM

ePub Fixer not working
 
:help: Hello ,Nigol
Just downloaded Epub fixer and tried both ways of using (send to and open with), but nothing happens. No program appears, just the hourglass cursor for a second and then nothing happens.Is there something else I need to do or some system requirement that needs to be met . I am running Windows XP home SP2 1gig memory. Please help. Thank you.

Nigol 02-02-2011 09:51 AM

Quote:

Originally Posted by konrad (Post 1373309)
:help: Hello ,Nigol
Just downloaded Epub fixer and tried both ways of using (send to and open with), but nothing happens. No program appears, just the hourglass cursor for a second and then nothing happens.Is there something else I need to do or some system requirement that needs to be met . I am running Windows XP home SP2 1gig memory. Please help. Thank you.

No there is nothing special to it. But you could always just open the exe and select choose files. If it does not start make sure that you have the .NET framework 3.5 (SP1) installed, has it does not come pre-installed on XP.


All times are GMT -4. The time now is 10:04 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.