View Single Post
Old 03-05-2011, 11:43 PM   #1
getajob
Junior Member
getajob began at the beginning.
 
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:

h1. Header 1

p(#fn1r). Here’s a link[1] which should jump to the end footnote.

h2. Header 2

The first *Robin Hobb* trilogy, the _Farseer Trilogy,_ took place in the ??Six Duchies??. It is the tale of +FitzChivalry+ Farseer.

p=. !E:/_BOOKS/Images/00004.jpg!

The first Robin Hobb trilogy, the Farseer Trilogy, took place in the Six Duchies.

h3. Header 3

Now some ^superscript^ followed by ~subscript~ and back to normal.

@This should be in Code format.@
@To see what mono font looks like.@

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.

* Bullet 1
* Bullet 2
* Bullet 3

# Numbered 1
# Numbered 2
# Numbered 3

And now here follows a horizontal rule

<hr>

fn1. A footnote is here, which should jump back to first paragraph link.

When selecting here. "RETURN":#fn1r

p<. Left ??justified??

p=. Center *justified*

p>. Right _justified_

p<>. _*This should be fully justified and in bold and italics. This should be fully justified and in bold and italics. This should be fully justified and in bold and italics.*_

Here is my log file from Calibre
Spoiler:

Convert book 1 of 1 (Textile sample conversion)
Resolved conversion options
calibre version: 0.7.48
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': u'original',
'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\\s+', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': u'D:/Calibre Library/debug',
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_split_on_page_breaks': False,
'enable_heuristics': False,
'epub_flatten': False,
'extra_css': None,
'extract_to': None,
'fix_indents': True,
'flow_size': 260,
'font_size_mapping': None,
'format_scene_breaks': True,
'formatting_type': u'textile',
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x046DB8F0>,
'insert_blank_line': False,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markdown_disable_toc': False,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.OutputProfile object at 0x046DBAD0>,
'page_breaks_before': u"//*[name()='h1' or name()='h2']",
'paragraph_type': u'off',
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'preserve_spaces': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': 'c:\\docume~1\\johnbr~1\\locals~1\\temp\\calibre_0 .7.48_tmp_oqc5pb\\calibre_0.7.48_pe3ac_.opf',
'remove_first_image': False,
'remove_paragraph_spacing': True,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'txt_in_remove_indents': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: TXT Input running
on D:\Calibre Library\Unknown\Textile sample conversion (155)\Textile sample conversion - Unknown.txt
Reading text from file...
Detected input encoding as windows-1252 with a confidence of 50.0%
Running text through textile conversion...
Language not specified
Creator not specified
Building file list...
Found files...
HTMLFile:0:a:\Calibre Library\Unknown\Textile sample conversion (155)\index.html
Normalizing filename cases
Rewriting HTML links
Parsing index.html ...
Initial parse failed:
Traceback (most recent call last):
File "site-packages\calibre\ebooks\oeb\base.py", line 881, in first_pass
File "lxml.etree.pyx", line 2532, in lxml.etree.fromstring (src/lxml/lxml.etree.c:48634)
File "parser.pxi", line 1545, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:72245)
File "parser.pxi", line 1417, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:71041)
File "parser.pxi", line 898, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:67581)
File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:64257)
File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:65178)
File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64521)
XMLSyntaxError: PCDATA invalid Char value 25, line 4, column 53

Parsing file 'index.html' as HTML
Forcing index.html into XHTML namespace
Input debug saved to: D:\Calibre Library\debug\input
Parsed HTML written to: D:\Calibre Library\debug\parsed
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Structured HTML written to: D:\Calibre Library\debug\structure
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Parsing stylesheet.css ...
Processed HTML written to: D:\Calibre Library\debug\processed
Creating EPUB Output...
Looking for large trees in index.html...
No large trees found
Generating default cover
This EPUB file has no Table of Contents. Creating a default TOC
EPUB output written to c:\docume~1\johnbr~1\locals~1\temp\calibre_0.7.48_ tmp_oqc5pb\calibre_0.7.48_wlo7ms.epub

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
getajob is offline   Reply With Quote