mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Boilerplate only docx output plugin
This commit is contained in:
parent
83c764c451
commit
c26f948f75
@ -579,6 +579,7 @@ from calibre.ebooks.conversion.plugins.txt_output import TXTOutput, TXTZOutput
|
||||
from calibre.ebooks.conversion.plugins.html_output import HTMLOutput
|
||||
from calibre.ebooks.conversion.plugins.htmlz_output import HTMLZOutput
|
||||
from calibre.ebooks.conversion.plugins.snb_output import SNBOutput
|
||||
from calibre.ebooks.conversion.plugins.docx_output import DOCXOutput
|
||||
|
||||
plugins += [
|
||||
ComicInput,
|
||||
@ -622,6 +623,7 @@ plugins += [
|
||||
HTMLOutput,
|
||||
HTMLZOutput,
|
||||
SNBOutput,
|
||||
DOCXOutput,
|
||||
]
|
||||
# }}}
|
||||
|
||||
|
23
src/calibre/ebooks/conversion/plugins/docx_output.py
Normal file
23
src/calibre/ebooks/conversion/plugins/docx_output.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from calibre.customize.conversion import OutputFormatPlugin
|
||||
|
||||
class DOCXOutput(OutputFormatPlugin):
|
||||
|
||||
name = 'DOCX Output'
|
||||
author = 'Kovid Goyal'
|
||||
file_type = 'docx'
|
||||
|
||||
def convert(self, oeb, output_path, input_plugin, opts, log):
|
||||
from calibre.ebooks.docx.writer.container import DOCX
|
||||
from calibre.ebooks.docx.writer.from_html import Convert
|
||||
docx = DOCX(opts, log)
|
||||
Convert(oeb, docx)()
|
||||
docx.write(output_path)
|
||||
|
@ -18,8 +18,8 @@ from calibre.utils.zipfile import ZipFile
|
||||
|
||||
class DOCX(object):
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
def __init__(self, opts, log):
|
||||
self.opts, self.log = opts, log
|
||||
|
||||
# Boilerplate {{{
|
||||
@property
|
||||
@ -95,5 +95,5 @@ class DOCX(object):
|
||||
# TODO: Write document and document relationships
|
||||
|
||||
if __name__ == '__main__':
|
||||
d = DOCX()
|
||||
d = DOCX(None, None)
|
||||
print (d.websettings)
|
||||
|
17
src/calibre/ebooks/docx/writer/from_html.py
Normal file
17
src/calibre/ebooks/docx/writer/from_html.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
class Convert(object):
|
||||
|
||||
def __init__(self, oeb, docx):
|
||||
self.oeb, self.docx = oeb, docx
|
||||
self.log, self.opts = docx.log, docx.opts
|
||||
|
||||
def __call__(self):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user