From 06cbaca2e6160b83467c16c5737462a4c312816a Mon Sep 17 00:00:00 2001 From: ldolse Date: Wed, 19 Jan 2011 22:21:11 +0800 Subject: [PATCH] start at enabling some heuristics options by default --- src/calibre/ebooks/conversion/cli.py | 1 + src/calibre/ebooks/conversion/plumber.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index b5c057b0f9..8cd4f124d5 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -69,6 +69,7 @@ def option_recommendation_to_cli_option(add_option, rec): opt = rec.option switches = ['-'+opt.short_switch] if opt.short_switch else [] switches.append('--'+opt.long_switch) + flip_switches = ['italicize_common_cases', 'markup_chapter_headings', 'unwrap_lines', 'dehyphenate', 'fix_indents'] attrs = dict(dest=opt.name, help=opt.help, choices=opt.choices, default=rec.recommended_value) if isinstance(rec.recommended_value, type(True)): diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index 04ee892c19..7dd977cd7b 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -490,19 +490,19 @@ OptionRecommendation(name='enable_heuristics', 'heuristic processing to take place.')), OptionRecommendation(name='markup_chapter_headings', - recommended_value=False, level=OptionRecommendation.LOW, + recommended_value=True, level=OptionRecommendation.LOW, help=_('Detect unformatted chapter headings and sub headings. Change ' 'them to h2 and h3 tags. This setting will not create a TOC, ' 'but can be used in conjunction with structure detection to create ' 'one.')), OptionRecommendation(name='italicize_common_cases', - recommended_value=False, level=OptionRecommendation.LOW, + recommended_value=True, level=OptionRecommendation.LOW, help=_('Look for common words and patterns that denote ' 'italics and italicize them.')), OptionRecommendation(name='fix_indents', - recommended_value=False, level=OptionRecommendation.LOW, + recommended_value=True, level=OptionRecommendation.LOW, help=_('Turn indentation created from multiple non-breaking space entities ' 'into CSS indents.')), @@ -515,7 +515,7 @@ OptionRecommendation(name='html_unwrap_factor', 'be reduced')), OptionRecommendation(name='unwrap_lines', - recommended_value=False, level=OptionRecommendation.LOW, + recommended_value=True, level=OptionRecommendation.LOW, help=_('Unwrap lines using punctuation and other formatting clues.')), OptionRecommendation(name='delete_blank_paragraphs', @@ -530,7 +530,7 @@ OptionRecommendation(name='format_scene_breaks', 'horizontal rules.')), OptionRecommendation(name='dehyphenate', - recommended_value=False, level=OptionRecommendation.LOW, + recommended_value=True, level=OptionRecommendation.LOW, help=_('Analyze hyphenated words throughout the document. The ' 'document itself is used as a dictionary to determine whether hyphens ' 'should be retained or removed.')),