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)

Nigol 01-21-2011 11:45 PM

Release : New Tool to Edit ePubs TOC, Edit with Sigil and keep your TOC
 
1 Attachment(s)
-------------------------------------------
Functionality
-------------------------------------------

The best way to use it is to add it to your Open With dialog (note that with multiple files selected, there seems to be a bug in windows that just opens the first book. But multiple Open With has been removed from Windows 7, or just put a link in the send to folder).

You can use the Open With plugin to easily open your file from calibre.

Table of Content Editor
  • Reorder chapters, nest chapters inside others chapter / book and create a multi-level Table of Content by dragging and dropping.
    • When dragging look for the black line to know where your chapters will be.
    • Drag a chapter on an other one until the destination chapter is all black, this will nest the chapters inside each other.
  • Remove unwanted entries, Add new ones based on files or Anchor already present in the files. The Add window will present you with a list of the top 5 lines inside the files (or inclosed with the Anchor Tags) for the Chapter Name.
    • You can also download chapters from the site kobobooks, when there is no suitable text found.
    • Clicking the Add button will add new entries at the bottom, right clicking will add the chapters below the chosen chapters).
    • You can also drag & drop files from the Add windows inside the Table of Content.
  • You can Mass Rename chapters by just typing a number when selecting the chapters, the will increment automatically.
    • You can also Convert number to Words (ie 1 --> One), It also works with Roman Numerals.
    • You can also use the special tag "%T", that will keep the previous text. (ex : You have a Chapter Named : Atlantis, Typing 1 - %T will change the name to 1 - Atlantis). Also if you have a Chapter 1 entry you can just type %T and Number To Words and it will change it to Chapter One.
  • Change the case of the chapters.
  • You can shift the source of chapters up or down (It will Remove any Anchors, pointing to the top of the page).
  • The program can cut your chapter to separate files, instead of multiple chapters per file.
  • Delete files from your book along with any associated entries in the OPF file. (Look in the Add windows).
  • Create an inline TOC from your Table of content.
    • This will check the guide portion of the opf for the "toc" item, and replace it with your new Content file. If this does not exist it will create one at the end, where you can place it where you want.
    • If you want to edit an existing one, you can use the Add window and the Set as Table of Content command, this will set the file and tell the program to replace this file. Or you can use Sigil and the "Add Semantic" button and Table of Content.


