Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-25-2008, 10:00 AM   #181
ppxnouse
Connoisseur
ppxnouse began at the beginning.
 
Posts: 60
Karma: 10
Join Date: Dec 2007
Location: Aachen
Device: Gen3
Hello tompe,

I did create myself a small tool to download and parse/reformat books from the German Project Gutenberg. I write all content into a single HTML and create a "TOC" at the top of the page with inter page links.

When I convert this page using the Mobipocket Reader, The "TOC" works. When I use html2mobi, the links do not work. I do not want to split all into different pages if not necessary. Any other way to make a TOC with HTML2MOBI ? (I am sure it got written somewhere already - I just can not find it).

Thank you
ppxnouse is offline   Reply With Quote
Old 01-25-2008, 10:54 AM   #182
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by ppxnouse View Post
When I convert this page using the Mobipocket Reader, The "TOC" works. When I use html2mobi, the links do not work. I do not want to split all into different pages if not necessary. Any other way to make a TOC with HTML2MOBI ? (I am sure it got written somewhere already - I just can not find it).
This should work. Could you send me a test file (email: tpe@ida.liu.se).
tompe is offline   Reply With Quote
Advert
Old 02-07-2008, 05:22 PM   #183
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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@tompe
Would you mind improving you mobi2html utility a little so I can write mobi2lrf

1) Allow passing of absolute paths to mobi2html for the .mobi file
2) Post process the generated HTML to remove mobipocket specific tags and attributes. For e.g. <mbpage-break/> -> <br style="page-break-after:always/> and so on
kovidgoyal is offline   Reply With Quote
Old 02-07-2008, 06:25 PM   #184
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
@tompe
Would you mind improving you mobi2html utility a little so I can write mobi2lrf

1) Allow passing of absolute paths to mobi2html for the .mobi file
2) Post process the generated HTML to remove mobipocket specific tags and attributes. For e.g. <mbpage-break/> -> <br style="page-break-after:always/> and so on
Sound like reasonable things to do. I have put them on the top of the todo list so it will probably be done soon. But I just got my N810 today so I am kind of busy playing with it...
tompe is offline   Reply With Quote
Old 02-07-2008, 06:40 PM   #185
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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks, 'preciate it. Enjoy your N800
kovidgoyal is offline   Reply With Quote
Advert
Old 02-08-2008, 06:26 PM   #186
darkninja
Member
darkninja will become famous soon enoughdarkninja will become famous soon enoughdarkninja will become famous soon enoughdarkninja will become famous soon enoughdarkninja will become famous soon enoughdarkninja will become famous soon enough
 
Posts: 12
Karma: 636
Join Date: Feb 2008
Device: none
Breakthrough on Igor Skochinsky's Blog

Check out Igor Skochinsky's blog!

At the bottom of the comments, there's a very interesting Python program.

It lets you use the same mobipocket .PRC file on multiple devices, even if it was previously locked to a specific device.
darkninja is offline   Reply With Quote
Old 02-09-2008, 09:40 AM   #187
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
@tompe
Would you mind improving you mobi2html utility a little so I can write mobi2lrf

1) Allow passing of absolute paths to mobi2html for the .mobi file
2) Post process the generated HTML to remove mobipocket specific tags and attributes. For e.g. <mbpage-break/> -> <br style="page-break-after:always/> and so on
There is a new version 0.0.27 (no Windows binaries for this version).

1) Fixed.

2) I removed some of the tags and the attribute you mentioned. But I did not find a list of Mobipocket specific attributes. And can't you just ignore attributes you do not recognize?

Let me know if some more changes should be done to the html file. And a test file is always good to have when fixing these kind of things.
tompe is offline   Reply With Quote
Old 02-09-2008, 11:45 AM   #188
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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks.

Here's the list of custom tags
http://www.mobipocket.com/dev/articl...agref_mobi.xml
Most of them seem to be pretty useless.

Yeah I can ignore unknown tags and attributes, but at least for the few that contain useful information, it's good to convert them.
kovidgoyal is offline   Reply With Quote
Old 02-09-2008, 01:23 PM   #189
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
Thanks.

Here's the list of custom tags
http://www.mobipocket.com/dev/articl...agref_mobi.xml
Most of them seem to be pretty useless.

Yeah I can ignore unknown tags and attributes, but at least for the few that contain useful information, it's good to convert them.
Now I just removed them but I will try to convert them to something useful. But that probably have to be an ongoing activity. When I have an example that gets better with conversion I will add it.
tompe is offline   Reply With Quote
Old 02-10-2008, 12:16 AM   #190
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Hi, tompe!

I have recently been converting .prc (mobipocket) files into .IMP format using your 'mobi2html' and my own perl script. Especially .prc with color illustrations and images.

