blob: 41804aea39dc66002b7dab59744a94fa56812ea2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
local filter_lib = require "make4ht-filterlib"
local function load_filter(filtername)
return require("filters.make4ht-"..filtername)
end
function filter(filters)
local sequence = filter_lib.load_filters(filters, load_filter)
return function(filename, parameters)
if not filename then return false, "filters: no filename" end
local input = filter_lib.load_input_file(filename)
if not input then return nil, "Cannot load the input file" end
for _,f in pairs(sequence) do
input = f(input,parameters)
end
filter_lib.save_input_file(filename, input)
end
end
return filter
|