Reading Order Editor
  • Have you ever opened a book to find out the first page is at the end? You can reorder the order of the book pages or just remove some.
  • Using this will also remove any "linear" tags inside the books that makes some chapters appear at the end.
  • This will also recreate the file when there is no reference to you toc inside it, which makes some Table of Content unusable. (A message will popup tell you if it is the case.

Margin Fixer
  • This will change all the left and right margins value of the css file, while keeping the body tag to 5pt. It will also change any indent that are negative to 0 (Be careful because some books use margins, instead of indent and it could remove them).
  • An option in the setting menu will let you remove margins instead of zeroing them, usefull with the Kobo Touch when margins can not the modified in book. Use this to remove them and it will remove all margins from the body style.


Edit in Sigil
  • Sigil is great to cut chapters, Format the text or to correct some incorrectly cut files, but it is missing a very important function (at least before version v0.4 comes out). It does not keep the Table of Content that is already present. Using this the book will be opened with Sigil, and when closed (be sure to save the file at the same place) it will replace it with your old Table of Content, Updating the new files location. If you delete or add new Files be sure to also run the table of Content & Reading Order Editor after it. It will check for any files that are missing when opening and remove them, so just open it and save it again to remove entries.
  • You can also use any external exe, it will work also.

Cover Editor
  • Change the Cover without having to reconvert your file (Like calibre does)(Note that using this will convert your covers to SVG).
    • There is also a from folder button that will take the cover.jpg file that is next to the ePub (useful with calibre, where you can download a new cover, and change it by clicking from folder)
  • Resize the Cover so that it fits the screen of your eReader.
    • Note that this has been tested on the Kobo Touch, it resizes the cover in a way that will have the Kobo created a cover without borders, but it might look weird in other viewer like calibre, etc (because it forces a Screen of 800 X 600)
    • Update all will use the selected settings for all the book that where selected, useful too update multiple covers at once.
    • Note that if the Cover is not explicitly set inside the opf file, it will use the first file in the book. (You can set it in the Add window)

-------------------------------------------
Requirement
  • .NET Framework 3.5 or 4.
  • Mono for Linux & MacOSX (some feature might not work correctly like the preview)
    • For linux make sure "mono-runtime" & "libmono-winforms2.0-cil" are installed
    • Not tested on MacOSX, but it should work
    • Also make sure that the libtidy library is installed (should be by default.

Code:

   
    //Usage for Linux
    mono ePubFixer.exe


http://epubfixer.googlecode.com/files/MainWindow.jpg
http://epubfixer.googlecode.com/files/TOCEditor.jpg
http://epubfixer.googlecode.com/files/CoverEditor.jpg
http://epubfixer.googlecode.com/files/TOCinLinux.jpg


Here is the page for any future release http://code.google.com/p/epubfixer/

Changelog :
v1.5.3
- In the Cover Editor, unchecking the preserve Aspect Ratio box will revert to previous behavior of setting the SVG to "none" instead "MidXMidY meet".
- Added a menu in the Cover Editor to select the desired aspect ratio that the image will be resized.
- Fixed some issues with Mono / Linux. (Crash with Fix Margins, Preview working, Path issues, Recent Files working)
- Fixed some setting not being remembered or saved in the wrong place.
- Changed the way the Recent Files are stored in the settings.
- Clicking Rename will have the text selected in the Rename tool.
- The Keep Aspect Ratio checkbox inside of the Cover Editor will now be remembered.
- When Saving a cover you will be warned if the cover has a value of linear="no" (Putting the cover at the end of the book).
- Fixed a Memory problem where using the Mass Update in the Cover Editor would eat up all the memory and crash.
- Covers will have a maximum height of 1600 when resizing them (having them not Preserve the Aspect Ratio),
because very high resolution images are sometimes not processed on some readers.
- Removed the Download button from the Add window, since Table of Contents are no longer available on the Kobobooks website.

v1.5.2
- LibTidy didn't work on 64bit systems, the app will now be 32bit even on 64bit systems.
- Added a confirmation box to replace the Inline TOC before doing so.
- Removed Edit HTML Only from Cover Editor, and will make the cover fit to the window, instead of forcing to a 600 x 800 window.
- The id of a Created Inline TOC will be the filename instead of a GUID.
- Added a fix for some files that sigil 0.4.2 can't open, because of a badly formed content.opf file. Opening Sigil or Saving the file through ePubFixer will fix them.
- Bundled a DLL that was required for the libtidy.dll file that is part of Visual C++ Runtime, that if missing from the computer would crash ePubFixer.

v1.5.1
- A book would crash when doing certain thing when there was no guide in the opf.

v1.5.0
- Added a Select All option inthe context menu of the Add window. It will select all the nodes that are expanded.
- Added the Cover Editor to edit the cover without the need to reconvert with calibre. (look in the readme for additional info).
- Added an option to create an Inline Table of Content (look in the readme for additional info).
- Added an option in the setting menu will let you remove margins in the body Style instead of zeroing them. (usefull with the Kobo Touch when margins can not the modified in book.)
- Added support when only .NET 4 was installed (only XP computers, since other already have .NET 3.5 preinstalled)
- Support when Sigil encodes filenames like URLs, they will now be decoded.
- You can set the type of file (Cover & Table of Content) in the Add windows, this is used with the Inline TOC & Cover Editor.
- Deleting a file did not delete the actual file in the Zip. Also it also removes the info in the guide.
- Plenty of Other fix.

v1.4.1
Added support when filenames with spaces were changed to special character (ex: %20). It happens usually with Sigil 4.

v1.4.0
- Using SendTo will Save the most recent files
- Opening a file that does not exists anymore will not crash the program and a message will warn you.
- Added a Delete Files in the Add screen (it will remove the selected files from the ePub and delete entries from the manifest & spine)
- Fixed a bug with Mass Rename if the entry selected had different "parents".
- Fixed a crash if a file was in the spine, but not the manifest.
- Added a kind of a HACK to force files with XML version v1.1 to be parsed.
- If multiple css file are present, It will now (hopefully) select the correct one.
- The CSS tag being for margins is now determined by the first class attribute seen (previously it was the body tag, now it will look further if not found)
- The Option from the Mass Rename tool-Words are UpperCase-has changed, instead you will have Convert To Uppercase & To Title Case.
It will work as Described but now doesn't work only on Number that where converted to Words but on all the text.
- Removed Wall of Text from the Mass Rename tool and added a help button that will show it for info.
- Added a Download button in the Add window, that will search the site Kobobooks for the TOC and add the entries found to the detected text menu.
- Added a Select Download Text in the Add window, to help selecting the chapters when using the Download button.
- Enabled Navigation in the preview window. (Note : when using navigation you may see character not correctly displayed,
this is because of IE and when you navigate to it the program does not fix the page, it does not mean that the book will display that way.
Use the preview button to make sure)
- Added a Saved Message or Error Message when Saving in the status bar. (It will be shown during 5 seconds)
- Added a Select Previous Text option in the Add dialog.
- The Decrypt Files setting is now on by default when using a DRM build.

v1.3.6
- Put a Check that will prevent any none html file to be loaded or saved in the TOC.
- Changed the Version.xml location on the web, so it is more easily changed. Older version might not always show the new version number.
- Multiple Tweaks to Splitting so more file are compatible and do not crash.
- Changed the way settings are stored, so they are kept regardless of version, build or file location.
(The default MS was to have a setting file for each location and each version, so moving the executable would have all your setting lost.)
- A message will pop-up when opening a protected file, telling you it is protected and preventing you from editing this file.
- Added a Expand & Collapse All option in the Add window.
- When adding new Chapters, the text that was already selected in the Add window will now be remembered.
- In the Add window, clicking the columns header will sort the files.
- Added a Recent Files list under a new File Menu in the Main window.
- Fixed a Couple a Bug.

v1.3.4
- Found a situation where the Spine did not have a reference to the TOC (on retail books), So the App will look deeper if this situation arise.
- If the above situation arises opening the Reading Order Editor and Saving will force the reference into the spine. (a message box will open warning you about it)

v1.3.3
- The Show All checkbox will not be remembered anymore.
- The List of Anchors for each file will now be cached for each different Book.
- The Detected Text will now be cached for each different Book, along with the Anchors text.
- Removed the Apply button, it was replaced by a Add button.
- Using the Add command from the context menu will Add all the items under the selected node (instead of at the end of the document).
- The Save button will no longer close the window (and each related windows, exception is split chapters). You will now need to Save and Close.
- The file column width from the Add screen, will no longer have a maximum width.
- Also resizing the form will no longer adjust the columns width.
- The program will now correctly get the filenames for the NCX & OPF files
- For the OPF file it will get the path from the container.xml file (it used to check only for opf extension)
- For the NCX it will get the id from the spine and lookup the file associated with it in the manifest (it used to check for toc.ncx)
- In the Add window all files or anchors present in the TOC will be shown in Green.
- In the Add window with Show All deselected, Anchors present in the TOC will no longer appear.
- The Forms can now get on top of each other when opened and all will close when the main window closes (TOC or Reading Order editor).
- When opening the Add window, there will no longer be any validating to see if the files shown really exists in the ePub. It will instead
check if the file is present in the TOC when saving the ePub.
- When dragging and dropping Nodes they are no longer removed (with Show All off).
- The Add window will now remember if the nodes are Expanded when clicking Show All or Show Anchors.
- Fixed a problem with Reading order editor showing anchors.
- Shifting Chapters will now get the full source (with anchor) if the next/previous entry is the same file with a different anchor (before it just returned the top of the file).
- Fixed a problem when the source in the TOC was encoded with special characters (ex: %20 instead of a space).

v1.3
- Clicking The Add button in the Add window will no longer close the window.
- The entries in the Add window will now be sorted like the reading Order (spine).
- Added a Save Backup Checkbox on the Main Screen.
- Using Send To from a folder would crash the program, it will now collect all the .ePub found inside.
Useful for mass fixing from the calibre library.
- Added an option to check online if any new version is available (Default is enabled)
- The detected text for anchors, use to only find the text next to that anchors, it will now get the folowing lines. (up to 5)
- The program will now remember the Size and Position of the most windows.
- The Show All & Show Anchor Will now be remebered along with column width.
- Added a Split Chapters on Anchor checkbox in the TOC Editor,
that will Split your Html file into multiple files when more than 1 chapter per file is found. (Is pretty slow right now)
- Fixed a bug with the edit in Sigil, where source that had Anchors where removed.
- Fixed a Bug with the Shift function (Again).
- Added an About box inside in the main dialog.
- Added a status strip inside of the preview window that will show the name of the file being previewed.
- Added a couple of tooltips on checkboxes

v1.2
- The Show All & Show Anchor Checkbox from the add windows are no longer shown when in Edit Reading Order Editor.
- Added a Remove Option in the Reading & TOC Editors, You could have done the same thing by deselecting and clicking apply, but it was not intuitive.
- The files are now being extracted in a background Theard, the Editors window will now appear much more quickly.
- A Progress Bar has been added to the bottom of the screen showing the extracting progress.
- Fixed a Crash with the Show Anchors Checkbox when certain files were in the manifest but not in the ePub.
- Added a new column in the Add Screen that Shows a list of Text (now cap to 5 lines) inside of a File or following an Anchor, The selected text will be used if present when adding files to the TOC (instead of the filename).
- Draging Items with Anchors from the Add Window to the TOC would Add all the Anchors with it.
- Fixed a Bug with Shift Up & Down not working correctly.
- Added a Take Next Text in The Add Window. That way say the first line is a chapter number and the second the title of the chapter, you can easily select the title by selecting all the wanted lines.
- Added a Special Tag in the Mass Rename (%T) that will keep the text in place. Useful with the above feature where you would want to add say a number in front to auto-increment.
(example : Chapter Name could become 1 - Chapter Name by typing 1 - %T)
Also please note that any number in %T will also be detected (only the First one), So if %T is Chapter 1, putting Number to Words will result in Chapter One, if %t only is written. If You Write 1 - %T and %T is Chapter 1, you will have One - Chapter 1.
- Selecting multiple chapter in not the right order would make the renaming incorrect, Now the will all be renamed by the way the are on the screen regardless of the order that they were selected.

v1.1
- The Duplicate function was only duplicating 1 file when several were selected
- Added a Show All checkbox into the Add window, to show files that were already added
- Added a Show Anchor checkbox into the Add window, that will parse the html and show all the id tag into the file
- Changed Algorithm that checks for html file, it will now look for all file and media-type that Contains or Ends with html
- The preview into the Add window was only showing 1 preview when multiple were selected, it will now preview all of them

v1.02
- Fixed a Bug where the Temp Files where being Extracted over and OVer again
- Added a Duplicate Options
- Files with no source are now mark in red

v1.01
- When the Add dialog is shown it checks for any type of file html inside the manifest, will now also look to see if the file extension finishes with html
- Files for the preview where extracted when the TOC and reading order was opening, they now wait for it to be opened. (Large files add a small delay)
- The program was looking for the Sigil app in the usual place, and if it was found use it in place, Removed the check, you will now have to set it first.
- Added some wait cursor when the TOC and Reading order where opening and when the files were being extracted.

nrapallo 01-22-2011 09:24 AM

Wow!

Nice little tool you have created, and timely too. :thumbsup:

I finally bought a hardware reader that supports .epub files and have found myself hand-editing (with winrar) my calibre and Sigil produced/corrected .epubs of some of my larger ebook creations originally in other ebook formats.

You sure have "filled in" a need...... and I'm no stranger to ebook creating.

It seems my hardware ebook reader's limitations (the Next1 is non-Touchscreen and has no way of selecting internal links) have motivated me since "in page" or footnote links are inaccessible to me using the Next1 as is the traditional embedded TOC placed at the beginning of non-epub ebooks.

But that's OK, since I can try to use the toc.ncx to access the most important links (like Chapter Headings that Sigil so nicely collects for you and nests them too!) However, Sigils TOC Editor is of limited functionality (as you obviously are aware of or else there would be no epubfixer :snicker: )

l want to be able to use my ebook reader's Catalog (toc.ncx) function which can properly display and access nested level TOCs. So, that's why I've been hand-editing those toc.ncx and would like to use your tool to accomplish same.

In particular, since you list the spine elements and are able to add them to the TOC, could you also list the <href=> and their corresponding <id=> locations so that ALL internal links could be added to the TOC (probably nested to better present them. I would probably add them to level1 TOC and have them added as level2 TOC entries for them in sequential/page order and maybe create some level3 sub-compartmentalizations) .

Anyway, back to your epubfixer, my initial comments are:
- when I used the Go button to edit the TOC and Reading Order (with a large .epub file), the GUI disappeared for 20-30 seconds, but I knew it hadn't crashed as Sigil does the same thing when loading large .epubs when I use it with "Open With..." from Windows Explorer.
- I waited and then was rewarded with your TOC screen, but the reading order screen didn't show up and was placed right behind that first screen.
- I used the Add button when editing the TOC, and was presented with a blank screen with the heading "File", though no files were listed. I didn't know if it hadn't found any or was still collecting same.

What I'm really getting at here, by mentioning the above, is user feedback. Keep some indication that the original GUI is still there when opening the TOC or Reading Order screens, as well as that Add to TOC screen. A simple animated mouse pointer or log screen would help. It's not knowing if your software crashes that gets me impatient especially when I see nothing being done... :whistle: but that just me! ;)

Also, it would be nice if you could display some summary statistics like # of .html files in the epub or # of TOC (broken down by # of level 1, 2, 3 .... )

I'm off to edit some more so I may have other comments, but to be honest, I WANTED TO CREATE A TOOL LIKE THIS, but cannot undertake such programming tasks due to only being a unix/dos programmer/hack... :eek:

BTW, I'm download number 3 from your Google project host site. ;)

Again, nice job!!!

GeneS 01-22-2011 12:17 PM

Marvelous utility. Please keep working on it.

I've noted two apparent problems.

The first problem is in setting the Sigil path. I have two installations of Sigil. One is version 0.3.4 in Program Files\Sigil. The other is version 0.1.9 in Program Files\Sigil 0.1.9. It doesn't seem to matter which version I have selected using ePUBFixer's "Set Sigil Path", only Sigil 0.1.9 comes up when I select "Edit in Sigil".

The second issue is that nothing seems to happen when I check on the "Fix Margins" option and then select the "Go" button except that the ePUBFixer menu blinks momentarily. Perhaps I'm just missing a step somewhere.

Thanks for putting this together.

nrapallo 01-22-2011 12:45 PM

Quote:

Originally Posted by nrapallo (Post 1352063)
I'm off to edit some more so I may have other comments

:bigwave: I'm back!

In the Edit TOC screen, how can I create a new TOC entry in order to nest (move) into that level 2 all relevant links I want there.

I used the Add function, but it doesn't seem to be able add a blank entry for me so as to create nested levels. How is this supposed to work?

Can this functionality be added?

Nigol 01-22-2011 01:23 PM

Quote:

In particular, since you list the spine elements and are able to add them to the TOC, could you also list the <href=> and their corresponding <id=> locations so that ALL internal links could be added to the TOC (probably nested to better present them. I would probably add them to level1 TOC and have them added as level2 TOC entries for them in sequential/page order and maybe create some level3 sub-compartmentalizations) .
the href are actually there in a tooltip inside the TOC & reading order, I guess I could add their position from the spine to make sure they are it the right order.

Quote:

- when I used the Go button to edit the TOC and Reading Order (with a large .epub file), the GUI disappeared for 20-30 seconds, but I knew it hadn't crashed as Sigil does the same thing when loading large .epubs when I use it with "Open With..." from Windows Explorer.
- I waited and then was rewarded with your TOC screen, but the reading order screen didn't show up and was placed right behind that first screen.
- I used the Add button when editing the TOC, and was presented with a blank screen with the heading "File", though no files were listed. I didn't know if it hadn't found any or was still collecting same.
- I was extracting the file when opening the TOC editor (only for the preview), but didn't see any kind of slow down (on my Core i7), maybe your large ePub was why it was waiting to have it all extracted. I did a small change so that it will start extracting them when the form was finished loaded.
- The reading order should open after the TOC editor, they should not be opened at the same time, I can see why it could be useful, but having two thread writing to the same file could be disastrous.
- If you have a blank screen in the Add windows, there is 2 possibility:
1 - All the files are already present in the TOC or Reading order
2 - The program looks inside the manifest to find files to add, it look of file of type html (or xhtml), if the type is something else it is normal it didn't show them. I already did a fix (not yet released) that will also look at the file extension, if the type is not html.

I tried with a lot of file, but not everybody uses the same specs, so it hard to determine all book. Maybe you could send me your book or just your toc and opf file to at least be sure, if there should be something in the Add window.

About the initial form hiding I could leave it opened, it just seemed more clean this way (I might not have anticipated the impact of very large files, all my test where almost instantaneous). That is why I posted it, to have user comments, I feel that right now it does everything I wanted to do, but there might be something else to add.



Quote:

Originally Posted by GeneS (Post 1352304)
Marvelous utility. Please keep working on it.

I've noted two apparent problems.

The first problem is in setting the Sigil path. I have two installations of Sigil. One is version 0.3.4 in Program Files\Sigil. The other is version 0.1.9 in Program Files\Sigil 0.1.9. It doesn't seem to matter which version I have selected using ePUBFixer's "Set Sigil Path", only Sigil 0.1.9 comes up when I select "Edit in Sigil".

The second issue is that nothing seems to happen when I check on the "Fix Margins" option and then select the "Go" button except that the ePUBFixer menu blinks momentarily. Perhaps I'm just missing a step somewhere.

Thanks for putting this together.

You are right about the Sigil path, if it detects the Sigil executable in it's normal locaiton program file etc... it will use it instead, I could just remove the check and force people to set the path first.

Also the fix margins don't have any box, it just does it, maybe a message box would be great (i removed it at first because of it poping when selected multiple tool) all the options will be run in the order they are shown Margins->Sigil->Toc->Reading order for every book selected.

Nigol 01-22-2011 01:30 PM

Quote:

Originally Posted by nrapallo (Post 1352354)
:bigwave: I'm back!

In the Edit TOC screen, how can I create a new TOC entry in order to nest (move) into that level 2 all relevant links I want there.

I used the Add function, but it doesn't seem to be able add a blank entry for me so as to create nested levels. How is this supposed to work?

Can this functionality be added?

If you want to nest the level, just drag and drop the chapters (you can select multiple ones) you want to be level 2 on the level 1 entries. You can also drag level 2 to be level 1, just look at the black bar level. But right now it is only 1 html file, 1 entry you can Add.

So are talking about having the same file 2 times in the TOC? I could add a duplicate function.

Nigol 01-22-2011 02:06 PM

Small Update
 
Did a small update based on the feedback. on google code and the file attached to this forum.

http://code.google.com/p/epubfixer/

- When the Add dialog in shown it checks for any type of file html inside the manifest, will now also look to see if the file extension finishes with html
- Files for the preview where extracted when the TOC and reading order was opening, they now wait for it to be opened. (Large files add a small delay)
- The program was looking for the Sigil app in the usual place, and if it was found used it in place, Removed the check, you will now have to set it first.
-Added some wait cursor when the TOC and Reading order where opening and when the files were being extracted.

Going out for the day, so please keep posting comments.

nrapallo 01-22-2011 03:07 PM

1 Attachment(s)
Quote:

Originally Posted by Nigol (Post 1352413)
the href are actually there in a tooltip inside the TOC & reading order, I guess I could add their position from the spine to make sure they are it the right order.

I see that now, but those are NOT the <href=>'s I was thinking about above. The thought I had, to add more functionality to existing ebooks, was the have ALL href's in the ebook listed on that Add screen along with their anchor's internal filename and then be able to pick and choose amongst that list to add to the existing TOC. In essence, the user could then have the opportunity to add footnotes under relevant Chapters so as to access them from the toc.ncx. Again this is only important for those that have no hardware/software mechanism to get at those internal links.

My idea was to be able to add a two new TOC level1 entries, one called "Embedded TOC" which could house those links found in older style ebooks (like what Project Gutenberg produces) just for the embedded Table of Contents and List of Illustrations at the beginning of the ebook. The other, called "Internal Links", would be for ALL relevant footnote or "in page" links.

I wouldn't expect your ePubFixer to actually change/add to the TOC, just be able to access that listing of (other) href's used within the epub. The user would then be at liberty to determine which could be retained/discarded and add soley those from the Add screen to the existing TOC. Food for thought!

All this is to accomplish one goal, to embellish the existing TOC in ways Sigil, nor calibre could do algorithmically. :grin2:

Quote:

- I was extracting the file when opening the TOC editor (only for the preview), but didn't see any kind of slow down (on my Core i7), maybe your large ePub was why it was waiting to have it all extracted.
Yes, the epub was large; its an epub of an entire website I downloaded almost 5 years ago and contains almost 1700 items in the <spine> section of the .opf (it has that many .html files plus almost 1500 images within). So that's probably too extreme a test case, but just highlights the fact that while loading/filtering the items, the GUI should not close until the Edit TOC screen actually is ready...

This is the TOC screen Attachment 65285 I see after loading that gargantuan .epub and one of my first thoughts was to create a new Level1 entry for "A" and then move all the Mathematicians with lastname starting with "A" therein. I would need to be able to add a New entry, then move the existing ones therein.

Quote:

- The reading order should open after the TOC editor, they should not be opened at the same time, I can see why it could be useful, but having two thread writing to the same file could be disastrous.
Yes, I see that now, and you're right about editing the same source files at the same time and the potential for disaster.

Quote:

- If you have a blank screen in the Add windows, there is 2 possibility:
1 - All the files are already present in the TOC or Reading order
2 - The program looks inside the manifest to find files to add, it look of file of type html (or xhtml), if the type is something else it is normal it didn't show them. I already did a fix (not yet released) that will also look at the file extension, if the type is not html.
Good to know. Now if you could add other internal links (like the aforementioned ALL href's) that can be listed and added, then were looking good.... :whistle:

Quote:

I tried with a lot of file, but not everybody uses the same specs, so it hard to determine all book. Maybe you could send me your book or just your toc and opf file to at least be sure, if there should be something in the Add window.
Sorry, that epub is copyrighted and made for my own use. :o If you want to see the .opf then I could email it to you. Just PM me.

Quote:

About the initial form hiding I could leave it opened, it just seemed more clean this way (I might not have anticipated the impact of very large files, all my test where almost instantaneous). That is why I posted it, to have user comments, I feel that right now it does everything I wanted to do, but there might be something else to add.
If you are willing to entertain our comments, then I'm willing to provide same. :)

nrapallo 01-22-2011 03:27 PM

Quote:

Originally Posted by Nigol (Post 1352429)
If you want to nest the level, just drag and drop the chapters (you can select multiple ones) you want to be level 2 on the level 1 entries. You can also drag level 2 to be level 1, just look at the black bar level. But right now it is only 1 html file, 1 entry you can Add.

Well, so you can! Absolutely bang-on functionality! It works like a charm! :2thumbsup

Quote:

So are talking about having the same file 2 times in the TOC? I could add a duplicate function.
No, the above clears up my issues, except instead of using the "Add" option, could you add a "New" option and allow the user to rename it. It would serve as a placeholder for those (newly created) level2 entries. You could even default its href to be the same as the first level2's href file reference just to be complete.

Freeshadow 01-22-2011 08:27 PM

looks like THE tool to simplify creation ofomnibus editions :D karma comes the way

Nigol 01-23-2011 12:57 AM

Quote:

Originally Posted by nrapallo (Post 1352644)
No, the above clears up my issues, except instead of using the "Add" option, could you add a "New" option and allow the user to rename it. It would serve as a placeholder for those (newly created) level2 entries. You could even default its href to be the same as the first level2's href file reference just to be complete.

If I understand you correctly, it's that there are no file with a summary for people with A, and you would just like to have them group together, so it becomes clearer? Or having 2 TOC's like 1 by name and other by date for example.

I have not fully checked the specs fully, but I don't know what an empty TOC will do with some reader. But right now whenever an entry is loaded and the file is not physically there in the ePub, it will not be shown when loaded and be removed completely from the TOC upon saving. But empty source do come up in my test, and i even wanted to make sure it couldn't be possible.

Also about the Add screen, it only lists the file inside the manifest. It does not parse every HTML file to find the anchor value presents. Although it could be usefull, my main idea was to create a tool that would complement calibre and sigil. And this type of thing could "easily" (it took me a while to fully understand the convert setting in it) be done in calibre with the right settings, having it detect some html tag, let calibre create your TOC, and then use my tool to remove unwanted parts of move some.

I could easily add a Show all checkbox inside the add screen that will show even files that are already present And/Or a New option without a source, but I don't see why it would be of use. I think that is why neither calibre nor sigil is able to do this. I don't even know what it would do on some reader or if it is possible in the specs. I just want to be sure it is something that would be useful without having the tool be too complicated and less intuitive for all users.

Update : I have just tested Added an New Empty TOC Entry, but the calibre viewer seems to remove the entry with no source completely, and looking at the specs (http://www.niso.org/workrooms/daisy/...5.html#NCXElem) and it seems to be required. So it would not change anything because I guess most reader will either ignore it and remove it, or maybe crash. Maybe a duplicate would work for you?

nrapallo 01-23-2011 08:55 AM

Quote:

Originally Posted by Nigol (Post 1353331)
If I understand you correctly, it's that there are no file with a summary for people with A, and you would just like to have them group together, so it becomes clearer? Or having 2 TOC's like 1 by name and other by date for example.

The main thrust for allowing one to add a New TOC entry with a src/href is as a temporary repository for existing level1 TOC entries that can be moved into it as level2 TOC items. This differs slightly from your program's TOC editing capabilities in that with your "drag 'n drop" method the level1 TOC entry name remains whereas in what I'm getting at, that dropped on level1 entry becomes the first level2 TOC entry within the newly crated level1 TOC entry.

For example, with that huge .epub, all 1700 Mathematicians are listed in Alphabetical order as level1 TOC entries. What I wanted to do (after the .epub was created from my .html/.jpg source using calibre and "cleaned up" using Sigil) was to create, using ePubFixer now instead of hand editing, 26 New level1 TOC entries, one for each letter of the Alphabet. Then I would move all the "A" Mathematicians into that newly created "A" entry. And yes, when that new "A" was created it had no src/href and was empty, but AFTER I move all those "A" Mathematicians therein, the first level2 TOC entry i.e. Enrst Abbe could be used to provide that "A" level1 TOC entry with a valid src/href (duplicate!). :smack:

Come to think about it, if you allow any TOC entry to be duplicated, like Ernst Abbe, then I could just rename the first one to "A Mathematicians" and then move the second "Ernst Abbe" along with any other "A" TOC entries therein afterward. It would accomplish the same task and NOT create any invalid/empty TOC entries. :chinscratch:

This is a better approach since the TOC's src/href is already set upon duplication and so there is no need to "guess" or worry about how that empty TOC will be used by the user.

Another benefit of having a Duplicate option would be to allow another placement of say the embedded Table of Contents present at the back of the ebook, to the front.

Soooooo, can a Duplicate option be added to the Add screen instead of a New option? :cool:

Quote:

I have not fully checked the specs fully, but I don't know what an empty TOC will do with some reader.
Using a Duplicate option instead will not cause any empty TOC issues!

Quote:

Also about the Add screen, it only lists the file inside the manifest. It does not parse every HTML file to find the anchor value presents. Although it could be usefull,
That's what I had in mind! :rolleyes: :snicker:

The ONLY useful entries to add to the internal toc.ncx are links that not already there but which links? Your software can't determine that on it's own, but if you do parse the .html (ala Beautiful Soup) and extract all the href's and match them with their id's and note the anchor's filename, then those could be listed.

So, for example, if the first .html in the <spine> is "Text/Abbe.html" and has a footnote link, say footnote1 coded like <a href="footnotes.html#note1">footnote1</> then "note1" could be listed and added to the TOC as:
Code:

        <navPoint id="navPoint-24" playOrder="24">
            <navLabel>
                <text>Ernst Abbe - Footnote1</text>
            </navLabel>
            <content src="Text/footnotes.html#note1"/>
        </navPoint>

Quote:

Maybe a duplicate would work for you?
In a nutshell, YES!!!!!! ;)

Nigol 01-23-2011 01:05 PM

Update
 
Ok so I uploaded a new update with the requested Duplicate Function.

There was also a bug I introduced in v1.0.1 where Temp files where being extracted over and over again. SO please everyone update.

So I hope this helps you.

nrapallo 01-23-2011 04:10 PM

1 Attachment(s)
For the sample .epub attached, I want to add new level2 items under the "Table of Contents" level1 TOC entry in the toc.ncx as there are places under that title to link to it, like
Code:

<p class="calibre13"><a class="calibre4" href="../Text/10940-h_split_005.htm#ch01">Condition of Persons and Lands</a></p>
but they are not included in the toc.ncx, nor available in the Add screen. See "10940-h_split_003.htm" therein.

What functionality could you add to ePubFix to enable me to do this?

Nigol 01-23-2011 11:04 PM

Quote:

Originally Posted by nrapallo (Post 1354558)
For the sample .epub attached, I want to add new level2 items under the "Table of Contents" level1 TOC entry in the toc.ncx as there are places under that title to link to it, like
Code:

<p class="calibre13"><a class="calibre4" href="../Text/10940-h_split_005.htm#ch01">Condition of Persons and Lands</a></p>
but they are not included in the toc.ncx, nor available in the Add screen. See "10940-h_split_003.htm" therein.

What functionality could you add to ePubFix to enable me to do this?

OK here is what I did, I have added a Show All button and a Show Anchor button into the Add window. But by looking at the file you were talking there are several id inside the same line, the ch01 is on almost every line.

As a matter of fact that particular line you were talking about points to heading_id_13 (which is already in your TOC, so what adding ch01 will do is point to the beginning of the page instead of the required effect. (since it will point to the very first ch01)

What the Show Anchor does is show the very first id Tag it finds in the html (I am guessing that the navigating to a anchor does work the same, jumping to the first one spotted)

Changelog :

- The Duplicate function was only duplicating 1 file when several were selected
- Added a Show All checkbox into the Add window, to show files that were already added
- Added a Show Anchor checkbox into the Add window, that will parse the html and show all the id tag into the file
- Change Algorithm that checks for html file, it will now look for all file and media-type that Contains or Ends with html
- The preview into the Add window was only showing 1 preview when multiple were selected, it will now preview all of them

Freeshadow 01-24-2011 01:05 AM

more KARMA for that guy !!!

Nigol 01-24-2011 10:07 AM

Glade you like it!

nrapallo 01-24-2011 11:05 AM

Quote:

Originally Posted by Nigol (Post 1355066)
OK here is what I did, I have added a Show All button and a Show Anchor button into the Add window. But by looking at the file you were talking there are several id inside the same line, the ch01 is on almost every line.

Oops, how did those duplicate id's get in there.... :dunno:

There shouldn't be any duplicates, but your solution seems appropriate to only use the first one! :thumbsup:

I tried editing that TOC, and after I added that id link, the tooltip and name were the same for the newly added TOC entry. I promptly renamed it to the anchor's text, but thought, :chinscratch: , it would be nice for the Add screen to show the text of the id's anchor or heading (h1/h2/h3..) and use that as the default naming when added, instead of the src/href. Perhaps you can add another column in the Add screen to show what text the link surrounds or at least the first 20-30 characters.

Also, while editing I added a wrong link to the TOC and then found that I couldn't delete it, only unselect it. Could you also add a (one line or multiple lines) Delete TOC entry option?

Thanks for implementing greater functionality as well as retaining your simple but intuitive UI!!!! :2thumbsup

Nigol 01-24-2011 11:48 AM

Quote:

Originally Posted by nrapallo (Post 1355804)
Also, while editing I added a wrong link to the TOC and then found that I couldn't delete it, only unselect it. Could you also add a (one line or multiple lines) Delete TOC entry option?

That is kind of why I added the Apply button, it will reload the TOC, without saving to the file, but I will add it anyway, since it might not be intuitive enough.

I will look if having some text detected is doable, because of all the different kind of book, they are sometime very different. Maybe catch the next p or blockquote tag following the anchor or at the beginning of the page. But it is a good idea, to have at least half the job already done.

Nigol 01-25-2011 11:01 PM

New Cool Update Coming
 
Just letting you all know that I am working on a new update, that will simplify even more Creating TOC.

http://epubfixer.googlecode.com/files/Add%201.jpg
http://epubfixer.googlecode.com/files/Add%203.jpg

- Added a Remove Option in the Reading & TOC Editors, You could have done the same thing by deselecting and clicking apply, but it was not intuitive.
- The files are now being extracted in a background Theard, the Editors window will now appear much more quickly.
- A Progress Bar has been added to the bottom of the screen showing the extracting progress.
- Added a new column in the Add Screen that Shows a list of Text (now cap to 5 lines) inside of a File or following an Anchor, The selected text will be used if present when adding files to the TOC (instead of the filename).
- Added a Take Next Text in The Add Window. That way say the first line is a chapter number and the second the title of the chapter, you can easily select the title by selecting all the wanted lines.
- Added a Special Tag in the Mass Rename (%T) that will keep the text in place. Useful with the above feature where you would want to add say a number in front to auto-increment.
(example : Chapter Name could become 1 - Chapter Name by typing 1 - %T and auto-increment all field)

And some bugs also.

Hope you find this useful and spread the word if you do.

Should be out Tomorrow or the day after.

KenJackson 01-26-2011 02:18 AM

I took a look at the project page and was pleased to see it's licensed GPL. But I don't see any source code.

I tried to run it with wine on Linux, but it said
wine: Install the Windows version of Mono to run .NET executables

OK, I guess I could install that, but are you going to build any non-Windows version?

Nigol 01-26-2011 11:09 AM

Quote:

Originally Posted by KenJackson (Post 1359068)
I took a look at the project page and was pleased to see it's licensed GPL. But I don't see any source code.

The Code is not there because I don't yet use the Source Control. But if interested I would gladly provide it. And right now there was no request for it, so I didn't really bother.

I will post a source with the next version in the download section, I just ask that if anybody wants to make some enhancement that we all work together, instead of doing many different version.

Quote:

Originally Posted by KenJackson (Post 1359068)
I tried to run it with wine on Linux, but it said
wine: Install the Windows version of Mono to run .NET executables

OK, I guess I could install that, but are you going to build any non-Windows version?

The program is written in C#, which means that to run it you will need either .Net Runtime (3.5) or Mono on Linux or MAC.

That said Mono is not an exact port of the .NET framework and there will surely be some parts of it that are not working. Maybe someone with some experience with Linux could give a hand, has I don't really plan on using Linux soon.

But I have checked the compatibility with Mono. The only problem I see is the WebBrowser window not running on OSX. On version 1.2 only (I changed some things that would not have pass the tests.)

But there is some problems with the libraries I am using, but looking at the report it does not look like something that is used in my App and could be safely removed (all are open source). But there will have some testing to be done and some code modification to do.

Nigol 01-26-2011 05:19 PM

Update 1.2 Available
 
I have uploaded the new Update 1.2 attached on The First Post and on Google Code. I have also uploaded the Source Code.

Like always please leave comments, suggestions, bugs, etc. And spread the word. Maybe if it is useful/liked enough this post might get stickied :D.

(See the OP or the readme for the changelog)

nrapallo 01-26-2011 11:24 PM

Quote:

Originally Posted by Nigol (Post 1360415)
I have uploaded the new Update 1.2 attached on The First Post and on Google Code.

It's soooo powerful now!

I can nest TOC levels, shift them around, add more TOC entries at will and when in doubt I can even preview the .html where the anchor's located. :cool:

All a click or two away (typing optional! :thumbsup: )!

Thanks Nigol for a worthy update!

Oh, one more request, if I may. How about a "Save as..." button (or dialog prefilled with the filename when the Save button is clicked) for those times when I want to keep the original .epub and haven't copied it beforehand...

Nigol 01-26-2011 11:35 PM

Quote:

Originally Posted by nrapallo (Post 1360931)
Oh, one more request, if I may. How about a "Save as..." button (or dialog prefilled with the filename when the Save button is clicked) for those times when I want to keep the original .epub and haven't copied it beforehand...

I am starting to think that you will never be happy :D (Joking). But in all honesty I appreciate your comment it help me build something better that can now more easily create a TOC from almost nothing, without going into sigil and wasting hours to just select the heading.

I do agree with the Save As, Or I would be more inclined to have a Save Backup checkbox, It would have helped me when I started coding it, because I had to keep several copy, because the app would destroy my TOC or stylesheet completely.

nrapallo 01-27-2011 12:20 PM

Quote:

Originally Posted by Nigol (Post 1360941)
I am starting to think that you will never be happy :D (Joking).

You say that as if it's a baaaad thing.... :snicker: It's just my nature! ;)

Quote:

But in all honesty I appreciate your comment it help me build something better that can now more easily create a TOC from almost nothing, without going into sigil and wasting hours to just select the heading.
I agree! There is nothing worse than finishing a complex and lengthy conversion with calibre and then trying to salvage that conversion by editing the .epub with Sigil only to find the TOC is not the way you like it. ePubFixer to the rescue..... :thumbsup:

Quote:

I do agree with the Save As, Or I would be more inclined to have a Save Backup checkbox, It would have helped me when I started coding it, because I had to keep several copy, because the app would destroy my TOC or stylesheet completely.
While we are talking about further changes, how about:
  • Remembering the placement (size and location) of the Add, TOC Editior and Preview screens. Every time I launch the program, I have to re-adjust the windows the way I like them (since I have LOTS of screen real estate available I even enlarge the screens!).
  • After I add links from the Add screen and am returned to the TOC Editor screen, any subsequent call to "Add" has to re-scan for Show ALL and for Show Anchors. Can this be cached/remembered while still editing the TOC?
  • In the Add screen, can you allow sorting of "Filename", "Detected Text" by click the Header (sort/reverse sort)
  • 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)

Also, some tips for those "not in the know",
  • At the Add screen, just drag 'n drop the link(s)to the correct place in the TOC Editor screen. You can still, instead, use the Add button, but that delivers all selected links to the bottom of the existing TOC. Choose which works for you.
  • After using the Preview option, if you want to see the relevant html code, just right-menu and select "View Source", then you can also see how those links interact. ;)

