diff options
author | Norbert Preining <norbert@preining.info> | 2019-11-03 03:01:01 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-11-03 03:01:01 +0000 |
commit | aa26106a9b77529d1eae806729d8076378ced64b (patch) | |
tree | c1a96609e17d84e6fc764caf3a52c65e7ed8c5eb /support/tex4ebook/tex4ebook-exec_mobi.lua | |
parent | 3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 (diff) |
CTAN sync 201911030301
Diffstat (limited to 'support/tex4ebook/tex4ebook-exec_mobi.lua')
-rw-r--r-- | support/tex4ebook/tex4ebook-exec_mobi.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/support/tex4ebook/tex4ebook-exec_mobi.lua b/support/tex4ebook/tex4ebook-exec_mobi.lua new file mode 100644 index 0000000000..92b70af71c --- /dev/null +++ b/support/tex4ebook/tex4ebook-exec_mobi.lua @@ -0,0 +1,32 @@ +module(...,package.seeall) +local eb = require("tex4ebook-exec_epub") +local ebookutils = require("mkutils") +local log = logging.new "exec_mobi" + +function prepare(params) + return eb.prepare(params) +end + +function run(out,params) + return eb.run(out, params) +end + +function writeContainer() + local ret = eb.writeContainer() + -- convert the epub file to mobi + local epubpath = eb.basedir .. "/" .. eb.outputfile + log:info("Pack mobi "..os.execute("kindlegen " .. epubpath)) + -- find the mobi filename + local mobifile = epubpath:gsub("epub$", "mobi") + local mobidist = eb.destdir .. eb.outputfile:gsub("epub$", "mobi") + -- copy the mobi file to the destination directory + -- the destination directory will be created by the epub writer, so it is possible to use + -- the cp function which doesn't try to create directory + ebookutils.cp(mobifile, mobidist) + + return ret +end + +function clean() + return eb.clean() +end |