module(...,package.seeall) local eb = require("tex4ebook-exec_epub") local dom = require("luaxml-domobject") local log = logging.new "exec_epub3" local ext = "xhtml" local outputdir = nil local input = nil function prepare(params) local basedir = params.input.."-".. params.format local outputdir_name="OEBPS" outputdir= basedir.."/"..outputdir_name input = params.input params.ext = ext params.tex4ht_sty_par = params.tex4ht_sty_par .. ",html5" params.packages = params.packages .. string.format("\\Configure{ext}{%s}",ext) return eb.prepare(params) end function run(out,params) return eb.run(out, params) end local function makeTOC(document) local template = [[