If you make more changes, Nigol, I'll continue to make comments/suggestions... :whistle:

GeneS 01-28-2011 11:29 PM

The application does a wonderful (and relatively easily) job of creating a new TOC, saving much laborious editing time. I have however noted that once I have finished, if I call the file up again in Sigil, Sigil will ignore everything I have done and restore the original TOC, thereby destroying all my careful work, putting me back where I was before I used epubfixer.

I have read and re-read the thread several times, so if it was said, I missed it ... but how do I insure that my carefully revised and re-ordered TOC is not later destroyed?

Nigol 01-29-2011 01:53 PM

Quote:

Originally Posted by GeneS (Post 1365154)
The application does a wonderful (and relatively easily) job of creating a new TOC, saving much laborious editing time. I have however noted that once I have finished, if I call the file up again in Sigil, Sigil will ignore everything I have done and restore the original TOC, thereby destroying all my careful work, putting me back where I was before I used epubfixer.

I have read and re-read the thread several times, so if it was said, I missed it ... but how do I insure that my carefully revised and re-ordered TOC is not later destroyed?

That is why there is an Edit in Sigil option, what it does is simply make a copy of your TOC before opening sigil and replacing it afterwards. it will not keep your TOC intact if say you split several chapter and/or rename the files. So I suggest selecting both the Edit in Sigil and Table of Content Editor, because after editing in Sigil the TOC editor will filter unavailable entries (or just put the in red if they where anchors - v1.3 only), and you could add new entries that where done with Sigil, like splitting chapters.

