mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
start at enabling some heuristics options by default
This commit is contained in:
parent
9fcf7f84c3
commit
06cbaca2e6
@ -69,6 +69,7 @@ def option_recommendation_to_cli_option(add_option, rec):
|
|||||||
opt = rec.option
|
opt = rec.option
|
||||||
switches = ['-'+opt.short_switch] if opt.short_switch else []
|
switches = ['-'+opt.short_switch] if opt.short_switch else []
|
||||||
switches.append('--'+opt.long_switch)
|
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,
|
attrs = dict(dest=opt.name, help=opt.help,
|
||||||
choices=opt.choices, default=rec.recommended_value)
|
choices=opt.choices, default=rec.recommended_value)
|
||||||
if isinstance(rec.recommended_value, type(True)):
|
if isinstance(rec.recommended_value, type(True)):
|
||||||
|
@ -490,19 +490,19 @@ OptionRecommendation(name='enable_heuristics',
|
|||||||
'heuristic processing to take place.')),
|
'heuristic processing to take place.')),
|
||||||
|
|
||||||
OptionRecommendation(name='markup_chapter_headings',
|
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 '
|
help=_('Detect unformatted chapter headings and sub headings. Change '
|
||||||
'them to h2 and h3 tags. This setting will not create a TOC, '
|
'them to h2 and h3 tags. This setting will not create a TOC, '
|
||||||
'but can be used in conjunction with structure detection to create '
|
'but can be used in conjunction with structure detection to create '
|
||||||
'one.')),
|
'one.')),
|
||||||
|
|
||||||
OptionRecommendation(name='italicize_common_cases',
|
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 '
|
help=_('Look for common words and patterns that denote '
|
||||||
'italics and italicize them.')),
|
'italics and italicize them.')),
|
||||||
|
|
||||||
OptionRecommendation(name='fix_indents',
|
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 '
|
help=_('Turn indentation created from multiple non-breaking space entities '
|
||||||
'into CSS indents.')),
|
'into CSS indents.')),
|
||||||
|
|
||||||
@ -515,7 +515,7 @@ OptionRecommendation(name='html_unwrap_factor',
|
|||||||
'be reduced')),
|
'be reduced')),
|
||||||
|
|
||||||
OptionRecommendation(name='unwrap_lines',
|
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.')),
|
help=_('Unwrap lines using punctuation and other formatting clues.')),
|
||||||
|
|
||||||
OptionRecommendation(name='delete_blank_paragraphs',
|
OptionRecommendation(name='delete_blank_paragraphs',
|
||||||
@ -530,7 +530,7 @@ OptionRecommendation(name='format_scene_breaks',
|
|||||||
'horizontal rules.')),
|
'horizontal rules.')),
|
||||||
|
|
||||||
OptionRecommendation(name='dehyphenate',
|
OptionRecommendation(name='dehyphenate',
|
||||||
recommended_value=False, level=OptionRecommendation.LOW,
|
recommended_value=True, level=OptionRecommendation.LOW,
|
||||||
help=_('Analyze hyphenated words throughout the document. The '
|
help=_('Analyze hyphenated words throughout the document. The '
|
||||||
'document itself is used as a dictionary to determine whether hyphens '
|
'document itself is used as a dictionary to determine whether hyphens '
|
||||||
'should be retained or removed.')),
|
'should be retained or removed.')),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user