EPUB output:Set --remove-paragraph-spacing to off by default

This commit is contained in:
Kovid Goyal 2009-01-19 11:30:47 -08:00
parent 383d33e6aa
commit e3115f03cf
3 changed files with 3 additions and 2 deletions

View File

@ -156,7 +156,7 @@ to auto-generate a Table of Contents.
help=_('Set the right margin in pts. Default is %default')) help=_('Set the right margin in pts. Default is %default'))
layout('base_font_size2', ['--base-font-size'], default=12.0, layout('base_font_size2', ['--base-font-size'], default=12.0,
help=_('The base font size in pts. Default is %defaultpt. Set to 0 to disable rescaling of fonts.')) help=_('The base font size in pts. Default is %defaultpt. Set to 0 to disable rescaling of fonts.'))
layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=True, layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=False,
help=_('Remove spacing between paragraphs. Will not work if the source file forces inter-paragraph spacing.')) help=_('Remove spacing between paragraphs. Will not work if the source file forces inter-paragraph spacing.'))
layout('preserve_tag_structure', ['--preserve-tag-structure'], default=False, layout('preserve_tag_structure', ['--preserve-tag-structure'], default=False,
help=_('Preserve the HTML tag structure while splitting large HTML files. This is only neccessary if the HTML files contain CSS that uses sibling selectors. Enabling this greatly slows down processing of large HTML files.')) help=_('Preserve the HTML tag structure while splitting large HTML files. This is only neccessary if the HTML files contain CSS that uses sibling selectors. Enabling this greatly slows down processing of large HTML files.'))

View File

@ -52,6 +52,7 @@ def convert(opts, recipe_arg, notification=None):
print 'Generating epub...' print 'Generating epub...'
opts.encoding = 'utf-8' opts.encoding = 'utf-8'
opts.remove_paragraph_spacing = True
html2epub(opf, opts, notification=notification) html2epub(opf, opts, notification=notification)

View File

@ -848,7 +848,7 @@ class Processor(Parser):
# Workaround for anchor rendering bug in ADE # Workaround for anchor rendering bug in ADE
css += '\n\na { color: inherit; text-decoration: inherit; cursor: default; }\na[href] { color: blue; text-decoration: underline; cursor:pointer; }' css += '\n\na { color: inherit; text-decoration: inherit; cursor: default; }\na[href] { color: blue; text-decoration: underline; cursor:pointer; }'
if self.opts.remove_paragraph_spacing: if self.opts.remove_paragraph_spacing:
css += '\n\np {text-indent: 2em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}' css += '\n\np {text-indent: 1.5em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}'
if self.opts.override_css: if self.opts.override_css:
css += '\n\n' + self.opts.override_css css += '\n\n' + self.opts.override_css
self.override_css = self.css_parser.parseString(self.preprocess_css(css)) self.override_css = self.css_parser.parseString(self.preprocess_css(css))