That said I just found a bug (and fixed it in the next version) where a TOC entry that links to Anchors (i.e. TExt/page001.html#filepos011) would not be kept.

I am also working on a Split Chapters on Anchors that will split your html files just before the selected anchors. (we will see if it works well before release, so no promise now).

Nigol 02-01-2011 11:37 AM

Update 1.3
 
Here is the Changelog for the new update that I just uploaded, hope you like it.

They might me something else, but I did a stupid thing and erased some of the stuff I had already written, so I had to re-write them.

Spread the word if you like it...

Changelog :

- Clicking The Add button in the Add window will no longer close the window.
- The entries in the Add window will now be sorted like the reading Order (spine).
- Added a Save Backup Checkbox on the Main Screen.
- Using Send To from a folder would crash the program, it will now collect all the .ePub found inside.
Useful for mass fixing from the calibre library.
- Added an option to check online if any new version is available (Default is enabled)
- The detected text for anchors, use to only find the text next to that anchors, it will now get the folowing lines. (up to 5)
- The program will now remember the Size and Position of the most windows.
- The Show All & Show Anchor Will now be remebered along with column width.
- Added a Split Chapters on Anchor checkbox in the TOC Editor,
that will Split your Html file into multiple files when more than 1 chapter per file is found. (Is pretty slow right now)
- Fixed a bug with the edit in Sigil, where source that had Anchors where removed.
- Fixed a Bug with the Shift function (Again).
- Added an About box inside in the main dialog.
- Added a status strip inside of the preview window that will show the name of the file being previewed.
- Added a couple of tooltips on checkboxes

nrapallo 02-01-2011 12:31 PM

9 Attachment(s)
Well done, Nigol! :clap:

epUBFixer is so intuitive and easy to use. :thumbsup:

I recently added "back links" to footnotes by manipulating the toc.ncx using ePubFixer. It was easy to do and allowed much need navigation for my (crippled) ADE hardware reader without a touchscreen or back button.

I started with a well-coded epub called 'Lorna Doone.epub' by AlexBell available in this thread Blackmore, R.D.: Lorna Doone. v2 03 Oct 2010

I moved all chapters listed in the TOC Editor screen onto the "Lorna Doone" heading and created level2 TOC entries for the chapters (I had to add another link to chapter 1 from the Add screen). This was just a cosmetic preference of mine.

Then, at the Add screen, I (shift) selected all the anchors listed under "Footnotes.html" and then choose "Select Next Text" for all of them to better describe the footnotes! I moved them onto the TOC Editor's "Footnotes" heading and it created level2 TOC entries for same. I even renamed those level links via (shift) select and rename using "[1] - %T" to add the footnote number back.

In the Add screen, I then expanding each filename listed and moved the detected footnote "back anchor" like "[1]" and moved each one, in turn, onto it's corresponding newly added footnote level2 TOC entry. This created a level3 TOC entry for each level2 TOC footnote!!! Then I mass renamed them using ctrl-click with "%T - back to text" and it changed "[1]" to "[1] - back to text"

It was a bit tedious, but employed very simple drag 'n drop, point and (shift/ctrl) click as well as only minimal typing! :2thumbsup

Attached, please find my fixed version of the original "Lorna Doone.epub".

I hope this inspires others to get fixing .epubs using ePubFixer! :snicker:

p.s. I attach some screenshots of my work

original "Lorna Doone.epub"
Attachment 65859Attachment 65860

Add screen after showing all filenames and anchors
Attachment 65865Attachment 65866

my "Lorna Doone_fixed.epub"
Attachment 65861Attachment 65862Attachment 65863Attachment 65864

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.


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.