I too have had to filter/change (I'm not complaining here) mobi specific tags, in particular:

1. My text editor opens the resulting .html as one-line (and word-wrapped). As a result, I like to replace '/div>' with '/div>\n' to get some line-breaks for visual purposes. Makes some things 'line-up' vertically to aid in error-correcting.

2. '<mbp: pagebreak' with '<p style="page-break-before:always' to avoid format-specific tags.

For personal reasons/preferences, I also change:

3. '<body' with '<body style="margin-left:2%; margin-right:2%; text-align:justify' to allow small margins and justified text. For those that do not want this, then it would be easy to change as this would appear in only one place, at the beginning of the file.

4. '<img align="baseline"' with '<img' as the eBook Publisher software I use strangely positions ALL images on the first page with the baseline keyword there.

Please note that to ensure the maximum conversion, I often leave out a leading '<' or trailing '>' as seen above. These replacements above work better by doing this.

By the way, would it be easy to incorporate my 'html2imp.pl' perl script within your 'Mobiperl' so that you can also produce .IMP format ebooks? You could call it 'mobi2imp'. Sorry, but I don't mean to lengthen your to-do list too much.

-Nick

Last edited by nrapallo; 02-10-2008 at 12:19 AM. Reason: typo
nrapallo is offline   Reply With Quote
Old 02-10-2008, 12:53 AM   #191
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by nrapallo View Post
1. My text editor opens the resulting .html as one-line (and word-wrapped).

-Nick
What text editor do you use? Sounds like a Windows (CRLF) vs *nix (LF) EOL char issue.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-10-2008, 06:36 AM   #192
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by DMcCunney View Post
What text editor do you use? Sounds like a Windows (CRLF) vs *nix (LF) EOL char issue.
No, the HTML file is actually just one line. When you generate the HTML from a tree there is no natural places to put end of line so therefore I had not added any newlines. But now I added the suggestion to place a newline after /div>.
tompe is offline   Reply With Quote
Old 02-10-2008, 06:40 AM   #193
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by nrapallo View Post
By the way, would it be easy to incorporate my 'html2imp.pl' perl script within your 'Mobiperl' so that you can also produce .IMP format ebooks? You could call it 'mobi2imp'. Sorry, but I don't mean to lengthen your to-do list too much.
Probably. If you give me the script I will look at it.
tompe is offline   Reply With Quote
Old 02-10-2008, 08:19 AM   #194
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Verson 0.0.28 (no Windows binaries)

Verson 0.0.28 is available at

http://www.ida.liu.se/~tompe/mobiperl/

No Windows binaries for this version. I will do a binary version when more important things have changed or when somebody need the Window binaries.

Changes in 0.0.28:
  • Fixed the substituion of mbppagebreak that was done wrongly
  • Added a newline after /dev> in mobi2html
  • Fixed bug in MobiFile pointed out by Gary Tsang. The cover offset was set to 0 when no cover was available and that made the Kindle reader crash.
  • Fixed html2mobi so that file name is used as title in generated toc if no title tag is available.
Changes in 0.0.27:
  • mobi2html now works with the mobi file specified with a full path
  • MobiPocket specific html removed in mobi2html. --mobihtml to keep it.
tompe is offline   Reply With Quote
Old 02-10-2008, 08:24 AM   #195
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: 73,845
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by tompe View Post
Verson 0.0.28 is available at

http://www.ida.liu.se/~tompe/mobiperl/

No Windows binaries for this version. I will do a binary version when more important things have changed or when somebody need the Window binaries.

Changes in 0.0.28:
  • Fixed the substituion of mbppagebreak that was done wrongly
  • Added a newline after /dev> in mobi2html
  • Fixed bug in MobiFile pointed out by Gary Tsang. The cover offset was set to 0 when no cover was available and that made the Kindle reader crash.
  • Fixed html2mobi so that file name is used as title in generated toc if no title tag is available.
Changes in 0.0.27:
  • mobi2html now works with the mobi file specified with a full path
  • MobiPocket specific html removed in mobi2html. --mobihtml to keep it.
Yes, I do need a new Windows binary. I do use html2mobi. So please come up with a new Windows edition for those of us using Windows. It isn't fair that Windows users get stuck with 2 versions behind.
JSWolf is offline   Reply With Quote
Reply

Tags
mobi2mobi, mobils

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools Jad Kindle Formats 476 03-15-2015 05:51 PM
Tools for Editing Kindle .mobi Files? GJN Kindle Formats 33 12-26-2013 02:05 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 11:49 AM
PRS-500 Perl tools to generate Reader content TadW Sony Reader Dev Corner 0 01-08-2007 05:55 AM
gmail copy (gmcp) - Perl script to copy files to/from Gmail Colin Dunstan Lounge 0 09-04-2004 01:24 PM


All times are GMT -4. The time now is 12:44 PM.


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