![]() |
#391 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 72,047
Karma: 307935764
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
As for the simplest way to fix a Mobi, it depends on how much tweaking you want to do. Personally, I prefer to use MobiUnpack, tweak the code, and then run through KindleGen (& KindleStrip). That way my end result is as close as possible to the original. |
|
![]() |
![]() |
![]() |
#392 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 492042
Join Date: Feb 2012
Device: kindle
|
There's a separate program I use to "Beautify" HTML code that comes out all in one line.
http://prettydiff.com/ JavaScript is markup_beauty.js (I think) which I run using this file named wsh.wsf (I'll attach it here. You'll need to rename it since forum didn't like my .wsf file but accepted a .txt file) and the command line to run it is: cscript wsh.wsf /source:"name_of_your_file.html" /html:true (on Windows) I'll attach the markup_beauty.js file too. (Again you'll have to rename it from .txt for the same reason.) I'm not sure if markup_beauty.js relies on other files. If so they are at http://prettydiff.com/documentation.php [EDIT: It's not clear that the licences for wsh.wsf and markup_beauty.js allow redistribution. Attachments deleted. They can be download from the page linked above. The Mods.] Last edited by pdurrant; 06-21-2012 at 04:42 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#393 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,662
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
E:\E-Books\Sorted\Kindle\wsh.wsf(292, 18) Microsoft JScript runtime error: 'undefined' is null or not an object |
|
![]() |
![]() |
![]() |
#394 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 492042
Join Date: Feb 2012
Device: kindle
|
OK I gave it a test and found I need three files:
Then I used the command: cscript wsh.wsf /source:"Hello.htm" /html:true > "HelloPretty.htm" |
![]() |
![]() |
![]() |
#395 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
@deleyd I tested the prettydiff scripts and noticed that there seems to be a problem with accented characters, which are garbled in the output file. (English text should be fine, though.) Babelpad also reported an error message when I tried to open the output file, which is usually an indicator of invalid Unicode sequences in a file. Last edited by Doitsu; 06-22-2012 at 06:15 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#396 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 72,047
Karma: 307935764
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
I do just that in my text editor. I think it's best for the mobiunpack to do as little massaging of the HTML as possible.
|
![]() |
![]() |
![]() |
#397 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,527
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
That might alter the meaning if the two consecutive brackets belong to inline tags, since the inserted linebreak equals a space.
I would insert a linebreak only before "<h", "<p" or "<div", for instance. |
![]() |
![]() |
![]() |
#398 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 72,047
Karma: 307935764
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
![]() |
![]() |
![]() |
#399 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,662
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
You also could put a line end at </p> </h#> </div> and any other </ that's should be at the end of a line. Both ways would give most lines correctly separated. |
|
![]() |
![]() |
![]() |
#400 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#401 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,662
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#402 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21
Karma: 244219
Join Date: Jul 2011
Device: K3
|
I use a binary search (for "<p") and replace (with "\x0d\x0a<p") to prepare one-lined html files for viewing/correcting/editing in my favorite editor.
I've also had issues with ascii/unicode/utf-8 characters not being preserved across edits and producing the ebook - I now convert all utf-8 codes to html codes (e.g. e2809c and e2809d to “ and ” or c3a9 to é ) - it makes the html source a little bit harder to proofread. |
![]() |
![]() |
![]() |
#403 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jul 2012
Device: None
|
Has anybody had any trouble with the book covers? Upon unpacking a mobi file and packing it back using Kindlegen, the book cover is getting lost. Looking at the unpacked files, the cover is properly being extracted. Kindlegen is also throwing a warning saying no cover found.
I've had this problem on a few books now. Anybody have any ideas as to what could be going on? |
![]() |
![]() |
![]() |
#404 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#405 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jul 2012
Device: None
|
Quote:
Code:
<meta name="EmbeddedCover" content="images/image00002.jpeg" /> Code:
Warning(prcgen):W14016: Cover not specified Other files have no mention of the cover in the OPF file, yet the original mobi file contains a cover which is being displayed properly in the reader. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 04:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 07:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 01:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 12:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 09:28 AM |