mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #7877 (margin option in epub to mobi conversions)
This commit is contained in:
parent
0e70bb8b59
commit
524e9f4def
@ -184,7 +184,7 @@ class MobiMLizer(object):
|
|||||||
para.attrib['value'] = str(istates[-2].list_num)
|
para.attrib['value'] = str(istates[-2].list_num)
|
||||||
elif tag in NESTABLE_TAGS and istate.rendered:
|
elif tag in NESTABLE_TAGS and istate.rendered:
|
||||||
para = wrapper = bstate.nested[-1]
|
para = wrapper = bstate.nested[-1]
|
||||||
elif left > 0 and indent >= 0:
|
elif not self.opts.mobi_ignore_margins and left > 0 and indent >= 0:
|
||||||
ems = self.profile.mobi_ems_per_blockquote
|
ems = self.profile.mobi_ems_per_blockquote
|
||||||
para = wrapper = etree.SubElement(parent, XHTML('blockquote'))
|
para = wrapper = etree.SubElement(parent, XHTML('blockquote'))
|
||||||
para = wrapper
|
para = wrapper
|
||||||
|
@ -39,6 +39,12 @@ class MOBIOutput(OutputFormatPlugin):
|
|||||||
OptionRecommendation(name='personal_doc', recommended_value='[PDOC]',
|
OptionRecommendation(name='personal_doc', recommended_value='[PDOC]',
|
||||||
help=_('Tag marking book to be filed with Personal Docs')
|
help=_('Tag marking book to be filed with Personal Docs')
|
||||||
),
|
),
|
||||||
|
OptionRecommendation(name='mobi_ignore_margins',
|
||||||
|
recommended_value=False,
|
||||||
|
help=_('Ignore margins in the input document. If False, then '
|
||||||
|
'the MOBI output plugin will try to convert margins specified'
|
||||||
|
' in the input document, otherwise it will ignore them.')
|
||||||
|
),
|
||||||
])
|
])
|
||||||
|
|
||||||
def check_for_periodical(self):
|
def check_for_periodical(self):
|
||||||
|
@ -25,6 +25,7 @@ class PluginWidget(Widget, Ui_Form):
|
|||||||
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||||
Widget.__init__(self, parent,
|
Widget.__init__(self, parent,
|
||||||
['prefer_author_sort', 'rescale_images', 'toc_title',
|
['prefer_author_sort', 'rescale_images', 'toc_title',
|
||||||
|
'mobi_ignore_margins',
|
||||||
'dont_compress', 'no_inline_toc', 'masthead_font','personal_doc']
|
'dont_compress', 'no_inline_toc', 'masthead_font','personal_doc']
|
||||||
)
|
)
|
||||||
self.db, self.book_id = db, book_id
|
self.db, self.book_id = db, book_id
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Kindle options</string>
|
<string>Kindle options</string>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="7" column="0">
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -114,6 +114,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_mobi_ignore_margins">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore &margins</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user