mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk.
This commit is contained in:
commit
99c516d852
@ -1010,7 +1010,10 @@ class Manifest(object):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
data = self.data
|
data = self.data
|
||||||
if isinstance(data, etree._Element):
|
if isinstance(data, etree._Element):
|
||||||
return xml2str(data, pretty_print=self.oeb.pretty_print)
|
ans = xml2str(data, pretty_print=self.oeb.pretty_print)
|
||||||
|
if self.media_type in OEB_DOCS:
|
||||||
|
ans = re.sub(r'<(div|a)([^>]*)/>', r'<\1\2></\1>', ans)
|
||||||
|
return ans
|
||||||
if isinstance(data, unicode):
|
if isinstance(data, unicode):
|
||||||
return data.encode('utf-8')
|
return data.encode('utf-8')
|
||||||
if hasattr(data, 'cssText'):
|
if hasattr(data, 'cssText'):
|
||||||
|
@ -78,6 +78,7 @@ class DetectStructure(object):
|
|||||||
page_break_after = 'display: block; page-break-after: always'
|
page_break_after = 'display: block; page-break-after: always'
|
||||||
for item, elem in self.detected_chapters:
|
for item, elem in self.detected_chapters:
|
||||||
text = u' '.join([t.strip() for t in elem.xpath('descendant::text()')])
|
text = u' '.join([t.strip() for t in elem.xpath('descendant::text()')])
|
||||||
|
text = text.strip()
|
||||||
self.log('\tDetected chapter:', text[:50])
|
self.log('\tDetected chapter:', text[:50])
|
||||||
if chapter_mark == 'none':
|
if chapter_mark == 'none':
|
||||||
continue
|
continue
|
||||||
|
@ -4,3 +4,5 @@
|
|||||||
|
|
||||||
E-book Conversion
|
E-book Conversion
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
This section is under construction. In the meantime, you can see some documentation of the command line interface to conversion at :ref:`ebook-convert`.
|
||||||
|
@ -123,7 +123,9 @@ def generate_ebook_convert_help():
|
|||||||
''')
|
''')
|
||||||
c = 0
|
c = 0
|
||||||
sections = []
|
sections = []
|
||||||
|
toc = {}
|
||||||
for ip in input_format_plugins():
|
for ip in input_format_plugins():
|
||||||
|
toc[ip.name] = []
|
||||||
for op in output_format_plugins():
|
for op in output_format_plugins():
|
||||||
c += 1
|
c += 1
|
||||||
idr = 'ebook-convert-sec-'+str(c)
|
idr = 'ebook-convert-sec-'+str(c)
|
||||||
@ -131,7 +133,7 @@ def generate_ebook_convert_help():
|
|||||||
section = '.. _'+idr+':||||'
|
section = '.. _'+idr+':||||'
|
||||||
section += title+'||'+\
|
section += title+'||'+\
|
||||||
'-------------------------------------------------------'
|
'-------------------------------------------------------'
|
||||||
#ans += ' * :ref:`'+idr+'`\n'
|
toc[ip.name].append([idr, op.name])
|
||||||
parser, plumber = create_option_parser(['ebook-convert',
|
parser, plumber = create_option_parser(['ebook-convert',
|
||||||
'dummyi.'+list(ip.file_types)[0],
|
'dummyi.'+list(ip.file_types)[0],
|
||||||
'dummyo.'+op.file_type, '-h'], default_log)
|
'dummyo.'+op.file_type, '-h'], default_log)
|
||||||
@ -144,7 +146,14 @@ def generate_ebook_convert_help():
|
|||||||
|
|
||||||
sections.append(section)
|
sections.append(section)
|
||||||
|
|
||||||
ans += '||||'+'||||'.join(sections)
|
toct = '||||'
|
||||||
|
for ip in sorted(toc):
|
||||||
|
toct += ' * '+ip+'||||'
|
||||||
|
for idr, name in toc[ip]:
|
||||||
|
toct += ' * :ref:`'+name +' <'+idr+'>`||'
|
||||||
|
toct += '||'
|
||||||
|
|
||||||
|
ans += toct+'||||'+'||||'.join(sections)
|
||||||
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user