oh, oh, I know! (raises hand, waves wildly) - I just wrote about this in my calibre help file!
the help file is at:
http://stu.wccnet.edu/~rprice/Eng218...0Help/index.ht
The procedure is under Other Fun Stuff.
here's the procedure:
For this particular procedure, you'll need to start with a mobi format and the Mobi Unpack plugin. Note that this procedure will only work with non-DRM'd files. I recommend that you use a second copy of the book file for this procedure, rather than working directly in the original copy of the book file.\
The description in step 9 assumes a Microsoft Windows operating system. The exact procedure may vary depending on your operating system.
1. If necessary, convert the file to mobi.
2. Install the Mobi Unpack plugin.
3. Right-click the name of the book to be unpacked.
4. From the menu, select Customize Mobi-unpack.
a. In the dialog box, enter the path and file name to where
the unpacked files will be placed.
b. Click OK
5. Unpack the mobi file.
To unpack a mobi file:
a. Right-lick on the name of the book to be unpacked to select it.
b. From the menu, select Mobi > Unpack.
6. Open the folder or directory in which the unpacked files have been placed.
7. Using Notepad, Notepad++, or other text editor, edit the file. Save your changes.
8. In the Mobi Unpacked directory or folder, shift-click on the the files
associated with the book to select them. There may be three of them:
an HTML file, an OPF file, and an NCX file.
9. Zip the files.
How to zip files in Windows 7.
a. Right-click on the selected files.
b. From the menu, select Send To.
c. From the Send To menu, select Compressed (zipped) folder.
10. Change the name of the compressed folder to the name of the book,
and give it the extension .epub.
11. Delete the original book from the calibre library.
12. Add the new epub book to your calibre library.
13. If necessary, convert the book to mobi.