EPUB Output: If the output profile is set to one of the Nook profiles, do not use shorthand CSS properties as the Nook cannot handle them.

This commit is contained in:
Kovid Goyal 2014-02-22 08:21:33 +05:30
parent 70779d9ff4
commit 64cb14a094
2 changed files with 8 additions and 2 deletions

View File

@ -54,7 +54,10 @@ class OEBOutput(OutputFormatPlugin):
f.write(raw) f.write(raw)
for item in oeb_book.manifest: for item in oeb_book.manifest:
if not self.opts.expand_css and item.media_type in OEB_STYLES and hasattr(item.data, 'cssText'): if (
not self.opts.expand_css and
item.media_type in OEB_STYLES and hasattr(item.data, 'cssText') and
'nook' not in self.opts.output_profile.short_name):
condense_sheet(item.data) condense_sheet(item.data)
path = os.path.abspath(unquote(item.href)) path = os.path.abspath(unquote(item.href))
dir = os.path.dirname(path) dir = os.path.dirname(path)

View File

@ -368,7 +368,10 @@ OptionRecommendation(name='expand_css',
help=_( help=_(
'By default, calibre will use the shorthand form for various' 'By default, calibre will use the shorthand form for various'
' css properties such as margin, padding, border, etc. This' ' css properties such as margin, padding, border, etc. This'
' option will cause it to use the full expanded form instead.') ' option will cause it to use the full expanded form instead.'
' Note that CSS is always expanded when generating EPUB files'
' with the output profile set to one of the Nook profiles'
' as the Nook cannot handle shorthand CSS.')
), ),
OptionRecommendation(name='page_breaks_before', OptionRecommendation(name='page_breaks_before',