From c971a249f8c3c8c394dc1f173bae8fc14a81b700 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 21 Mar 2013 13:42:00 +0100 Subject: beta 2013.03.21 13:42 --- scripts/context/lua/mtx-babel.lua | 22 +- scripts/context/lua/mtx-base.lua | 54 +++-- scripts/context/lua/mtx-cache.lua | 27 ++- scripts/context/lua/mtx-chars.lua | 22 +- scripts/context/lua/mtx-check.lua | 18 +- scripts/context/lua/mtx-colors.lua | 30 ++- scripts/context/lua/mtx-context.lua | 24 ++- scripts/context/lua/mtx-convert.lua | 28 ++- scripts/context/lua/mtx-epub.lua | 30 ++- scripts/context/lua/mtx-fcd.lua | 56 +++-- scripts/context/lua/mtx-flac.lua | 32 ++- scripts/context/lua/mtx-fonts.lua | 2 +- scripts/context/lua/mtx-grep.lua | 31 ++- scripts/context/lua/mtx-interface.lua | 58 +++-- scripts/context/lua/mtx-metapost.lua | 51 +++-- scripts/context/lua/mtx-metatex.lua | 20 +- scripts/context/lua/mtx-mkii-help.lua | 376 +++++++++++++++++++++++++++++++++ scripts/context/lua/mtx-modules.lua | 22 +- scripts/context/lua/mtx-package.lua | 18 +- scripts/context/lua/mtx-patterns.lua | 44 ++-- scripts/context/lua/mtx-pdf.lua | 22 +- scripts/context/lua/mtx-profile.lua | 20 +- scripts/context/lua/mtx-rsync.lua | 24 ++- scripts/context/lua/mtx-scite.lua | 23 +- scripts/context/lua/mtx-server.lua | 28 ++- scripts/context/lua/mtx-texworks.lua | 20 +- scripts/context/lua/mtx-timing.lua | 22 +- scripts/context/lua/mtx-tools.lua | 49 +++-- scripts/context/lua/mtx-unzip.lua | 22 +- scripts/context/lua/mtx-update.lua | 52 +++-- scripts/context/lua/mtx-watch.lua | 32 ++- scripts/context/lua/mtxrun.lua | 47 ++++- scripts/context/ruby/mpstools.rb | 7 - scripts/context/ruby/texsync.rb | 206 ------------------ scripts/context/stubs/mswin/mtxrun.lua | 47 ++++- scripts/context/stubs/unix/mtxrun | 47 ++++- 36 files changed, 1175 insertions(+), 458 deletions(-) create mode 100644 scripts/context/lua/mtx-mkii-help.lua delete mode 100644 scripts/context/ruby/mpstools.rb delete mode 100644 scripts/context/ruby/texsync.rb (limited to 'scripts') diff --git a/scripts/context/lua/mtx-babel.lua b/scripts/context/lua/mtx-babel.lua index 120e49092..8c11465de 100644 --- a/scripts/context/lua/mtx-babel.lua +++ b/scripts/context/lua/mtx-babel.lua @@ -9,9 +9,23 @@ if not modules then modules = { } end modules ['mtx-babel'] = { -- data tables by Thomas A. Schmitz local helpinfo = [[ ---language=string conversion language (e.g. greek) ---structure=string obey given structure (e.g. 'document', default: 'context') ---convert convert babel codes into utf + + + + mtx-babel + Babel Input To UTF Conversion + 1.20 + + + + + conversion language (e.g. greek) + obey given structure (e.g. 'document', default: 'context') + convert babel codes into utf + + + + ]] local application = logs.application { @@ -431,6 +445,8 @@ end if environment.argument("convert") then scripts.babel.convert(environment.files[1] or "") +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-base.lua b/scripts/context/lua/mtx-base.lua index ab5bfe18a..e8bf991f4 100644 --- a/scripts/context/lua/mtx-base.lua +++ b/scripts/context/lua/mtx-base.lua @@ -7,29 +7,43 @@ if not modules then modules = { } end modules ['mtx-base'] = { } local helpinfo = [[ ---generate generate file database ---variables show configuration variables ---configurations show configuration order ---expand-braces expand complex variable ---expand-path expand variable (resolve paths) ---expand-var expand variable (resolve references) ---show-path show path expansion of ... ---var-value report value of variable ---find-file report file location ---find-path report path of file ---make or --ini make luatex format ---run or --fmt= run luatex format ---compile assemble and compile lua inifile ---verbose give a bit more info ---all show all found files ---format=str filter cf format specification (default 'tex', use 'any' for any match) ---pattern=str filter variables ---trackers=list enable given trackers + + + + mtx-base + ConTeXt TDS Management Tool (aka luatools) + 1.35 + + + + + generate file database + show configuration variables + show configuration order + expand complex variable + expand variable (resolve paths) + expand variable (resolve references) + show path expansion of ... + report value of variable + report file location + report path of file + [or make luatex format + [or run luatex format + assemble and compile lua inifile + give a bit more info + show all found files + filter cf format specification (default 'tex', use 'any' for any match) + filter variables + enable given trackers + + + + ]] local application = logs.application { name = "mtx-base", - banner = "ConTeXt TDS Management Tool 1.35 (aka luatools)", + banner = "ConTeXt TDS Management Tool (aka luatools) 1.35", helpinfo = helpinfo, } @@ -107,6 +121,8 @@ elseif environment.arguments["variables"] or environment.arguments["show-variabl elseif environment.arguments["configurations"] or environment.arguments["show-configurations"] then resolvers.load("nofiles") resolvers.listers.configurations() +elseif environment.arguments["exporthelp"] then + application.export(environment.arguments["exporthelp"],environment.files[1]) elseif environment.arguments["help"] or (environment.files[1]=='help') or (#environment.files==0) then application.help() elseif environment.files[1] == 'texmfcnf.lua' then diff --git a/scripts/context/lua/mtx-cache.lua b/scripts/context/lua/mtx-cache.lua index 08202bbf8..cd5512618 100644 --- a/scripts/context/lua/mtx-cache.lua +++ b/scripts/context/lua/mtx-cache.lua @@ -7,11 +7,26 @@ if not modules then modules = { } end modules ['mtx-cache'] = { } local helpinfo = [[ ---purge remove not used files ---erase completely remove cache ---list show cache - ---all all (not yet implemented) + + + + mtx-cache + ConTeXt & MetaTeX Cache Management + 0.10 + + + + + remove not used files + completely remove cache + show cache + + + all (not yet implemented) + + + + ]] local application = logs.application { @@ -114,6 +129,8 @@ elseif environment.argument("erase") then scripts.cache.erase() elseif environment.argument("list") then scripts.cache.list() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-chars.lua b/scripts/context/lua/mtx-chars.lua index ad2c499be..9f6852da2 100644 --- a/scripts/context/lua/mtx-chars.lua +++ b/scripts/context/lua/mtx-chars.lua @@ -9,9 +9,23 @@ if not modules then modules = { } end modules ['mtx-chars'] = { -- obsolete: --stix convert stix table to math table local helpinfo = [[ ---xtx generate xetx-*.tex (used by xetex) ---pdf generate pdfr-def.tex (used by pdftex) ---entities generate entities table + + + + mtx-chars + MkII Character Table Generators + 0.10 + + + + + generate xetx-*.tex (used by xetex) + generate pdfr-def.tex (used by pdftex) + generate entities table + + + + ]] local application = logs.application { @@ -387,6 +401,8 @@ elseif environment.argument("xtx") then scripts.chars.makeencoutf() elseif environment.argument("pdf") then scripts.chars.makepdfr() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-check.lua b/scripts/context/lua/mtx-check.lua index 8307a02c6..9f52509ec 100644 --- a/scripts/context/lua/mtx-check.lua +++ b/scripts/context/lua/mtx-check.lua @@ -11,7 +11,21 @@ local gsub, sub, format = string.gsub, string.sub, string.format local insert, remove = table.insert, table.remove local helpinfo = [[ ---convert check tex file for errors + + + + mtx-check + Basic ConTeXt Syntax Checking + 0.10 + + + + + check tex file for errors + + + + ]] local application = logs.application { @@ -229,6 +243,8 @@ if environment.argument("check") then scripts.checker.check(environment.files[1]) elseif environment.argument("help") then application.help() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) elseif environment.files[1] then scripts.checker.check(environment.files[1]) else diff --git a/scripts/context/lua/mtx-colors.lua b/scripts/context/lua/mtx-colors.lua index 2a51d5099..7dd1b4ac4 100644 --- a/scripts/context/lua/mtx-colors.lua +++ b/scripts/context/lua/mtx-colors.lua @@ -9,11 +9,29 @@ if not modules then modules = { } end modules ['mtx-colors'] = { -- todo: fc-cache -v en check dirs, or better is: fc-cat -v | grep Directory local helpinfo = [[ ---table show icc table - -example: - -mtxrun --script color --table somename + + + + mtx-colors + ConTeXt Color Management + 0.10 + + + + + show icc table + + + + + + Example + + mtxrun --script color --table somename + + + + ]] local application = logs.application { @@ -52,6 +70,8 @@ end if environment.argument("table") then scripts.colors.table() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index ad25b52ce..43180ddae 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -134,6 +134,9 @@ local helpinfo = [[ run without stopping + + run with synctex enabled (optional value: zipped, unzipped, 1, -1) + @@ -680,6 +683,9 @@ function scripts.context.run(ctxdata,filename) local a_noarrange = getargument("noarrange") local a_jiton = getargument("jiton") -- + a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or nil + a_synctex = tonumber(a_synctex) or (toboolean(a_synctex,true) and 1) or (a_synctex == "zipped" and 1) or (a_synctex == "unzipped" and -1) or nil + -- for i=1,#filelist do -- local filename = filelist[i] @@ -701,6 +707,9 @@ function scripts.context.run(ctxdata,filename) formatname = formatofinterface[analysis.interface] or formatname formatfile, scriptfile = resolvers.locateformat(formatname) end + -- + a_jiton = (a_jiton or toboolean(analysis.jiton,true)) and true or nil + -- if not formatfile or not scriptfile then report("warning: no format found, forcing remake (source driven)") scripts.context.make(formatname,a_engine) @@ -741,11 +750,6 @@ function scripts.context.run(ctxdata,filename) scripts.context.make(formatname) end -- --- if a_engine and a_engine ~= "" and a_engine ~= "luatex" then --- formatfile = gsub(formatfile,"/luatex%-cache/",format("/%s-cache/",a_engine)) --- scriptfile = gsub(scriptfile,"/luatex%-cache/",format("/%s-cache/",a_engine)) --- end - -- local oldhash = multipass_hashfiles(jobname) local newhash = { } local maxnofruns = once and 1 or multipass_nofruns @@ -763,23 +767,23 @@ function scripts.context.run(ctxdata,filename) } -- for k, v in next, environment.arguments do + -- the raw arguments if c_flags[k] == nil then c_flags[k] = v end end -- - a_jiton = a_jiton or toboolean(analysis.jiton,true) -- local l_flags = { - ["interaction"] = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or nil, - ["synctex"] = a_synctex and 1 or nil, + ["interaction"] = a_batchmode, + ["synctex"] = a_synctex, ["no-parse-first-line"] = true, -- ["no-mktex"] = true, -- ["file-line-error-style"] = true, ["fmt"] = formatfile, ["lua"] = scriptfile, ["jobname"] = jobname, - ["jiton"] = a_jiton and true or false, + ["jiton"] = a_jiton, } -- if a_synctex then @@ -1118,7 +1122,7 @@ local temporary_runfiles = { "tui", "tua", "tup", "ted", "tes", "top", "log", "tmp", "run", "bck", "rlg", "mpt", "mpx", "mpd", "mpo", "mpb", "ctl", - "synctex.gz", "pgf", + "synctex", "synctex.gz", "pgf", "prep", } diff --git a/scripts/context/lua/mtx-convert.lua b/scripts/context/lua/mtx-convert.lua index 14ade611e..b76b3baaf 100644 --- a/scripts/context/lua/mtx-convert.lua +++ b/scripts/context/lua/mtx-convert.lua @@ -9,12 +9,26 @@ if not modules then modules = { } end modules ['mtx-convert'] = { -- todo: eps and svg local helpinfo = [[ ---convertall convert all graphics on path ---inputpath=string original graphics path ---outputpath=string converted graphics path ---watch watch folders ---force force conversion (even if older) ---delay time between sweeps + + + + mtx-convert + ConTeXT Graphic Conversion Helpers + 0.10 + + + + + convert all graphics on path + original graphics path + converted graphics path + watch folders + force conversion (even if older) + time between sweeps + + + + ]] local application = logs.application { @@ -154,6 +168,8 @@ if environment.arguments.convertall then convert.convertall() elseif environment.files[1] then convert.convertgiven() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-epub.lua b/scripts/context/lua/mtx-epub.lua index 28a37fec2..11f0a2024 100644 --- a/scripts/context/lua/mtx-epub.lua +++ b/scripts/context/lua/mtx-epub.lua @@ -22,11 +22,29 @@ local format, gsub = string.format, string.gsub local concat = table.concat local helpinfo = [[ ---make create epub zip file - -example: - -mtxrun --script epub --make mydocument + + + + mtx-epub + ConTeXt EPUB Helpers + 0.12 + + + + + create epub zip file + + + + + + Example + + mtxrun --script epub --make mydocument + + + + ]] local application = logs.application { @@ -353,6 +371,8 @@ end if environment.argument("make") then scripts.epub.make() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-fcd.lua b/scripts/context/lua/mtx-fcd.lua index d7e1d17a7..ba9299020 100644 --- a/scripts/context/lua/mtx-fcd.lua +++ b/scripts/context/lua/mtx-fcd.lua @@ -22,28 +22,46 @@ if not modules then modules = { } end modules ['mtx-fcd'] = { -- part if the same run, so that indeed we change. local helpinfo = [[ ---clear clear the cache ---clear --history [entry] clear the history ---scan clear the cache and add given path(s) ---add add given path(s) ---find file given path (can be substring) ---find --nohistory file given path (can be substring) but don't use history ---stub print platform stub file ---list show roots of cached dirs ---list --history show history of chosen dirs ---help show this help - -usage: - - fcd --scan t:\ - fcd --add f:\project - fcd [--find] whatever - fcd --list + + + + mtx-fcd + Fast Directory Change + 1.00 + + + + + clear the cache + [entry] clear the history + clear the cache and add given path(s) + add given path(s) + find given path (can be substring) + find given path (can be substring) but don't use history + print platform stub file + show roots of cached dirs + show history of chosen dirs + show this help + + + + + + Example + + fcd --scan t:\ + fcd --add f:\project + fcd [--find] whatever + fcd --list + + + + ]] local application = logs.application { name = "mtx-fcd", - banner = "Fast Directory Change", + banner = "Fast Directory Change 1.00", helpinfo = helpinfo, } @@ -358,6 +376,8 @@ elseif argument("list") then end elseif argument("help") then application.help() +elseif argument("exporthelp") then + application.export(argument("exporthelp"),environment.files[1]) else -- also argument("find") fcd_load() fcd_find() diff --git a/scripts/context/lua/mtx-flac.lua b/scripts/context/lua/mtx-flac.lua index 851fe6ea1..2155b24be 100644 --- a/scripts/context/lua/mtx-flac.lua +++ b/scripts/context/lua/mtx-flac.lua @@ -168,12 +168,30 @@ end -- local helpinfo = [[ ---collect collect albums in xml file - -example: - -mtxrun --script flac --collect somename.flac -mtxrun --script flac --collect --pattern="m:/music/**") + + + + mtx-flac + ConTeXt Flac Helpers + 0.10 + + + + + collect albums in xml file + + + + + + Example + + mtxrun --script flac --collect somename.flac + mtxrun --script flac --collect --pattern="m:/music/**") + + + + ]] local application = logs.application { @@ -213,6 +231,8 @@ end if environment.argument("collect") then scripts.flac.collect() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua index 659059fa1..3f75a4fc6 100644 --- a/scripts/context/lua/mtx-fonts.lua +++ b/scripts/context/lua/mtx-fonts.lua @@ -45,7 +45,7 @@ local helpinfo = [[ - Examples of searches + Examples mtxrun --script font --list somename (== --pattern=*somename*) diff --git a/scripts/context/lua/mtx-grep.lua b/scripts/context/lua/mtx-grep.lua index 98a97279d..dbcce67f6 100644 --- a/scripts/context/lua/mtx-grep.lua +++ b/scripts/context/lua/mtx-grep.lua @@ -7,12 +7,27 @@ if not modules then modules = { } end modules ['mtx-babel'] = { } local helpinfo = [[ ---pattern search for pattern (optional) ---count count matches only ---nocomment skip lines that start with %% or # ---xml pattern is lpath expression - -patterns are lua patterns and need to be escaped accordingly + + + + mtx-grep + Simple Grepper + 0.10 + + + + + search for pattern (optional) + count matches only + skip lines that start with %% or # + pattern is lpath expression + + + + + patterns are lua patterns and need to be escaped accordingly + + ]] local application = logs.application { @@ -144,7 +159,9 @@ end local pattern = environment.argument("pattern") local files = environment.files and #environment.files > 0 and environment.files -if pattern and files then +if environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),files[1]) +elseif pattern and files then scripts.grep.find(pattern, files) elseif files then scripts.grep.find(files[1], files, 2) diff --git a/scripts/context/lua/mtx-interface.lua b/scripts/context/lua/mtx-interface.lua index 2790e2669..82cefd638 100644 --- a/scripts/context/lua/mtx-interface.lua +++ b/scripts/context/lua/mtx-interface.lua @@ -11,25 +11,43 @@ local gsub, format, gmatch, find = string.gsub, string.format, string.gmatch, st local utfchar, utfgsub = utf.char, utf.gsub local helpinfo = [[ ---interfaces generate context interface files ---messages generate context message files ---labels generate context label files - ---context equals --interfaces --messages --languages - ---scite generate scite interface ---bbedit generate bbedit interface files ---jedit generate jedit interface files ---textpad generate textpad interface files ---text create text files for commands and environments ---raw report commands to the console ---check generate check file - ---toutf replace named characters by utf ---preprocess preprocess mkvi files to tex files [force,suffix] - ---suffix use given suffix for output files ---force force action even when in doubt + + + + mtx-interface + ConTeXt Interface Related Goodies + 0.13 + + + + + generate context interface files + generate context message files + generate context label files + + + equals + + + generate scite interface + generate bbedit interface files + generate jedit interface files + generate textpad interface files + create text files for commands and environments + report commands to the console + generate check file + + + replace named characters by utf + preprocess mkvi files to tex files [force,suffix] + + + use given suffix for output files + force action even when in doubt + + + + ]] local application = logs.application { @@ -596,6 +614,8 @@ elseif ea("scite") or ea("bbedit") or ea("jedit") or ea("textpad") or ea("text") if ea("raw") then scripts.interface.editor("raw") end +elseif ea("exporthelp") then + application.export(ea("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-metapost.lua b/scripts/context/lua/mtx-metapost.lua index 44cf8205d..08daec978 100644 --- a/scripts/context/lua/mtx-metapost.lua +++ b/scripts/context/lua/mtx-metapost.lua @@ -7,19 +7,38 @@ if not modules then modules = { } end modules ['mtx-metapost'] = { -- this was m } local helpinfo = [[ ---rawmp raw metapost run ---metafun use metafun instead of plain ---latex force --tex=latex ---texexec force texexec usage (mkii) ---split split single result file into pages - -intended usage: - -mtxrun --script metapost yourfile.mp -mtxrun --script metapost --split yourfile.mp -mtxrun --script metapost yourfile.123 myfile.mps - -other usage resembles mptopdf.pl + + + + mtx-metapost + MetaPost to PDF processor + 0.10 + + + + + raw metapost run + use metafun instead of plain + force + force texexec usage (mkii) + split single result file into pages + + + + + + Examples + + mtxrun --script metapost yourfile.mp + mtxrun --script metapost --split yourfile.mp + mtxrun --script metapost yourfile.123 myfile.mps + + + + + other usage resembles mptopdf.pl + + ]] local application = logs.application { @@ -166,10 +185,12 @@ function scripts.mptopdf.convertall() end end -if environment.files[1] then +if environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) +elseif environment.files[1] then scripts.mptopdf.convertall() else - if not environment.arguments.help then + if not environment.argument("help") then report("provide MP output file (or pattern)") report() end diff --git a/scripts/context/lua/mtx-metatex.lua b/scripts/context/lua/mtx-metatex.lua index 0b66d59ef..455ecbd52 100644 --- a/scripts/context/lua/mtx-metatex.lua +++ b/scripts/context/lua/mtx-metatex.lua @@ -9,8 +9,22 @@ if not modules then modules = { } end modules ['mtx-metatex'] = { -- future versions will deal with specific variants of metatex local helpinfo = [[ ---run process (one or more) files (default action) ---make create metatex format(s) + + + + mtx-metatex + MetaTeX Process Management + 0.10 + + + + + process (one or more) files (default action) + create metatex format(s) + + + + ]] local application = logs.application { @@ -57,6 +71,8 @@ elseif environment.argument("make") then scripts.metatex.timed(scripts.metatex.make) elseif environment.argument("help") then logs.help(messages.help,false) +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) elseif environment.files[1] then scripts.metatex.timed(scripts.metatex.run) else diff --git a/scripts/context/lua/mtx-mkii-help.lua b/scripts/context/lua/mtx-mkii-help.lua new file mode 100644 index 000000000..e43f47bf0 --- /dev/null +++ b/scripts/context/lua/mtx-mkii-help.lua @@ -0,0 +1,376 @@ +local helpinfo = [[ + + + + texexec + TeXExec + 6.2.1 + + + + + make formats + check versions + process file + process mp file + process mpx file + process mp file to stand-alone graphics + process mp/ctx file to stand-alone graphics + list of file content + generate overview of figures + generate module documentation + impose pages (booklets) + select pages from file(s) + copy pages from file(s) + trim pages from file(s) + combine multiple pages + split file in pages + + + + + + +]] + + +local texexec = logs.application { + name = "texexec", + banner = "TeXExec 6.2.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + texutil + TeXUtil + 9.1.0 + + + + + convert tui file into tuo file + generate figure dimensions file + filter essential log messages + remove most temporary files + remove all temporary files + generate documentation file from source + analyze pdf file + + + + + +]] + +local texutil = logs.application { + name = "texutil", + banner = "TeXUtil 9.1.0", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + ctxtools + CtxTools + 1.3.5 + + + + + update context version + report context version + generate jedit syntax files [ + generate bbedit syntax files [ + generate scite syntax files [ + generate raw syntax files [ + generate interface files (xml) [nl de ..] + remove temporary files [ [basename] + [filename] + ) # no help, hidden temporary feature + convert pdftex mapfiles to dvipdfmx [ [texmfroot] + create doctype entity definition from enco-uc.tex + add context copyright notice [ + replace line-endings [ [pattern] + [filename] + download latest version and remake formats [ + remove utf bom [ + + + + + + +]] + +local ctxtools = logs.application { + name = "ctxtools", + banner = "CtxTools 1.3.5", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + textools + TeXTools + 1.3.1 + + + + + [pattern] [ + [pattern] [ + [pattern] [ + [pattern] [ + filename [ + [pattern] [ + [pattern] [ + [pattern] [ + [texmfroot] [ + filename [ + fromroot toroot [ + [ [ + [ [ + filename + afmfile encodingname + tpm file (run in texmf root) + + + + + + +]] + +local textools = logs.application { + name = "textools", + banner = "TeXTools 1.3.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + pdftools + PDFTools + 1.2.1 + + + + + [ + [ ] + filename [ + filename [ + filename + [ + [ + filename + + + + + + +]] + +local pdftools = logs.application { + name = "pdftools", + banner = "PDFTools 1.2.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + tmftools + TMFTools + 1.1.0 + + + + + [ ] [pattern] + + + act as kpse server + + + + +]] + +local tmftools = logs.application { + name = "tmftools", + banner = "TMFTools 1.2.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + xmltools + XMLTools + 1.2.2 + + + + + generate directory listing + generate graphic from mathml + report entities and elements [ ] + cleanup xml file [] + enhance xml file (partial) + filter elements from xml file [] + generate ddirectory listing + + + + +]] + +local xmltools = logs.application { + name = "xmltools", + banner = "XMLTools 1.2.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + pstopdf + PStoPDF + 2.0.1 + + + + + handles exa request file + watch folders for conversions (untested) + + + + + + +]] + +local pstopdf = logs.application { + name = "pstopdf", + banner = "PStoPDF 2.0.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + rlxtools + RlxTools + 1.0.1 + + + + + [ manipulatorfile resourselog + [ filename + + + + + + +]] + +local rlxtools = logs.application { + name = "rlxtools", + banner = "RlxTools 1.0.1", + helpinfo = helpinfo, +} + +local helpinfo = [[ + + + + imgtopdf + ImgToPdf + 1.1.2 + + + + + convert image into pdf + level of compression in percent + image depth in bits + colorspace (rgb,cmyk,gray) + quality in percent + path where files are looked for + path where files end up + determine settings automatically + + + + +]] + +local imgtopdf = logs.application { + name = "imgtopdf", + banner = "ImgToPdf 1.1.2", + helpinfo = helpinfo, +} + +-- texmfstart.rb is normally replaced by mtxrun +-- runtools.rb is run from within context +-- concheck.rb is run from within editors +-- texsync.rb is no longer in the zip +-- mpstools.rb is no longer in the zip +-- rscortool.rb is only run indirectly +-- rsfiltool.rb is only run indirectly +-- rslibtool.rb is only run indirectly + + +local application = logs.application { + name = "mkii-help", + banner = "MkII Help generator 1.00", +} + +local filename = environment.files[1] + +if not filename then + application.report("no mkii script given") + return +end + +local mkiiapplication + +if filename == "texexec" then mkiiapplication = texexec +elseif filename == "texutil" then mkiiapplication = texutil +elseif filename == "ctxtools" then mkiiapplication = ctxtools +elseif filename == "textools" then mkiiapplication = textools +elseif filename == "pdftools" then mkiiapplication = pdftools +elseif filename == "tmftools" then mkiiapplication = tmftools +elseif filename == "xmltools" then mkiiapplication = xmltools +elseif filename == "pstopdf" then mkiiapplication = pstopdf +elseif filename == "rlxtools" then mkiiapplication = rlxtools +elseif filename == "imgtopdf" then mkiiapplication = imgtopdf end + +if not mkiiapplication then + application.report("no valid mkii script given") + return +end + +if environment.argument("exporthelp") then + mkiiapplication.export(environment.argument("exporthelp"),environment.files[2]) +else + mkiiapplication.help() +end diff --git a/scripts/context/lua/mtx-modules.lua b/scripts/context/lua/mtx-modules.lua index 902b12ac3..ef38a7156 100644 --- a/scripts/context/lua/mtx-modules.lua +++ b/scripts/context/lua/mtx-modules.lua @@ -10,9 +10,23 @@ scripts = scripts or { } scripts.modules = scripts.modules or { } local helpinfo = [[ ---convert convert source files (tex, mkii, mkiv, mp) to 'ted' files ---process process source files (tex, mkii, mkiv, mp) to 'pdf' files ---prep use original name with suffix 'prep' appended + + + + mtx-modules + ConTeXt Module Documentation Generators + 1.00 + + + + + convert source files (tex, mkii, mkiv, mp) to 'ted' files + process source files (tex, mkii, mkiv, mp) to 'pdf' files + use original name with suffix 'prep' appended + + + + ]] local application = logs.application { @@ -181,6 +195,8 @@ if environment.argument("process") then scripts.modules.process(true) elseif environment.argument("convert") then scripts.modules.process(false) +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-package.lua b/scripts/context/lua/mtx-package.lua index 879dd5e3a..8c9e6b9fc 100644 --- a/scripts/context/lua/mtx-package.lua +++ b/scripts/context/lua/mtx-package.lua @@ -9,7 +9,21 @@ if not modules then modules = { } end modules ['mtx-package'] = { local format, gsub, gmatch = string.format, string.gsub, string.gmatch local helpinfo = [[ ---merge merge 'loadmodule' into merge file + + + + mtx-package + Distribution Related Goodies + 0.10 + + + + + merge 'loadmodule' into merge file + + + + ]] local application = logs.application { @@ -63,6 +77,8 @@ end if environment.argument("merge") then scripts.package.merge_luatex_files(environment.files[1] or "") +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-patterns.lua b/scripts/context/lua/mtx-patterns.lua index 86f63bb16..7144da9b0 100644 --- a/scripts/context/lua/mtx-patterns.lua +++ b/scripts/context/lua/mtx-patterns.lua @@ -12,18 +12,36 @@ local addsuffix = file.addsuffix local lpegmatch, validutf8 = lpeg.match, lpeg.patterns.validutf8 local helpinfo = [[ ---convert generate context language files (mnemonic driven, if not given then all) ---check check pattern file (or those used by context when no file given) ---path source path where hyph-foo.tex files are stored ---destination destination path ---specification additional patterns: e.g.: =cy,hyph-cy,welsh - -examples of usage: - -mtxrun --script pattern --check hyph-*.tex -mtxrun --script pattern --check --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns -mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/tex --destination=e:/tmp/patterns -mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns + + + + mtx-patterns + ConTeXt Pattern File Management + 0.20 + + + + + generate context language files (mnemonic driven, if not given then all) + check pattern file (or those used by context when no file given) + source path where hyph-foo.tex files are stored + destination path + additional patterns: e.g.: =cy,hyph-cy,welsh + + + + + + Examples + + mtxrun --script pattern --check hyph-*.tex + mtxrun --script pattern --check --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns + mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/tex --destination=e:/tmp/patterns + mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns + + + + ]] local application = logs.application { @@ -529,6 +547,8 @@ if environment.argument("check") then elseif environment.argument("convert") then scripts.patterns.prepare() scripts.patterns.convert() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-pdf.lua b/scripts/context/lua/mtx-pdf.lua index f37ee006a..3e4130344 100644 --- a/scripts/context/lua/mtx-pdf.lua +++ b/scripts/context/lua/mtx-pdf.lua @@ -13,9 +13,23 @@ local concat = table.concat local setmetatableindex, sortedhash, sortedkeys = table.setmetatableindex, table.sortedhash, table.sortedkeys local helpinfo = [[ ---info show some info about the given file ---metadata show metadata xml blob ---fonts show used fonts (--detail) + + + + mtx-pdf + ConTeXt PDF Helpers + 0.10 + + + + + show some info about the given file + show metadata xml blob + show used fonts ( + + + + ]] local application = logs.application { @@ -213,6 +227,8 @@ elseif environment.argument("metadata") then scripts.pdf.metadata(filename) elseif environment.argument("fonts") then scripts.pdf.fonts(filename) +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-profile.lua b/scripts/context/lua/mtx-profile.lua index 35cf1fc47..3550474f3 100644 --- a/scripts/context/lua/mtx-profile.lua +++ b/scripts/context/lua/mtx-profile.lua @@ -12,8 +12,22 @@ if not modules then modules = { } end modules ['mtx-profile'] = { local match, format, find = string.match, string.format, string.find local helpinfo = [[ ---analyze analyze lua calls ---trace analyze tex calls + + + + mtx-profile + ConTeXt MkIV LuaTeX Profiler + 1.00 + + + + + analyze lua calls + analyze tex calls + + + + ]] local application = logs.application { @@ -166,6 +180,8 @@ if environment.argument("analyze") then scripts.profiler.analyze(environment.files[1] or "luatex-profile.log") elseif environment.argument("trace") then scripts.profiler.analyze(environment.files[1] or "temp.log") +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-rsync.lua b/scripts/context/lua/mtx-rsync.lua index 288419431..65f795ee5 100644 --- a/scripts/context/lua/mtx-rsync.lua +++ b/scripts/context/lua/mtx-rsync.lua @@ -46,9 +46,23 @@ if not modules then modules = { } end modules ['mtx-rsync'] = { -- } local helpinfo = [[ ---job use given file as specification ---dryrun show what would happen ---force force run + + + + mtx-rsync + Rsync Helpers + 0.10 + + + + + use given file as specification + show what would happen + force run + + + + ]] local application = logs.application { @@ -164,7 +178,9 @@ elseif arguments.force then rsync.mode = "force" end -if arguments.job then +if arguments.exporthelp then + application.export(arguments.exporthelp,environment.files[1]) +elseif arguments.job then rsync.job(files[1]) elseif files[1] and files[2] then rsync.run(files[1],files[2]) diff --git a/scripts/context/lua/mtx-scite.lua b/scripts/context/lua/mtx-scite.lua index 3369c5f3b..972edbfe6 100644 --- a/scripts/context/lua/mtx-scite.lua +++ b/scripts/context/lua/mtx-scite.lua @@ -10,13 +10,22 @@ local P, R, S, C, Ct, Cf, Cc, Cg = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg local lpegmatch = lpeg.match local format, lower, gmatch = string.format, string.lower, string.gmatch --- local helpinfo = [[ --- --start [--verbose] start scite --- --test report what will happen --- ]] - local helpinfo = [[ ---words convert spell-*.txt into spell-*.lua + + + + mtx-scite + Scite Helper Script + 1.00 + + + + + convert spell-*.txt into spell-*.lua + + + + ]] local application = logs.application { @@ -242,6 +251,8 @@ end if environment.argument("words") then scripts.scite.words() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-server.lua b/scripts/context/lua/mtx-server.lua index 766df8da8..5ec15de70 100644 --- a/scripts/context/lua/mtx-server.lua +++ b/scripts/context/lua/mtx-server.lua @@ -7,12 +7,26 @@ if not modules then modules = { } end modules ['mtx-server'] = { } local helpinfo = [[ ---start start server ---port port to listen to ---root server root ---scripts scripts sub path ---index index file ---auto start on own path + + + + mtx-server + Simple Webserver For Helpers + 0.10 + + + + + start server + port to listen to + server root + scripts sub path + index file + start on own path + + + + ]] local application = logs.application { @@ -379,6 +393,8 @@ elseif environment.argument("start") then scripts = environment.argument("scripts"), script = environment.argument("script"), } +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-texworks.lua b/scripts/context/lua/mtx-texworks.lua index 33e56df46..ae5f2afa4 100644 --- a/scripts/context/lua/mtx-texworks.lua +++ b/scripts/context/lua/mtx-texworks.lua @@ -7,8 +7,22 @@ if not modules then modules = { } end modules ['mtx-texworks'] = { } local helpinfo = [[ ---start [--verbose] start texworks ---test report what will happen + + + + mtx-texworks + TeXworks Startup Script + 1.00 + + + + + [ start texworks + report what will happen + + + + ]] local application = logs.application { @@ -100,6 +114,8 @@ if environment.argument("start") then scripts.texworks.start(true) elseif environment.argument("test") then scripts.texworks.start() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-timing.lua b/scripts/context/lua/mtx-timing.lua index 03100e991..7d1a220e4 100644 --- a/scripts/context/lua/mtx-timing.lua +++ b/scripts/context/lua/mtx-timing.lua @@ -9,9 +9,23 @@ 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 + + + + mtx-timing + ConTeXt Timing Tools + 0.10 + + + + + make xhtml file + launch after conversion + remove after launching + + + + ]] local application = logs.application { @@ -196,6 +210,8 @@ end if environment.argument("xhtml") then scripts.timings.xhtml(environment.files[1] or "") +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-tools.lua b/scripts/context/lua/mtx-tools.lua index 22a83e603..19b7458a1 100644 --- a/scripts/context/lua/mtx-tools.lua +++ b/scripts/context/lua/mtx-tools.lua @@ -9,22 +9,37 @@ if not modules then modules = { } end modules ['mtx-tools'] = { local find, format, sub, rep, gsub, lower = string.find, string.format, string.sub, string.rep, string.gsub, string.lower local helpinfo = [[ ---disarmutfbomb remove utf bomb if present - --force remove indeed - ---dirtoxml glob directory into xml - --pattern glob pattern (default: *) - --url url attribute (no processing) - --root the root of the globbed path (default: .) - --output output filename (console by default) - --recurse recurse into subdirecories - --stripname take pathpart of given pattern - --longname set name attributes to full path name - ---downcase - --pattern glob pattern (default: *) - --recurse recurse into subdirecories - --force downcase indeed + + + + mtx-tools + Some File Related Goodies + 1.01 + + + + + remove utf bomb if present + remove indeed + + + glob directory into xml + glob pattern (default: *) + url attribute (no processing) + the root of the globbed path (default: .) + output filename (console by default) + recurse into subdirecories + take pathpart of given pattern + set name attributes to full path name + + + glob pattern (default: *) + recurse into subdirecories + downcase indeed + + + + ]] local application = logs.application { @@ -177,6 +192,8 @@ elseif environment.argument("dirtoxml") then scripts.tools.dirtoxml() elseif environment.argument("downcase") then scripts.tools.downcase() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-unzip.lua b/scripts/context/lua/mtx-unzip.lua index 645863426..02d9676bc 100644 --- a/scripts/context/lua/mtx-unzip.lua +++ b/scripts/context/lua/mtx-unzip.lua @@ -11,9 +11,23 @@ if not modules then modules = { } end modules ['mtx-unzip'] = { local format = string.format local helpinfo = [[ ---list list files in archive ---junk flatten unzipped directory structure ---extract extract files + + + + mtx-unzip + Simple Unzipper + 0.10 + + + + + list files in archive + flatten unzipped directory structure + extract files + + + + ]] local application = logs.application { @@ -109,6 +123,8 @@ if environment.arguments["h"] or environment.arguments["help"] then application.help() elseif environment.arguments["l"] or environment.arguments["list"] then scripts.unzipper.list(zipfile) +elseif environment.arguments["exporthelp"] then + application.export(environment.arguments["exporthelp"],environment.files[1]) elseif environment.files[1] then -- implicit --extract scripts.unzipper.extract(zipfile) else diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 8eee996b5..64203d3e3 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -12,24 +12,38 @@ if not modules then modules = { } end modules ['mtx-update'] = { -- platforms that matter. local helpinfo = [[ ---platform=string platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc) ---server=string repository url (rsync://contextgarden.net) ---module=string repository url (minimals) ---repository=string specify version (current, experimental) ---context=string specify version (current, latest, beta, yyyy.mm.dd) ---rsync=string rsync binary (rsync) ---texroot=string installation directory (not guessed for the moment) ---engine=string tex engine (luatex, pdftex, xetex) ---modules=string extra modules (can be list or 'all') ---fonts=string additional fonts (can be list or 'all') ---goodies=string extra binaries (like scite and texworks) ---force instead of a dryrun, do the real thing ---update update minimal tree ---make also make formats and generate file databases ---keep don't delete unused or obsolete files ---state update tree using saved state ---cygwin adapt drive specs to cygwin ---mingw assume mingw binaries being used + + + + mtx-update + ConTeXt Minimals Updater + 0.31 + + + + + platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc) + repository url (rsync://contextgarden.net) + repository url (minimals) + specify version (current, experimental) + specify version (current, latest, beta, yyyy.mm.dd) + rsync binary (rsync) + installation directory (not guessed for the moment) + tex engine (luatex, pdftex, xetex) + extra modules (can be list or 'all') + additional fonts (can be list or 'all') + extra binaries (like scite and texworks) + instead of a dryrun, do the real thing + update minimal tree + also make formats and generate file databases + don't delete unused or obsolete files + update tree using saved state + adapt drive specs to cygwin + assume mingw binaries being used + + + + ]] local application = logs.application { @@ -646,6 +660,8 @@ if environment.argument("update") then end elseif environment.argument("make") then scripts.update.make() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtx-watch.lua b/scripts/context/lua/mtx-watch.lua index 4ed7b1575..95323f571 100644 --- a/scripts/context/lua/mtx-watch.lua +++ b/scripts/context/lua/mtx-watch.lua @@ -7,14 +7,28 @@ if not modules then modules = { } end modules ['mtx-watch'] = { } local helpinfo = [[ ---logpath optional path for log files ---watch watch given path [--delay] ---pipe use pipe instead of execute ---delay delay between sweeps ---automachine replace /machine/ in path // ---collect condense log files ---cleanup=delay remove files in given path [--force] ---showlog show log data + + + + mtx-watch + ConTeXt Request Watchdog + 1.00 + + + + + optional path for log files + watch given path [ + use pipe instead of execute + delay between sweeps + replace /machine/ in path /servername/ + condense log files + remove files in given path [ + show log data + + + + ]] local application = logs.application { @@ -410,6 +424,8 @@ elseif environment.argument("cleanup") then scripts.watch.save_logs(scripts.watch.cleanup_stale_files()) elseif environment.argument("showlog") then scripts.watch.show_logs() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 92c9a763a..ef405fb1e 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -6072,7 +6072,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 21510, stripped down to: 15167 +-- original size: 21573, stripped down to: 15212 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -6588,7 +6588,10 @@ local reporters={ info=reportinfo, export=reportexport, } +local exporters={ +} logs.reporters=reporters +logs.exporters=exporters function logs.application(t) t.name=t.name or "unknown" t.banner=t.banner @@ -11178,7 +11181,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 3490, stripped down to: 2879 +-- original size: 4104, stripped down to: 3380 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11217,9 +11220,9 @@ local function showhelp(specification,...) local value=flag.at.value local short=xmltext(xmlfirst(flag,"/short")) if value then - report("--%-24s %s",formatters["%s=%s"](name,value),short) + report("--%-20s %s",formatters["%s=%s"](name,value),short) else - report("--%-24s %s",name,short) + report("--%-20s %s",name,short) end end report() @@ -11242,6 +11245,12 @@ local function showhelp(specification,...) report() end end + for comment in xmlcollected(root,"/application/comments/comment") do + local comment=xmltext(comment) + report() + report(comment) + report() + end end local reporthelp=reporters.help local exporthelp=reporters.export @@ -11253,14 +11262,30 @@ function reporters.help(t,...) reporthelp(t,...) end end +local exporters=logs.exporters function reporters.export(t,method,filename) dofile(resolvers.findfile("trac-exp.lua","tex")) - local exporters=logs.exporters - local result=method and exporters and exporters[method] and exporters[method](t,method) or exporthelp(t) - if type(filename)=="string" and filename~="" then - io.savedata(filename,result) + if not exporters or not method then + return exporthelp(t) + end + if method=="all" then + method=table.keys(exporters) else - reporters.lines(t,result) + method={ method } + end + filename=type(filename)=="string" and filename~="" and filename or false + for i=1,#method do + local m=method[i] + local result=exporters[m](t,m) + if result and result~="" then + if filename then + local fullname=file.replacesuffix(filename,m) + t.report("saving export in %a",fullname) + io.savedata(fullname,result) + else + reporters.lines(t,result) + end + end end end @@ -15513,8 +15538,8 @@ end -- of closure -- used libraries : l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 640903 --- stripped bytes : 231417 +-- original bytes : 641580 +-- stripped bytes : 231548 -- end library merge diff --git a/scripts/context/ruby/mpstools.rb b/scripts/context/ruby/mpstools.rb deleted file mode 100644 index 534bfb95b..000000000 --- a/scripts/context/ruby/mpstools.rb +++ /dev/null @@ -1,7 +0,0 @@ -# todo -# -# this script will replace mptopdf and makempy - -puts("This program is yet unfinished, for the moment it just calls 'mptopdf'.\n\n") - -system("texmfstart mptopdf #{ARGV.join(' ')}") diff --git a/scripts/context/ruby/texsync.rb b/scripts/context/ruby/texsync.rb deleted file mode 100644 index fd6593f05..000000000 --- a/scripts/context/ruby/texsync.rb +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env ruby - -# program : texsync -# copyright : PRAGMA Advanced Document Engineering -# version : 2003-2005 -# author : Hans Hagen -# -# project : ConTeXt / eXaMpLe -# concept : Hans Hagen -# info : j.hagen@xs4all.nl -# www : www.pragma-ade.com - -# For the moment this script only handles the 'minimal' context -# distribution. In due time I will add a few more options, like -# synchronization of the iso image. - -# taco's sync: rsync -au -v rsync://www.pragma-ade.com/all ./htdocs - -banner = ['TeXSync', 'version 1.1.1', '2002/2004', 'PRAGMA ADE/POD'] - -$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq! - -require 'base/switch' -require 'base/logger' -# require 'base/tool' - -require 'rbconfig' - -class Commands - - include CommandBase - - @@formats = ['en','nl','de','cz','it','ro', 'fr'] - @@always = ['metafun','mptopdf','en','nl'] - @@rsync = 'rsync -r -z -c --progress --stats "--exclude=*.fmt" "--exclude=*.efmt" "--exclude=*.mem"' - - @@kpsewhich = Hash.new - - @@kpsewhich['minimal'] = 'SELFAUTOPARENT' - @@kpsewhich['context'] = 'TEXMFLOCAL' - @@kpsewhich['documentation'] = 'TEXMFLOCAL' - @@kpsewhich['unknown'] = 'SELFAUTOPARENT' - - def update - - report - - return unless destination = getdestination - - texpaths = gettexpaths - address = option('address') - user = option('user') - tree = option('tree') - force = option('force') - - ok = true - begin - report("synchronizing '#{tree}' from '#{address}' to '#{destination}'") - report - if texpaths then - texpaths.each do |path| - report("synchronizing path '#{path}' of '#{tree}' from '#{address}' to '#{destination}'") - command = "#{rsync} #{user}@#{address}::#{tree}/#{path} #{destination}/{path}" - ok = ok && system(command) if force - end - else - command = "#{@@rsync} #{user}@#{address}::#{tree} #{destination}" - ok = system(command) if force - end - rescue - report("error in running rsync") - ok = false - ensure - if force then - if ok then - if option('make') then - report("generating tex and metapost formats") - report - @@formats.delete_if do |f| - begin - `kpsewhich cont-#{f}`.chomp.empty? - rescue - end - end - str = [@@formats,@@always].flatten.uniq.join(' ') - begin - system("texexec --make --alone #{str}") - rescue - report("unable to generate formats '#{str}'") - else - report - end - else - report("regenerate the formats files if needed") - end - else - report("error in synchronizing '#{tree}'") - end - else - report("provide --force to execute '#{command}'") unless force - end - end - - end - - def list - - report - - address = option('address') - user = option('user') - result = nil - - begin - report("fetching list of trees from '#{address}'") - command = "#{@@rsync} #{user}@#{address}::" - if option('force') then - result = `#{command}`.chomp - else - report("provide --force to execute '#{command}'") - end - rescue - result = nil - else - if result then - report("available trees:") - report - reportlines(result) - end - ensure - report("unable to fetch list") unless result - end - - end - - private - - def gettexpaths - if option('full') then - texpaths = ['texmf','texmf-local','texmf-fonts','texmf-mswin','texmf-linux','texmf-macos'] - elsif option('terse') then - texpaths = ['texmf','texmf-local','texmf-fonts'] - case RbConfig::CONFIG['host_os'] # or: Tool.ruby_platform - when /mswin/ then texpaths.push('texmf-mswin') - when /linux/ then texpaths.push('texmf-linux') - when /darwin/ then texpaths.push('texmf-macosx') - end - else - texpaths = nil - end - texpaths - end - - def getdestination - if (destination = option('destination')) && ! destination.empty? then - begin - if @@kpsewhich.key?(destination) then - destination = @@kpsewhich[option('tree')] || @@kpsewhich['unknown'] - destination = `kpsewhich --expand-var=$#{destination}`.chomp - elsif ! FileTest.directory?(destination) then - destination = nil - end - rescue - report("unable to determine destination tex root") - else - if ! destination || destination.empty? then - report("no destination is specified") - elsif not FileTest.directory?(destination) then - report("invalid destination '#{destination}'") - elsif not FileTest.writable?(destination) then - report("destination '#{destination}' is not writable") - else - report("using destination '#{destination}'") - return destination - end - end - else - report("unknown destination") - end - return nil - end - -end - -logger = Logger.new(banner.shift) -commandline = CommandLine.new - -commandline.registeraction('update', 'update installed tree') -commandline.registeraction('list', 'list available trees') - -commandline.registerflag('terse', 'download as less as possible (esp binaries)') -commandline.registerflag('full', 'download everything (all binaries)') -commandline.registerflag('force', 'confirm action') -commandline.registerflag('make', 'remake formats') - -commandline.registervalue('address', 'www.pragma-ade.com', 'adress of repository (www.pragma-ade)') -commandline.registervalue('user', 'guest', 'user account (guest)') -commandline.registervalue('tree', 'tex', 'tree to synchronize (tex)') -commandline.registervalue('destination', nil, 'destination of tree (kpsewhich)') - -commandline.registeraction('help') -commandline.registeraction('version') - -commandline.expand - -Commands.new(commandline,logger,banner).send(commandline.action || 'help') diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 92c9a763a..ef405fb1e 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -6072,7 +6072,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 21510, stripped down to: 15167 +-- original size: 21573, stripped down to: 15212 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -6588,7 +6588,10 @@ local reporters={ info=reportinfo, export=reportexport, } +local exporters={ +} logs.reporters=reporters +logs.exporters=exporters function logs.application(t) t.name=t.name or "unknown" t.banner=t.banner @@ -11178,7 +11181,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 3490, stripped down to: 2879 +-- original size: 4104, stripped down to: 3380 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11217,9 +11220,9 @@ local function showhelp(specification,...) local value=flag.at.value local short=xmltext(xmlfirst(flag,"/short")) if value then - report("--%-24s %s",formatters["%s=%s"](name,value),short) + report("--%-20s %s",formatters["%s=%s"](name,value),short) else - report("--%-24s %s",name,short) + report("--%-20s %s",name,short) end end report() @@ -11242,6 +11245,12 @@ local function showhelp(specification,...) report() end end + for comment in xmlcollected(root,"/application/comments/comment") do + local comment=xmltext(comment) + report() + report(comment) + report() + end end local reporthelp=reporters.help local exporthelp=reporters.export @@ -11253,14 +11262,30 @@ function reporters.help(t,...) reporthelp(t,...) end end +local exporters=logs.exporters function reporters.export(t,method,filename) dofile(resolvers.findfile("trac-exp.lua","tex")) - local exporters=logs.exporters - local result=method and exporters and exporters[method] and exporters[method](t,method) or exporthelp(t) - if type(filename)=="string" and filename~="" then - io.savedata(filename,result) + if not exporters or not method then + return exporthelp(t) + end + if method=="all" then + method=table.keys(exporters) else - reporters.lines(t,result) + method={ method } + end + filename=type(filename)=="string" and filename~="" and filename or false + for i=1,#method do + local m=method[i] + local result=exporters[m](t,m) + if result and result~="" then + if filename then + local fullname=file.replacesuffix(filename,m) + t.report("saving export in %a",fullname) + io.savedata(fullname,result) + else + reporters.lines(t,result) + end + end end end @@ -15513,8 +15538,8 @@ end -- of closure -- used libraries : l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 640903 --- stripped bytes : 231417 +-- original bytes : 641580 +-- stripped bytes : 231548 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 92c9a763a..ef405fb1e 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -6072,7 +6072,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 21510, stripped down to: 15167 +-- original size: 21573, stripped down to: 15212 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -6588,7 +6588,10 @@ local reporters={ info=reportinfo, export=reportexport, } +local exporters={ +} logs.reporters=reporters +logs.exporters=exporters function logs.application(t) t.name=t.name or "unknown" t.banner=t.banner @@ -11178,7 +11181,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 3490, stripped down to: 2879 +-- original size: 4104, stripped down to: 3380 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11217,9 +11220,9 @@ local function showhelp(specification,...) local value=flag.at.value local short=xmltext(xmlfirst(flag,"/short")) if value then - report("--%-24s %s",formatters["%s=%s"](name,value),short) + report("--%-20s %s",formatters["%s=%s"](name,value),short) else - report("--%-24s %s",name,short) + report("--%-20s %s",name,short) end end report() @@ -11242,6 +11245,12 @@ local function showhelp(specification,...) report() end end + for comment in xmlcollected(root,"/application/comments/comment") do + local comment=xmltext(comment) + report() + report(comment) + report() + end end local reporthelp=reporters.help local exporthelp=reporters.export @@ -11253,14 +11262,30 @@ function reporters.help(t,...) reporthelp(t,...) end end +local exporters=logs.exporters function reporters.export(t,method,filename) dofile(resolvers.findfile("trac-exp.lua","tex")) - local exporters=logs.exporters - local result=method and exporters and exporters[method] and exporters[method](t,method) or exporthelp(t) - if type(filename)=="string" and filename~="" then - io.savedata(filename,result) + if not exporters or not method then + return exporthelp(t) + end + if method=="all" then + method=table.keys(exporters) else - reporters.lines(t,result) + method={ method } + end + filename=type(filename)=="string" and filename~="" and filename or false + for i=1,#method do + local m=method[i] + local result=exporters[m](t,m) + if result and result~="" then + if filename then + local fullname=file.replacesuffix(filename,m) + t.report("saving export in %a",fullname) + io.savedata(fullname,result) + else + reporters.lines(t,result) + end + end end end @@ -15513,8 +15538,8 @@ end -- of closure -- used libraries : l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 640903 --- stripped bytes : 231417 +-- original bytes : 641580 +-- stripped bytes : 231548 -- end library merge -- cgit v1.2.3