From fa4484fd40909b7d8d5205c08917375a1287748b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 May 2018 17:59:54 +0000 Subject: make4ht lua files in runtime git-svn-id: svn://tug.org/texlive/trunk@47548 c570f23f-e606-0410-a88d-b1316a301751 --- .../make4ht/extensions/common_domfilters.lua | 27 ---------- .../support/make4ht/extensions/common_filters.lua | 26 ---------- .../doc/support/make4ht/extensions/latexmk.lua | 31 ------------ .../doc/support/make4ht/extensions/mathjaxnode.lua | 16 ------ .../doc/support/make4ht/extensions/tidy.lua | 57 ---------------------- .../doc/support/make4ht/formats/html5.lua | 17 ------- .../texmf-dist/doc/support/make4ht/formats/odt.lua | 11 ----- .../doc/support/make4ht/formats/xhtml.lua | 16 ------ 8 files changed, 201 deletions(-) delete mode 100644 Master/texmf-dist/doc/support/make4ht/extensions/common_domfilters.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/extensions/common_filters.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/extensions/latexmk.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/extensions/mathjaxnode.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/extensions/tidy.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/formats/html5.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/formats/odt.lua delete mode 100644 Master/texmf-dist/doc/support/make4ht/formats/xhtml.lua (limited to 'Master/texmf-dist/doc/support/make4ht') diff --git a/Master/texmf-dist/doc/support/make4ht/extensions/common_domfilters.lua b/Master/texmf-dist/doc/support/make4ht/extensions/common_domfilters.lua deleted file mode 100644 index 7c9a2dfaea4..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/extensions/common_domfilters.lua +++ /dev/null @@ -1,27 +0,0 @@ -local M = {} - - -local filter = require "make4ht-domfilter" --- local process = filter {"fixinlines", "idcolons", "joincharacters" } - --- filters support only html formats -function M.test(format) - if format == "odt" then return false end - return true -end - -function M.modify_build(make) - local process = filter {"fixinlines", "idcolons", "joincharacters"} - make:match("html$", process) - local matches = make.matches - -- the filters should be first match to be executed, especially if tidy - -- should be executed as well - if #matches > 1 then - local last = matches[#matches] - table.insert(matches, 1, last) - matches[#matches] = nil - end - return make -end - -return M diff --git a/Master/texmf-dist/doc/support/make4ht/extensions/common_filters.lua b/Master/texmf-dist/doc/support/make4ht/extensions/common_filters.lua deleted file mode 100644 index 513fbed34ee..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/extensions/common_filters.lua +++ /dev/null @@ -1,26 +0,0 @@ -local M = {} - - -local filter = require "make4ht-filter" -local process = filter {"cleanspan-nat", "fixligatures", "hruletohr", "entities", "fix-links"} - --- filters support only html formats -function M.test(format) - if format == "odt" then return false end - return true -end - -function M.modify_build(make) - make:match("html$", process) - local matches = make.matches - -- the filters should be first match to be executed, especially if tidy - -- should be executed as well - if #matches > 1 then - local last = matches[#matches] - table.insert(matches, 1, last) - matches[#matches] = nil - end - return make -end - -return M diff --git a/Master/texmf-dist/doc/support/make4ht/extensions/latexmk.lua b/Master/texmf-dist/doc/support/make4ht/extensions/latexmk.lua deleted file mode 100644 index bf4dcdde5a4..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/extensions/latexmk.lua +++ /dev/null @@ -1,31 +0,0 @@ --- use Latexmk in first LaTeX call --- only in the first call, because we don't need to execute biber, etc. in the subsequent --- LaTeX calls, these are only for resolving the cross-references -local M = {} -function M.modify_build(make) - local used = false - local first - local build_seq = make.build_seq - -- find first htlatex call in the build sequence - for pos,v in ipairs(build_seq) do - if v.name == "htlatex" and not first then - first = pos - end - end - -- if htlatex was found - if first then - -- add dummy latexmk call to the build sequence - make:latexmk {} - -- replace name, command and type in the first htlatex - -- call with values from the dummy latexmk call - local replaced = build_seq[first] - local latexmk = build_seq[#build_seq] - replaced.name = latexmk.name - replaced.command = latexmk.command - replaced.type = latexmk.type - -- remove the dummy latexmk - table.remove(build_seq) - end - return make -end -return M diff --git a/Master/texmf-dist/doc/support/make4ht/extensions/mathjaxnode.lua b/Master/texmf-dist/doc/support/make4ht/extensions/mathjaxnode.lua deleted file mode 100644 index cbad897d4ec..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/extensions/mathjaxnode.lua +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - - -local filter = require "make4ht-filter" -function M.test(format) - if format == "odt" then return false end - return true -end - -function M.modify_build(make) - local mathjax = filter { "mathjaxnode"} - make:match("html$",mathjax) - return make -end - -return M diff --git a/Master/texmf-dist/doc/support/make4ht/extensions/tidy.lua b/Master/texmf-dist/doc/support/make4ht/extensions/tidy.lua deleted file mode 100644 index cf8ea9785a5..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/extensions/tidy.lua +++ /dev/null @@ -1,57 +0,0 @@ -local M = {} - -function M.test(format) - if format == "odt" then return false end - return true -end - -local empty_elements = { - area=true, - base=true, - br=true, - col=true, - embed=true, - hr=true, - img=true, - input=true, - keygen=true, - link=true, - meta=true, - param=true, - source=true, - track=true, - wbr=true, -} - --- LuaXML cannot read HTML with unclosed tags (like ) --- Tidy removes end slashes in the HTML output, so --- this function will add them back -local function close_tags(s) - return s:gsub("<(%w+)([^>]-)>", function(tag, rest) - local endslash = "" - if empty_elements[tag] then endslash = " /" end - return string.format("<%s%s%s>", tag, rest, endslash) - end) -end - - - -function M.modify_build(make) - make:match("html$", function(filename, par) - local settings = get_filter_settings "tidy" or {} - par.options = par.options or settings.options or "-utf8 -w 512 -ashtml -q" - local command = "tidy ${options} ${filename}" % par - print("execute: ".. command) - -- os.execute(command) - local run = io.popen(command, "r") - local result = run:read("*all") - run:close() - result = close_tags(result) - local f = io.open(filename, "w") - f:write(result) - f:close() - end) - return make -end - -return M diff --git a/Master/texmf-dist/doc/support/make4ht/formats/html5.lua b/Master/texmf-dist/doc/support/make4ht/formats/html5.lua deleted file mode 100644 index 633a45e7f34..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/formats/html5.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} - -local mkutils = require "mkutils" - -function M.prepare_extensions(extensions) - -- return mkutils.add_extensions("+common_domfilters", extensions) - return extensions --mkutils.add_extensions("+tidy", extensions) -end - -function M.prepare_parameters(parameters,extensions) - parameters.tex4ht_sty_par = parameters.tex4ht_sty_par .. ",html5" - parameters = mkutils.extensions_prepare_parameters(extensions,parameters) - return parameters -end - - -return M diff --git a/Master/texmf-dist/doc/support/make4ht/formats/odt.lua b/Master/texmf-dist/doc/support/make4ht/formats/odt.lua deleted file mode 100644 index 66105166f32..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/formats/odt.lua +++ /dev/null @@ -1,11 +0,0 @@ -local M = {} -local mkutils = require "mkutils" - -function M.prepare_parameters(settings, extensions) - settings.tex4ht_sty_par = settings.tex4ht_sty_par ..",ooffice" - settings.tex4ht_par = settings.tex4ht_par .. " ooffice/! -cmozhtf" - settings.t4ht_par = settings.t4ht_par .. " -cooxtpipes -coo " - settings = mkutils.extensions_prepare_parameters(extensions, settings) - return settings -end -return M diff --git a/Master/texmf-dist/doc/support/make4ht/formats/xhtml.lua b/Master/texmf-dist/doc/support/make4ht/formats/xhtml.lua deleted file mode 100644 index 4a4ac6689ca..00000000000 --- a/Master/texmf-dist/doc/support/make4ht/formats/xhtml.lua +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - -local mkutils = require "mkutils" - -function M.prepare_extensions(extensions) - -- return mkutils.add_extensions("+common_domfilters", extensions) - return extensions -end - -function M.prepare_parameters(parameters,extensions) - parameters = mkutils.extensions_prepare_parameters(extensions,parameters) - return parameters -end - - -return M -- cgit v1.2.3