12-18-2008, 07:45 PM | #1 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
LIT output
Hot off the digital presses, Kovid has just released calibre version 0.4.117, which integrates my LIT-generation support. For now, LIT-generation is available only on the command-line. For your command-lining pleasure, calibre provides two new tools: 'any2lit', which works basically like 'any2epub' and will convert just about anything to a LIT e-book; and 'oeb2lit', which more-or-less directly encapsulates OEBPS 1.x or 2.0 content into an OEBPS 1.x LIT e-book.
The tools have most of the features you would expect, and have the following shortcomings you might not:
Let us know of any improvements you'd like to see, and happy converting! (P.S. to a moderator -- perhaps this should be made sticky?) |
12-18-2008, 09:04 PM | #2 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
llsram, Great news! I'm glad LIT support made it into calibre.
Anyhow I've already got to do some testing. I've created two LIT files one for MOBI and one from HTML. The MOBI causes MSReader to crash and the HTML version creates a blank LIT file. I've attached the LIT files, MOBI file, the HTML file, and the command line used to create the LIT from HTML file. =X= |
Advert | |
|
12-18-2008, 09:55 PM | #3 | |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
Ok, so another short-coming -- does not yet work on Windows. To keep you interested while I track down the problem, attached is what the "any2lit" converted Mobipocket book is supposed to look like. |
|
12-18-2008, 11:19 PM | #4 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
|
12-19-2008, 12:14 AM | #5 | |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Quote:
BTW I took a look at the LIT file you posted. It looks like the links do not work on the LIT file. I checked the MOBI and they do work. Also there are issues with the CSS. I suspect this is because you are converting to ePUB first then to LIT. ePUB uses CSS2 I don't know what version LIT supports, but CSS2 is stricter than CSS1. (Note the CSS problem is caused because CSS2 does not allow styles to start with a number, where this was valid in CSS1) =X= |
|
Advert | |
|
12-19-2008, 02:16 AM | #6 | |||
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
Quote:
Quote:
|
|||
12-19-2008, 07:17 AM | #7 |
Wizard
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
You can detect endianness at runtime. Grabbed from some random page:
Code:
Uint32 Value32; Uint8 *VPtr = (Uint8 *)&Value32; VPtr[0] = VPtr[1] = VPtr[2] = 0; VPtr[3] = 1; if(Value32 == 1) printf("I'm big endian\n"); else printf("I'm little endian\n"); |
12-19-2008, 03:13 PM | #8 | |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Ah well yes, it was late I see the sarcasm now .
My aplogoizes I did not mean to rehash known issues. Quote:
=X= |
|
12-22-2008, 11:12 PM | #9 |
Enthusiast
Posts: 31
Karma: 289
Join Date: Dec 2008
Location: Ontario Canada
Device: PRS700
|
yikes i'm scared to even ask a question
Someone emailed me a LIT file, can I use Calibre to convert it to something the Sony PRS 700 can read? |
12-22-2008, 11:14 PM | #10 |
Grand Sorcerer
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
|
01-13-2009, 11:52 AM | #11 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Last night I integrated any2lit on BookCreator. I've noticed that the final LIT files are not utilizing the style sheet. And as a result do not format as expected.
I'm not sure if it's a result of LIT or the opf that is built, here is why. As a test I also decompiled the LIT file and created a mobi file with mobigen using the opf file. And the mobi file also did not use the style sheets. At this point I'll admit I have no clue what I'm talking about, I just know when I do the above step with properly formatted LIT or MOBI files using the opf file seems to generate the expected results. Also again on the TOC topic. I know you mentioned you have no intention of adding the level of support that exist for any2lrf or any2epub, but can you add a switch option where the user can pass in their own HREF to a toc element in the opf file. That is how WordRMR handles it and it works for the most part and is a simple solution. =X= |
01-13-2009, 12:12 PM | #12 | |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
As for your two specific issues -- MSReader should be picking up on an included stylesheet, with the caveat that MSReader doesn't support any contextual selectors. If you post one of the created LIT files I can hopefully figure out what's going on. The TOC stuff I'm not 100% sure how to handle... If you generate your own OPF, then you can have a //guide/reference[@type="toc"] which MSReader will just pick up on. If you're letting any2* generate your OPF, I'm less sure... Kovid has been handling that layer, but I believe it just means adding an option to any2epub. I'll take a look at that this evening, as it would definitely be useful for Mobipocket support as well. |
|
01-13-2009, 01:05 PM | #13 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
@llasram; Sorry for that last post as I did not mean to say that you did not have any intention to produce quality LIT. I was in particularly referencing the creation of the TOC. In a previous exchange between you and I you mentioned you did not now how to handle the TOC and where not worried about it. Now I'm realizing you just meant to put it off until a solution came to mind.
I'd also like to reassure you it was not a mistake to release the LIT support prematurely. You mentioned it was in beta and I understand that. I just thought I was being helpful buy providing you some feedback. My apologized is I came off the wrong way. How does that saying go "The way to hell is paved with good intentions" I've attached both the LIT file and the HTML file that was used to create the LIT =X= |
01-13-2009, 07:16 PM | #14 | |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
The CSS issue... well, there are just so many ways something can go wrong. The CSS isn't being picked up in MSReader because I had a bug where I wasn't properly serializing relative URIs in LIT's compressed HTML format. If you extract the HTML then try to open it in a Web browser, the CSS wouldn't be picked up because I was switching the 'type' attribute of stylesheet-referencing <link/> tags to the OEBPS 1.x specific 'text/x-oeb1-css'. Then mobigen doesn't pick up the CSS because it can't handle (correctly!) URI-encoded filenames. I've pushed fixes for the first two up to Kovid, but the mobigen issue is actually a bug in mobigen... You can report it to them, or just wait a few weeks for oeb2mobi/any2mobi . |
|
01-14-2009, 02:29 AM | #15 | ||
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Quote:
Quote:
Thank you =X= |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LRF output | kovidgoyal | Calibre | 873 | 04-06-2010 02:32 PM |
FB2 output | KarateMonkey | Calibre | 0 | 03-14-2010 07:47 PM |
Trying to get consistent look to all output | daveps | Calibre | 0 | 03-08-2010 02:18 PM |
Converting LIT to LRF Woes (or: Trouble with Images in LIT Files) | JEMelby | Sony Reader | 0 | 07-27-2007 09:18 PM |
converting lit html output into one big file for BD | Dave Berk | Sony Reader | 15 | 03-29-2007 10:02 PM |