Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Reading and Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2007, 02:08 PM   #1
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
MobiPocket TOC using mobigen

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:
  1. Create a stand-alone TOC.html
  2. Include a link to TOC.html just after the title in MAIN.html
  3. 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".
  4. Create a COVER.jpg (or .gif)
  5. Include the COVER as an image at the start of MAIN.html
  6. Reference COVER.jpg in MAIN.opf as an EmbeddedCover
  7. Optionally add other fields to MAIN.opf, such as Title,Creator,Subject as in the example
  8. 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.
Attached Thumbnails
Click image for larger version

Name:	Alice_1st.gif
Views:	984
Size:	118.4 KB
ID:	6311   Click image for larger version

Name:	Alice_TOC.gif
Views:	923
Size:	128.1 KB
ID:	6312  
Attached Files
File Type: zip Alice_In_Wonderland.zip (433.9 KB, 891 views)
wallcraft is offline   Reply With Quote
Old 10-14-2007, 02:17 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,310
Karma: 136006010
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I really want ot do is start with a single HTML file that already has the ToC inside. Mobipocket Creator has options for specifying the ToC, but I have no clue how to use it. So if someone could explain it, then maybe I could use that to do it from the single HTML. But as it is, it seems that generating Mobi format is a royal pain. I want one file to do it all. And with html2lrf and the Creator, I should be able to. But thanks to the mess Mobipocket made of their tools, it's not that easy.
JSWolf is offline   Reply With Quote
Advert
Old 10-14-2007, 02:39 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,482
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Since this is mobipocket, I don't really care, but it seems to me that it should be the work of a couple of hours to write a script that automates the creation of the opf and calling mobigen.
kovidgoyal is offline   Reply With Quote
Old 10-14-2007, 03:07 PM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
I must admit that personally I'm not that fussed about having a "proper" TOC in a Mobi file. The approach we're all using at the moment of having an "in line" TOC at the front of the book works perfectly well.
HarryT is offline   Reply With Quote
Old 12-07-2007, 09:45 AM   #5
Hadrien
Feedbooks.com Co-Founder
Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.
 
Hadrien's Avatar
 
Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
Interesting topic. I'm currently working on the Mobipocket output for Feedbooks, we'll add proper TOC support in our files.

We'll also support covers (important for the Cybook) a bit later.
Hadrien is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC Creation & Calibre vs. MobiPocket Themus Calibre 8 05-15-2010 11:32 AM
TOC question re Mobipocket file from ePub via Calibre MichaelGray Kindle Formats 0 02-26-2010 07:53 AM
Mobigen Mobigen (KindleCreator) for Linux now available wallcraft Kindle Formats 31 03-17-2009 12:32 AM
Old Version Mobigen needed wilko10 Kindle Formats 11 11-25-2008 08:10 PM
Does someone still have Mobigen 6.01 build 37? IceHand Kindle Formats 7 03-03-2008 05:04 PM


All times are GMT -4. The time now is 08:09 PM.


MobileRead.com is a privately owned, operated and funded community.