diff options
author | Marius <mariausol@gmail.com> | 2011-02-08 12:00:13 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-02-08 12:00:13 +0200 |
commit | 9c6992a3436a0db6a01790b29d7c0c3c65460f94 (patch) | |
tree | c384372b23cfb6a5379641b4857bae07057bb3be /scripts/context/lua/mtx-timing.lua | |
parent | 801c806a2489c5c96578fe95945bef589329c4e0 (diff) | |
download | context-9c6992a3436a0db6a01790b29d7c0c3c65460f94.tar.gz |
beta 2011.02.08 10:06
Diffstat (limited to 'scripts/context/lua/mtx-timing.lua')
-rw-r--r-- | scripts/context/lua/mtx-timing.lua | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/scripts/context/lua/mtx-timing.lua b/scripts/context/lua/mtx-timing.lua index ee658f461..03100e991 100644 --- a/scripts/context/lua/mtx-timing.lua +++ b/scripts/context/lua/mtx-timing.lua @@ -8,6 +8,20 @@ if not modules then modules = { } end modules ['mtx-timing'] = { local format, gsub, concat = string.format, string.gsub, table.concat +local helpinfo = [[ +--xhtml make xhtml file +--launch launch after conversion +--remove remove after launching +]] + +local application = logs.application { + name = "mtx-timing", + banner = "ConTeXt Timing Tools 0.10", + helpinfo = helpinfo, +} + +local report = application.report + dofile(resolvers.findfile("trac-tim.lua","tex")) dofile(resolvers.findfile("trac-lmx.lua","tex")) @@ -57,6 +71,8 @@ local directrun = true local what = { "parameters", "nodes" } +plugins = plugins or { } -- brrr, will become moduledata as well + function plugins.progress.make_svg(filename,other) local metadata, menudata, c = { }, { }, 0 metadata[#metadata+1] = 'outputformat := "svg" ;' @@ -76,7 +92,7 @@ function plugins.progress.make_svg(filename,other) if directrun then dofile(resolvers.findfile("mlib-run.lua","tex")) commands = commands or { } - commands.writestatus = logs.report + commands.writestatus = report local result = metapost.directrun("metafun","timing data","svg",true,metadata) return menudata, result else @@ -167,9 +183,9 @@ scripts.timings = scripts.timings or { } function scripts.timings.xhtml(filename) if filename == "" then - logs.simple("provide filename") + report("provide filename") elseif not plugins.progress.valid_file(filename) then - logs.simple("first run context again with the --timing option") + report("first run context again with the --timing option") else local basename = file.removesuffix(filename) local launch = environment.argument("launch") @@ -178,16 +194,8 @@ function scripts.timings.xhtml(filename) end end -logs.extendbanner("ConTeXt Timing Tools 0.10",true) - -messages.help = [[ ---xhtml make xhtml file ---launch launch after conversion ---remove remove after launching -]] - if environment.argument("xhtml") then scripts.timings.xhtml(environment.files[1] or "") else - logs.help(messages.help) + application.help() end |