03-05-2011, 11:43 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2010
Location: Australia
Device: Kindle 3, iPhone 3G, iPad 2 (on order)
|
Trying to use Textile processing
I have spent hours trying to convert TXT to EPUB by marking it up with TEXTILE tags.
The resulting EPUB file shows no signs of any TEXTILE processing whatsoever. No headings, no linking, no italics or bold. Nothing. I am now admitting defeat. I am posting here in the hope that someone can tell me what is wrong. I am running Calbre 0.7.48 on Windows XP SP3. Basically I have set the TXT input processing to Paragraph style: off Formatting style: textile Here is my input file (I stole this from Perkins): Spoiler:
Here is my log file from Calibre Spoiler:
I find the "initial parse failed" error message worrying but I cannot see a cause for this. I have processed txt to epub in the past using MARKDOWN with acceptable results, but since I upgraded to 0.7.48, markdown is not working either. Any ideas? John |
03-06-2011, 06:55 AM | #2 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Just updated to 7.48 (from .46), and conversion works fine here.
Have you tried restarting machine? Edit: Win 7 Last edited by Perkin; 03-06-2011 at 07:05 AM. |
Advert | |
|
03-06-2011, 08:16 AM | #3 | |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
The conversion is resulting correctly for me too. I would try: reboot your computer, uninstall calibre, reboot, reinstall calibre, reboot, try converting.
Quote:
|
|
03-06-2011, 09:29 PM | #4 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2010
Location: Australia
Device: Kindle 3, iPhone 3G, iPad 2 (on order)
|
Quote:
I had already re-installed Calibre and re-booted but just to be sure I did this again (Uninstall Calibre, re-boot, install Calibre, re-boot). I have changed the <hr> to <hr /> but I still get no joy what-so-ever. Here is my new source file: Spoiler:
Here is my Calibre job log: Spoiler:
Here is a link to the epub file that gets output http://dl.dropbox.com/u/18750031/Tex...20Unknown.epub Although the job log says Code:
Running text through textile conversion... There are two .pyo files in C:\Program Files\Calibre2\Lib\site-packages\calibre\ebooks\textile so I seem to have the textile python executables installed. Do you have any other ideas of what else I can check? As you can see, I ran this with debug on. John |
|
03-06-2011, 11:30 PM | #5 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
The epub you attached looked very close to what I got when I left both text input settings to auto. My experiment: I have never used textile. I took your source and added it to calibre. I converted to ePub using paragraph style - Off, Formatting style - Textile. I attached the resultant epub, which looks great except I didn't have the image. I also attached the txt file I used for the source. I left all of my default settings alone, hopefully they haven't skewed it too much. In case it might help, here is my job details info. Spoiler:
Good Luck. |
|
Advert | |
|
03-07-2011, 05:44 AM | #6 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
dwanthy, that comes out nearly all correct, the only problem is the pre section, which is missing spaces (also incorrect in posts), should be
Code:
pre. There was a man from hither, Who, when he began to shiver, He gave a cough, His leg dropped off, And floated down the river. Another problem is some of the accented characters, which is just the coding,being different. @getajob Have you tried setting the 'Input character encoding' in the conversion-Look'n'feel, try converting with utf-8, and if that doesn't work try again with cp1252 I had a similar problem with a version just after Textile was introduced, but was the character encoding which was causing it. Edit: If I remember, I was converting with cp1252 but the file was utf-8. Last edited by Perkin; 03-07-2011 at 05:47 AM. |
03-07-2011, 07:15 AM | #7 | ||
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2010
Location: Australia
Device: Kindle 3, iPhone 3G, iPad 2 (on order)
|
Quote:
Good idea. I renamed my configuration folder and also deleted and reinstalled Calibre. I changed (only) the TXT input processing to Paragraph style: off Formatting style: textile Otherwise it is a vanilla Calibre installation now. Disappointingly I get exactly the same non-textile-processed result. I tried a fresh install on a Windows XP desktop that has never had Calibre on it before. I get the same non-textile-processed result yet again. I then tried installing on a new Windows 7 Pro laptop. Still no go - and I was confident that this would work for sure. Quote:
Good idea. I changed Input Character Coding to 'utf-8' in Look & Feel but all this seemed to was to do was put two black-diamond-question-marks before the 'h1. Header 1' which was unprocessed....(see attached result below) Is there any easy way to determine what your Input Character Coding actually is? The only markup that is working is the '<hr />' - maybe this is a clue... Thanks for your help so far. Any more things I can try? |
||
03-07-2011, 07:23 AM | #8 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
03-07-2011, 07:31 AM | #9 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Also can you turn on having it give debug output. Then zip up and attach the debug output folder. I'm not sure how to do that with the GUI... On the command line you would use the --debug switch.
|
03-07-2011, 08:19 AM | #10 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2010
Location: Australia
Device: Kindle 3, iPhone 3G, iPad 2 (on order)
|
OK. It's after midnight here so I'll give you my input file, the last job log & the debug directory. I am calling it a night... Thanks for your help.
|
03-07-2011, 09:15 AM | #11 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Your file didn't convert here.
My text editor (EditPad Pro) is saying that the encoding is Unicode-UTF-16 Little Endian, perhaps that's something to do with it? Try copying the whole text and pasting it into notepad - resaving and the add that to calibre and try again. I did that and it then converted properly. What text editor are you using? Edit: If you convert your file with 'UTF-16' as the input character encoding, it also converts properly here. Last edited by Perkin; 03-07-2011 at 09:27 AM. |
03-07-2011, 09:15 AM | #12 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
The good news is when I use your supplied txt file I get the exact same results you do. Notepad++ says it is encoded UCS-2 Little Endian. After I save it as UTF-8 encoded I get the expected conversion.
|
03-07-2011, 05:43 PM | #13 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2010
Location: Australia
Device: Kindle 3, iPhone 3G, iPad 2 (on order)
|
Problem solved.
Thanks people you have solved my problem. (Thank God, it was driving me nuts...)I am using WordPad but at some stage of the journey I decided to 'Save As' in what WordPad calls Unicode.
Quote:
WordPad has four 'Save As' options: ANSI, Unicode, Unicode big endian and UTF-8. Notepad is the same. Using ANSI was giving me the annoying black-diamond-with-question-marks for the odd character so I changed to Unicode encoding. SOLUTION: Save your text in UTF-8 format using the 'Save As' dialog of WordPad or Notepad. In Look & Feel, set Input character encoding to UTF-8 In TXT Input, set Paragraph style to off and set Formatting style to textile. If you have to use Unicode, then set Input character encoding to UTF-16 Using ANSI is not recommended since it will give you black-diamond-with-question-marks for the odd character (don't ask me why...) |
|
03-07-2011, 08:38 PM | #14 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
You're mostly correct except for one part of your solution:
Quote:
UTF-8 is unicode, so there is no need to use UTF-16 ever. UTF-8 is basically the web and ebook standard for Unicode and is always the best file encoding to use. Just make sure your original file is saved as UTF-8. Regarding your statement on ANSI, 'ANSI' shouldn't even really be called an encoding - ANSI really means 'encode this based on what country I live in, but make sure only people from the same country as me can read it'. Why Microsoft persists in defaulting all their products to ANSI I'll never understand, but it's the root cause of most people's encoding problems. It probably wouldn't be terribly difficult to add support for reading the Unicode BOM at the beginning of the file so that Calibre can figure out UTF-8/16/32/LE/BE on it's own.... Last edited by ldolse; 03-07-2011 at 11:03 PM. |
|
03-07-2011, 09:00 PM | #15 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Processing on the Kindle 3 | cow_trix | Amazon Kindle | 41 | 05-17-2011 03:22 AM |
Textile conversion broken in 7.45 | Perkin | Conversion | 7 | 02-12-2011 06:36 PM |
New edition of The Textile Planet; read chapter one for free [see post #14] | suelange | Self-Promotions by Authors and Publishers | 14 | 09-29-2010 10:33 AM |
Comic File Processing | wonderboy | Other formats | 1 | 08-08-2009 04:17 AM |
Perl processing | alexxxm | Sony Reader | 3 | 11-26-2007 06:13 AM |