MobiPocket's command line tool, mobigen.exe, is for Windows only, but danx found it to be usable via
Wine on Linux (and presumably OSX). It is a free download from the
Mobipocket Developer Center. This tool takes either a single .html file or an OEB .opf file and creates a .mobi file. The thread
Images in MobiPocket, notes that .jpg images and the new -jpeg option to mobigen will produce the best possible images for larger screens. However, we don't have an easy way to create a Table of Contents (TOC) that MobiPocket will recognize - so most .mobi (.prc) files posted here have an in-lined TOC near the start. This allows navigation, but isn't recognized by MobiPocket Reader as a TOC (e.g. it isn't attached to the TOC icon on the iLiad) and so isn't optimal.
MobiPocket's Creator software can automatically build a TOC from HTML files, but that is a hit or miss process and in any case it isn't an option with mobigen. However, you can create your own separate TOC.html file. As described on the
MobiPocket Forum:
Quote:
to do that, you should create the anchors in the main content file (main.html for instance).
Then you create a separate TOC file (TOC.html for instance) and you create links to the main file in it. For instance your TOC.html will contain a link that points to main.html#chapter_1 if chapter_1 is the name of the anchor you created for chapter 1.
Then you simply put both TOC.html and main.html in your publication in the Creator.
|
That works for Creator (if you explicitly make TOC.html the TOC), but not for mobigen. However, Creator works by producing a .opf file and then essentially running mobigen over it to produce the final .mobi file. So to create a .mobi version of a single-file .html e-book with a separate TOC and a cover image using only mobigen do the following:
- Create a stand-alone TOC.html
- Include a link to TOC.html just after the title in MAIN.html
- Create a MAIN.opf that references MAIN.html and TOC.html in the manifest and spine, and TOC.html in the guide as a "toc".
- Create a COVER.jpg (or .gif)
- Include the COVER as an image at the start of MAIN.html
- Reference COVER.jpg in MAIN.opf as an EmbeddedCover
- Optionally add other fields to MAIN.opf, such as Title,Creator,Subject as in the example
- Create MAIN.mobi via: mobigen.exe MAIN.opf -c1 -s0 -jpeg
If the source is a single .html file, then it should be easy to produce an .opf file - and even multi-file .html should not be too hard. I attach an example based on MobiPocket's "Alice In Wonderland" test e-book (which uses a lot of MobiPocket HTML extensions). This gives a clickable TOC icon on the iLiad.