mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Start work on KF8 writer
This commit is contained in:
parent
07634194d0
commit
63d578f99b
@ -153,11 +153,22 @@ class MOBIOutput(OutputFormatPlugin):
|
|||||||
|
|
||||||
def convert(self, oeb, output_path, input_plugin, opts, log):
|
def convert(self, oeb, output_path, input_plugin, opts, log):
|
||||||
self.log, self.opts, self.oeb = log, opts, oeb
|
self.log, self.opts, self.oeb = log, opts, oeb
|
||||||
|
|
||||||
|
kf8 = self.create_kf8()
|
||||||
|
self.write_mobi(input_plugin, output_path, kf8)
|
||||||
|
|
||||||
|
def create_kf8(self):
|
||||||
|
from calibre.ebooks.mobi.writer8.main import KF8Writer
|
||||||
|
return KF8Writer(self.oeb, self.opts)
|
||||||
|
|
||||||
|
def write_mobi(self, input_plugin, output_path, kf8):
|
||||||
from calibre.ebooks.mobi.mobiml import MobiMLizer
|
from calibre.ebooks.mobi.mobiml import MobiMLizer
|
||||||
from calibre.ebooks.oeb.transforms.manglecase import CaseMangler
|
from calibre.ebooks.oeb.transforms.manglecase import CaseMangler
|
||||||
from calibre.ebooks.oeb.transforms.rasterize import SVGRasterizer, Unavailable
|
from calibre.ebooks.oeb.transforms.rasterize import SVGRasterizer, Unavailable
|
||||||
from calibre.ebooks.oeb.transforms.htmltoc import HTMLTOCAdder
|
from calibre.ebooks.oeb.transforms.htmltoc import HTMLTOCAdder
|
||||||
from calibre.customize.ui import plugin_for_input_format
|
from calibre.customize.ui import plugin_for_input_format
|
||||||
|
|
||||||
|
opts, oeb = self.opts, self.oeb
|
||||||
if not opts.no_inline_toc:
|
if not opts.no_inline_toc:
|
||||||
tocadder = HTMLTOCAdder(title=opts.toc_title, position='start' if
|
tocadder = HTMLTOCAdder(title=opts.toc_title, position='start' if
|
||||||
opts.mobi_toc_at_start else 'end')
|
opts.mobi_toc_at_start else 'end')
|
||||||
|
11
src/calibre/ebooks/mobi/writer8/__init__.py
Normal file
11
src/calibre/ebooks/mobi/writer8/__init__.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||||
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
|
print_function)
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
|
|
15
src/calibre/ebooks/mobi/writer8/main.py
Normal file
15
src/calibre/ebooks/mobi/writer8/main.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||||
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
|
print_function)
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
|
class KF8Writer(object):
|
||||||
|
|
||||||
|
def __init__(self, oeb, opts):
|
||||||
|
self.oeb, self.opts, self.log = oeb, opts, oeb.log
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user