__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
from calibre.ebooks.txt.processor import convert_basic, convert_markdown, separate_paragraphs_single_line, separate_paragraphs_print_formatted, preserve_spaces
from calibre import _ent_pat, xml_entity_to_unicode
class TXTInput(InputFormatPlugin):
name = 'TXT Input'
author = 'John Schember'
description = 'Convert TXT files to HTML'
file_types = set([
'txt'])
options = set([
OptionRecommendation(name = 'single_line_paras', recommended_value = False, help = _('Normally calibre treats blank lines as paragraph markers. With this option it will assume that every line represents a paragraph instead.')),
OptionRecommendation(name = 'print_formatted_paras', recommended_value = False, help = _('Normally calibre treats blank lines as paragraph markers. With this option it will assume that every line starting with an indent (either a tab or 2+ spaces) represents a paragraph. Paragraphs end when the next line that starts with an indent is reached.')),
OptionRecommendation(name = 'preserve_spaces', recommended_value = False, help = _('Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.')),
OptionRecommendation(name = 'markdown', recommended_value = False, help = _('Run the text input through the markdown pre-processor. To learn more about markdown see') + ' http://daringfireball.net/projects/markdown/'),
OptionRecommendation(name = 'markdown_disable_toc', recommended_value = False, help = _('Do not insert a Table of Contents into the output text.'))])