diff options
-rw-r--r-- | doc/context/scripts/mkiv/context.xml | 366 | ||||
-rw-r--r-- | doc/context/scripts/mkiv/mtx-context.xml | 366 | ||||
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 191 | ||||
-rw-r--r-- | scripts/context/lua/mtx-context.xml | 187 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 58 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 58 | ||||
-rw-r--r-- | scripts/context/stubs/unix/mtxrun | 58 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4131 -> 4129 bytes | |||
-rw-r--r-- | tex/context/base/context-version.png | bin | 40141 -> 40393 bytes | |||
-rw-r--r-- | tex/context/base/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24813 -> 24805 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 211541 -> 211450 bytes | |||
-rw-r--r-- | tex/context/base/trac-xml.lua | 66 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
17 files changed, 781 insertions, 579 deletions
diff --git a/doc/context/scripts/mkiv/context.xml b/doc/context/scripts/mkiv/context.xml index 6f52c2a91..6eb8afeb1 100644 --- a/doc/context/scripts/mkiv/context.xml +++ b/doc/context/scripts/mkiv/context.xml @@ -1,185 +1,187 @@ <?xml version="1.0" ?> + <application> - <metadata> - <entry name="name">mtx-context</entry> - <entry name="detail">ConTeXt Process Management</entry> - <entry name="version">0.60</entry> - </metadata> - <flags> - <category name="basic"> - <subcategory> - <flag name="run"> - <short>process (one or more) files (default action)</short> - </flag> - <flag name="make"> - <short>create context formats</short> - </flag> - </subcategory> - <subcategory> - <flag name="ctx=name"> - <short>use ctx file (process management specification)</short> - </flag> - <flag name="interface"> - <short>use specified user interface (default: en)</short> - </flag> - </subcategory> - <subcategory> - <flag name="autopdf"> - <short>close pdf file in viewer and start pdf viewer afterwards</short> - </flag> - <flag name="purge"> - <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - <flag name="purgeall"> - <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - </subcategory> - <subcategory> - <flag name="usemodule" value="list"> - <short>load the given module or style, normally part of the distribution</short> - </flag> - <flag name="environment" value="list"> - <short>load the given environment file first (document styles)</short> - </flag> - <flag name="mode" value="list"> - <short>enable given the modes (conditional processing in styles)</short> - </flag> - <flag name="path" value="list"> - <short>also consult the given paths when files are looked for</short> - </flag> - <flag name="arguments" value="list"> - <short>set variables that can be consulted during a run (key/value pairs)</short> - </flag> - <flag name="randomseed" value="number"> - <short>set the randomseed</short> - </flag> - <flag name="result" value="name"> - <short>rename the resulting output to the given name</short> - </flag> - <flag name="trackers" value="list"> - <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> - </flag> - <flag name="directives" value="list"> - <short>set directive variables (show list with <ref name="showdirectives"/>)</short> - </flag> - <flag name="silent" value="list"> - <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> - </flag> - <flag name="noconsole"> - <short>disable logging to the console (logfile only)</short> - </flag> - <flag name="purgeresult"> - <short>purge result file before run</short> - </flag> - </subcategory> - <subcategory> - <flag name="forcexml"> - <short>force xml stub</short> - </flag> - <flag name="forcecld"> - <short>force cld (context lua document) stub</short> - </flag> - <flag name="forcelua"> - <short>force lua stub (like texlua)</short> - </flag> - <flag name="forcemp"> - <short>force mp stub</short> - </flag> - </subcategory> - <subcategory> - <flag name="arrange"> - <short>run extra imposition pass, given that the style sets up imposition</short> - </flag> - <flag name="noarrange"> - <short>ignore imposition specifications in the style</short> - </flag> - </subcategory> - <subcategory> - <flag name="jit"> - <short>use luajittex with jit turned off (only use the faster virtual machine)</short> - </flag> - <flag name="jiton"> - <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> - </flag> - </subcategory> - <subcategory> - <flag name="once"> - <short>only run once (no multipass data file is produced)</short> - </flag> - <flag name="batchmode"> - <short>run without stopping and do not show messages on the console</short> - </flag> - <flag name="nonstopmode"> - <short>run without stopping</short> - </flag> - <flag name="synctex"> - <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> - </flag> - </subcategory> - <subcategory> - <flag name="generate"> - <short>generate file database etc. (as luatools does)</short> - </flag> - <flag name="paranoid"> - <short>do not descend to .. and ../..</short> - </flag> - <flag name="version"> - <short>report installed context version</short> - </flag> - </subcategory> - <subcategory> - <flag name="global"> - <short>assume given file present elsewhere</short> - </flag> - <flag name="nofile"> - <short>use dummy file as jobname</short> - </flag> - </subcategory> - </category> - <category name="expert"> - <subcategory> - <flag name="touch"> - <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> - </flag> - <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> - </flag> - <flag name="update"> - <short>update context from website (not to be confused with contextgarden)</short> - </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> - </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> - </flag> - </subcategory> - <subcategory> - <flag name="extra=name"> - <short>process extra (mtx-context-... in distribution)</short> - </flag> - <flag name="extras"> - <short>show extras</short> - </flag> - </subcategory> - </category> - <category name="special"> - <subcategory> - <flag name="pdftex"> - <short>process file with texexec using pdftex</short> - </flag> - <flag name="xetex"> - <short>process file with texexec using xetex</short> - </flag> - <flag name="mkii"> - <short>process file with texexec</short> - </flag> - </subcategory> - <subcategory> - <flag name="pipe"> - <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> - </flag> - </subcategory> - </category> - </flags> + <metadata> + <entry name="name">mtx-context</entry> + <entry name="detail">ConTeXt Process Management</entry> + <entry name="version">0.60</entry> + <entry name="comment">external helpinfo file</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="run"> + <short>process (one or more) files (default action)</short> + </flag> + <flag name="make"> + <short>create context formats</short> + </flag> + </subcategory> + <subcategory> + <flag name="ctx=name"> + <short>use ctx file (process management specification)</short> + </flag> + <flag name="interface"> + <short>use specified user interface (default: en)</short> + </flag> + </subcategory> + <subcategory> + <flag name="autopdf"> + <short>close pdf file in viewer and start pdf viewer afterwards</short> + </flag> + <flag name="purge"> + <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + <flag name="purgeall"> + <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + </subcategory> + <subcategory> + <flag name="usemodule" value="list"> + <short>load the given module or style, normally part of the distribution</short> + </flag> + <flag name="environment" value="list"> + <short>load the given environment file first (document styles)</short> + </flag> + <flag name="mode" value="list"> + <short>enable given the modes (conditional processing in styles)</short> + </flag> + <flag name="path" value="list"> + <short>also consult the given paths when files are looked for</short> + </flag> + <flag name="arguments" value="list"> + <short>set variables that can be consulted during a run (key/value pairs)</short> + </flag> + <flag name="randomseed" value="number"> + <short>set the randomseed</short> + </flag> + <flag name="result" value="name"> + <short>rename the resulting output to the given name</short> + </flag> + <flag name="trackers" value="list"> + <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> + </flag> + <flag name="directives" value="list"> + <short>set directive variables (show list with <ref name="showdirectives"/>)</short> + </flag> + <flag name="silent" value="list"> + <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> + </flag> + <flag name="noconsole"> + <short>disable logging to the console (logfile only)</short> + </flag> + <flag name="purgeresult"> + <short>purge result file before run</short> + </flag> + </subcategory> + <subcategory> + <flag name="forcexml"> + <short>force xml stub</short> + </flag> + <flag name="forcecld"> + <short>force cld (context lua document) stub</short> + </flag> + <flag name="forcelua"> + <short>force lua stub (like texlua)</short> + </flag> + <flag name="forcemp"> + <short>force mp stub</short> + </flag> + </subcategory> + <subcategory> + <flag name="arrange"> + <short>run extra imposition pass, given that the style sets up imposition</short> + </flag> + <flag name="noarrange"> + <short>ignore imposition specifications in the style</short> + </flag> + </subcategory> + <subcategory> + <flag name="jit"> + <short>use luajittex with jit turned off (only use the faster virtual machine)</short> + </flag> + <flag name="jiton"> + <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> + </flag> + </subcategory> + <subcategory> + <flag name="once"> + <short>only run once (no multipass data file is produced)</short> + </flag> + <flag name="batchmode"> + <short>run without stopping and do not show messages on the console</short> + </flag> + <flag name="nonstopmode"> + <short>run without stopping</short> + </flag> + <flag name="synctex"> + <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> + </flag> + </subcategory> + <subcategory> + <flag name="generate"> + <short>generate file database etc. (as luatools does)</short> + </flag> + <flag name="paranoid"> + <short>do not descend to .. and ../..</short> + </flag> + <flag name="version"> + <short>report installed context version</short> + </flag> + </subcategory> + <subcategory> + <flag name="global"> + <short>assume given file present elsewhere</short> + </flag> + <flag name="nofile"> + <short>use dummy file as jobname</short> + </flag> + </subcategory> + </category> + <category name="expert"> + <subcategory> + <flag name="touch"> + <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> + </flag> + <flag name="nostatistics"> + <short>omit runtime statistics at the end of the run</short> + </flag> + <flag name="update"> + <short>update context from website (not to be confused with contextgarden)</short> + </flag> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + </flag> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + </subcategory> + <subcategory> + <flag name="extra=name"> + <short>process extra (mtx-context-... in distribution)</short> + </flag> + <flag name="extras"> + <short>show extras</short> + </flag> + </subcategory> + </category> + <category name="special"> + <subcategory> + <flag name="pdftex"> + <short>process file with texexec using pdftex</short> + </flag> + <flag name="xetex"> + <short>process file with texexec using xetex</short> + </flag> + <flag name="mkii"> + <short>process file with texexec</short> + </flag> + </subcategory> + <subcategory> + <flag name="pipe"> + <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> + </flag> + </subcategory> + </category> + </flags> </application> diff --git a/doc/context/scripts/mkiv/mtx-context.xml b/doc/context/scripts/mkiv/mtx-context.xml index 6f52c2a91..6eb8afeb1 100644 --- a/doc/context/scripts/mkiv/mtx-context.xml +++ b/doc/context/scripts/mkiv/mtx-context.xml @@ -1,185 +1,187 @@ <?xml version="1.0" ?> + <application> - <metadata> - <entry name="name">mtx-context</entry> - <entry name="detail">ConTeXt Process Management</entry> - <entry name="version">0.60</entry> - </metadata> - <flags> - <category name="basic"> - <subcategory> - <flag name="run"> - <short>process (one or more) files (default action)</short> - </flag> - <flag name="make"> - <short>create context formats</short> - </flag> - </subcategory> - <subcategory> - <flag name="ctx=name"> - <short>use ctx file (process management specification)</short> - </flag> - <flag name="interface"> - <short>use specified user interface (default: en)</short> - </flag> - </subcategory> - <subcategory> - <flag name="autopdf"> - <short>close pdf file in viewer and start pdf viewer afterwards</short> - </flag> - <flag name="purge"> - <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - <flag name="purgeall"> - <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - </subcategory> - <subcategory> - <flag name="usemodule" value="list"> - <short>load the given module or style, normally part of the distribution</short> - </flag> - <flag name="environment" value="list"> - <short>load the given environment file first (document styles)</short> - </flag> - <flag name="mode" value="list"> - <short>enable given the modes (conditional processing in styles)</short> - </flag> - <flag name="path" value="list"> - <short>also consult the given paths when files are looked for</short> - </flag> - <flag name="arguments" value="list"> - <short>set variables that can be consulted during a run (key/value pairs)</short> - </flag> - <flag name="randomseed" value="number"> - <short>set the randomseed</short> - </flag> - <flag name="result" value="name"> - <short>rename the resulting output to the given name</short> - </flag> - <flag name="trackers" value="list"> - <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> - </flag> - <flag name="directives" value="list"> - <short>set directive variables (show list with <ref name="showdirectives"/>)</short> - </flag> - <flag name="silent" value="list"> - <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> - </flag> - <flag name="noconsole"> - <short>disable logging to the console (logfile only)</short> - </flag> - <flag name="purgeresult"> - <short>purge result file before run</short> - </flag> - </subcategory> - <subcategory> - <flag name="forcexml"> - <short>force xml stub</short> - </flag> - <flag name="forcecld"> - <short>force cld (context lua document) stub</short> - </flag> - <flag name="forcelua"> - <short>force lua stub (like texlua)</short> - </flag> - <flag name="forcemp"> - <short>force mp stub</short> - </flag> - </subcategory> - <subcategory> - <flag name="arrange"> - <short>run extra imposition pass, given that the style sets up imposition</short> - </flag> - <flag name="noarrange"> - <short>ignore imposition specifications in the style</short> - </flag> - </subcategory> - <subcategory> - <flag name="jit"> - <short>use luajittex with jit turned off (only use the faster virtual machine)</short> - </flag> - <flag name="jiton"> - <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> - </flag> - </subcategory> - <subcategory> - <flag name="once"> - <short>only run once (no multipass data file is produced)</short> - </flag> - <flag name="batchmode"> - <short>run without stopping and do not show messages on the console</short> - </flag> - <flag name="nonstopmode"> - <short>run without stopping</short> - </flag> - <flag name="synctex"> - <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> - </flag> - </subcategory> - <subcategory> - <flag name="generate"> - <short>generate file database etc. (as luatools does)</short> - </flag> - <flag name="paranoid"> - <short>do not descend to .. and ../..</short> - </flag> - <flag name="version"> - <short>report installed context version</short> - </flag> - </subcategory> - <subcategory> - <flag name="global"> - <short>assume given file present elsewhere</short> - </flag> - <flag name="nofile"> - <short>use dummy file as jobname</short> - </flag> - </subcategory> - </category> - <category name="expert"> - <subcategory> - <flag name="touch"> - <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> - </flag> - <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> - </flag> - <flag name="update"> - <short>update context from website (not to be confused with contextgarden)</short> - </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> - </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> - </flag> - </subcategory> - <subcategory> - <flag name="extra=name"> - <short>process extra (mtx-context-... in distribution)</short> - </flag> - <flag name="extras"> - <short>show extras</short> - </flag> - </subcategory> - </category> - <category name="special"> - <subcategory> - <flag name="pdftex"> - <short>process file with texexec using pdftex</short> - </flag> - <flag name="xetex"> - <short>process file with texexec using xetex</short> - </flag> - <flag name="mkii"> - <short>process file with texexec</short> - </flag> - </subcategory> - <subcategory> - <flag name="pipe"> - <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> - </flag> - </subcategory> - </category> - </flags> + <metadata> + <entry name="name">mtx-context</entry> + <entry name="detail">ConTeXt Process Management</entry> + <entry name="version">0.60</entry> + <entry name="comment">external helpinfo file</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="run"> + <short>process (one or more) files (default action)</short> + </flag> + <flag name="make"> + <short>create context formats</short> + </flag> + </subcategory> + <subcategory> + <flag name="ctx=name"> + <short>use ctx file (process management specification)</short> + </flag> + <flag name="interface"> + <short>use specified user interface (default: en)</short> + </flag> + </subcategory> + <subcategory> + <flag name="autopdf"> + <short>close pdf file in viewer and start pdf viewer afterwards</short> + </flag> + <flag name="purge"> + <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + <flag name="purgeall"> + <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + </subcategory> + <subcategory> + <flag name="usemodule" value="list"> + <short>load the given module or style, normally part of the distribution</short> + </flag> + <flag name="environment" value="list"> + <short>load the given environment file first (document styles)</short> + </flag> + <flag name="mode" value="list"> + <short>enable given the modes (conditional processing in styles)</short> + </flag> + <flag name="path" value="list"> + <short>also consult the given paths when files are looked for</short> + </flag> + <flag name="arguments" value="list"> + <short>set variables that can be consulted during a run (key/value pairs)</short> + </flag> + <flag name="randomseed" value="number"> + <short>set the randomseed</short> + </flag> + <flag name="result" value="name"> + <short>rename the resulting output to the given name</short> + </flag> + <flag name="trackers" value="list"> + <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> + </flag> + <flag name="directives" value="list"> + <short>set directive variables (show list with <ref name="showdirectives"/>)</short> + </flag> + <flag name="silent" value="list"> + <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> + </flag> + <flag name="noconsole"> + <short>disable logging to the console (logfile only)</short> + </flag> + <flag name="purgeresult"> + <short>purge result file before run</short> + </flag> + </subcategory> + <subcategory> + <flag name="forcexml"> + <short>force xml stub</short> + </flag> + <flag name="forcecld"> + <short>force cld (context lua document) stub</short> + </flag> + <flag name="forcelua"> + <short>force lua stub (like texlua)</short> + </flag> + <flag name="forcemp"> + <short>force mp stub</short> + </flag> + </subcategory> + <subcategory> + <flag name="arrange"> + <short>run extra imposition pass, given that the style sets up imposition</short> + </flag> + <flag name="noarrange"> + <short>ignore imposition specifications in the style</short> + </flag> + </subcategory> + <subcategory> + <flag name="jit"> + <short>use luajittex with jit turned off (only use the faster virtual machine)</short> + </flag> + <flag name="jiton"> + <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> + </flag> + </subcategory> + <subcategory> + <flag name="once"> + <short>only run once (no multipass data file is produced)</short> + </flag> + <flag name="batchmode"> + <short>run without stopping and do not show messages on the console</short> + </flag> + <flag name="nonstopmode"> + <short>run without stopping</short> + </flag> + <flag name="synctex"> + <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> + </flag> + </subcategory> + <subcategory> + <flag name="generate"> + <short>generate file database etc. (as luatools does)</short> + </flag> + <flag name="paranoid"> + <short>do not descend to .. and ../..</short> + </flag> + <flag name="version"> + <short>report installed context version</short> + </flag> + </subcategory> + <subcategory> + <flag name="global"> + <short>assume given file present elsewhere</short> + </flag> + <flag name="nofile"> + <short>use dummy file as jobname</short> + </flag> + </subcategory> + </category> + <category name="expert"> + <subcategory> + <flag name="touch"> + <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> + </flag> + <flag name="nostatistics"> + <short>omit runtime statistics at the end of the run</short> + </flag> + <flag name="update"> + <short>update context from website (not to be confused with contextgarden)</short> + </flag> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + </flag> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + </subcategory> + <subcategory> + <flag name="extra=name"> + <short>process extra (mtx-context-... in distribution)</short> + </flag> + <flag name="extras"> + <short>show extras</short> + </flag> + </subcategory> + </category> + <category name="special"> + <subcategory> + <flag name="pdftex"> + <short>process file with texexec using pdftex</short> + </flag> + <flag name="xetex"> + <short>process file with texexec using xetex</short> + </flag> + <flag name="mkii"> + <short>process file with texexec</short> + </flag> + </subcategory> + <subcategory> + <flag name="pipe"> + <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> + </flag> + </subcategory> + </category> + </flags> </application> diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 1035267e0..3fa4a094c 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -19,198 +19,11 @@ local lpegpatterns, lpegmatch, Cs, P = lpeg.patterns, lpeg.match, lpeg.Cs, lpeg. local getargument = environment.getargument or environment.argument local setargument = environment.setargument -local helpinfo = [[ -<?xml version="1.0" ?> -<application> - <metadata> - <entry name="name">mtx-context</entry> - <entry name="detail">ConTeXt Process Management</entry> - <entry name="version">0.60</entry> - </metadata> - <flags> - <category name="basic"> - <subcategory> - <flag name="run"> - <short>process (one or more) files (default action)</short> - </flag> - <flag name="make"> - <short>create context formats</short> - </flag> - </subcategory> - <subcategory> - <flag name="ctx=name"> - <short>use ctx file (process management specification)</short> - </flag> - <flag name="interface"> - <short>use specified user interface (default: en)</short> - </flag> - </subcategory> - <subcategory> - <flag name="autopdf"> - <short>close pdf file in viewer and start pdf viewer afterwards</short> - </flag> - <flag name="purge"> - <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - <flag name="purgeall"> - <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> - </flag> - </subcategory> - <subcategory> - <flag name="usemodule" value="list"> - <short>load the given module or style, normally part of the distribution</short> - </flag> - <flag name="environment" value="list"> - <short>load the given environment file first (document styles)</short> - </flag> - <flag name="mode" value="list"> - <short>enable given the modes (conditional processing in styles)</short> - </flag> - <flag name="path" value="list"> - <short>also consult the given paths when files are looked for</short> - </flag> - <flag name="arguments" value="list"> - <short>set variables that can be consulted during a run (key/value pairs)</short> - </flag> - <flag name="randomseed" value="number"> - <short>set the randomseed</short> - </flag> - <flag name="result" value="name"> - <short>rename the resulting output to the given name</short> - </flag> - <flag name="trackers" value="list"> - <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> - </flag> - <flag name="directives" value="list"> - <short>set directive variables (show list with <ref name="showdirectives"/>)</short> - </flag> - <flag name="silent" value="list"> - <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> - </flag> - <flag name="noconsole"> - <short>disable logging to the console (logfile only)</short> - </flag> - <flag name="purgeresult"> - <short>purge result file before run</short> - </flag> - </subcategory> - <subcategory> - <flag name="forcexml"> - <short>force xml stub</short> - </flag> - <flag name="forcecld"> - <short>force cld (context lua document) stub</short> - </flag> - <flag name="forcelua"> - <short>force lua stub (like texlua)</short> - </flag> - <flag name="forcemp"> - <short>force mp stub</short> - </flag> - </subcategory> - <subcategory> - <flag name="arrange"> - <short>run extra imposition pass, given that the style sets up imposition</short> - </flag> - <flag name="noarrange"> - <short>ignore imposition specifications in the style</short> - </flag> - </subcategory> - <subcategory> - <flag name="jit"> - <short>use luajittex with jit turned off (only use the faster virtual machine)</short> - </flag> - <flag name="jiton"> - <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> - </flag> - </subcategory> - <subcategory> - <flag name="once"> - <short>only run once (no multipass data file is produced)</short> - </flag> - <flag name="batchmode"> - <short>run without stopping and do not show messages on the console</short> - </flag> - <flag name="nonstopmode"> - <short>run without stopping</short> - </flag> - <flag name="synctex"> - <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> - </flag> - </subcategory> - <subcategory> - <flag name="generate"> - <short>generate file database etc. (as luatools does)</short> - </flag> - <flag name="paranoid"> - <short>do not descend to .. and ../..</short> - </flag> - <flag name="version"> - <short>report installed context version</short> - </flag> - </subcategory> - <subcategory> - <flag name="global"> - <short>assume given file present elsewhere</short> - </flag> - <flag name="nofile"> - <short>use dummy file as jobname</short> - </flag> - </subcategory> - </category> - <category name="expert"> - <subcategory> - <flag name="touch"> - <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> - </flag> - <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> - </flag> - <flag name="update"> - <short>update context from website (not to be confused with contextgarden)</short> - </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> - </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> - </flag> - </subcategory> - <subcategory> - <flag name="extra=name"> - <short>process extra (mtx-context-... in distribution)</short> - </flag> - <flag name="extras"> - <short>show extras</short> - </flag> - </subcategory> - </category> - <category name="special"> - <subcategory> - <flag name="pdftex"> - <short>process file with texexec using pdftex</short> - </flag> - <flag name="xetex"> - <short>process file with texexec using xetex</short> - </flag> - <flag name="mkii"> - <short>process file with texexec</short> - </flag> - </subcategory> - <subcategory> - <flag name="pipe"> - <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> - </flag> - </subcategory> - </category> - </flags> -</application> -]] - local application = logs.application { name = "mtx-context", banner = "ConTeXt Process Management 0.60", - helpinfo = helpinfo, + -- helpinfo = helpinfo, -- table with { category_a = text_1, category_b = text_2 } or helpstring or xml_blob + helpinfo = "mtx-context.xml", } -- local luatexflags = { diff --git a/scripts/context/lua/mtx-context.xml b/scripts/context/lua/mtx-context.xml new file mode 100644 index 000000000..6eb8afeb1 --- /dev/null +++ b/scripts/context/lua/mtx-context.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" ?> + +<application> + <metadata> + <entry name="name">mtx-context</entry> + <entry name="detail">ConTeXt Process Management</entry> + <entry name="version">0.60</entry> + <entry name="comment">external helpinfo file</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="run"> + <short>process (one or more) files (default action)</short> + </flag> + <flag name="make"> + <short>create context formats</short> + </flag> + </subcategory> + <subcategory> + <flag name="ctx=name"> + <short>use ctx file (process management specification)</short> + </flag> + <flag name="interface"> + <short>use specified user interface (default: en)</short> + </flag> + </subcategory> + <subcategory> + <flag name="autopdf"> + <short>close pdf file in viewer and start pdf viewer afterwards</short> + </flag> + <flag name="purge"> + <short>purge files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + <flag name="purgeall"> + <short>purge all files either or not after a run (<ref name="pattern"/>=...)</short> + </flag> + </subcategory> + <subcategory> + <flag name="usemodule" value="list"> + <short>load the given module or style, normally part of the distribution</short> + </flag> + <flag name="environment" value="list"> + <short>load the given environment file first (document styles)</short> + </flag> + <flag name="mode" value="list"> + <short>enable given the modes (conditional processing in styles)</short> + </flag> + <flag name="path" value="list"> + <short>also consult the given paths when files are looked for</short> + </flag> + <flag name="arguments" value="list"> + <short>set variables that can be consulted during a run (key/value pairs)</short> + </flag> + <flag name="randomseed" value="number"> + <short>set the randomseed</short> + </flag> + <flag name="result" value="name"> + <short>rename the resulting output to the given name</short> + </flag> + <flag name="trackers" value="list"> + <short>set tracker variables (show list with <ref name="showtrackers"/>)</short> + </flag> + <flag name="directives" value="list"> + <short>set directive variables (show list with <ref name="showdirectives"/>)</short> + </flag> + <flag name="silent" value="list"> + <short>disable logcatgories (show list with <ref name="showlogcategories"/>)</short> + </flag> + <flag name="noconsole"> + <short>disable logging to the console (logfile only)</short> + </flag> + <flag name="purgeresult"> + <short>purge result file before run</short> + </flag> + </subcategory> + <subcategory> + <flag name="forcexml"> + <short>force xml stub</short> + </flag> + <flag name="forcecld"> + <short>force cld (context lua document) stub</short> + </flag> + <flag name="forcelua"> + <short>force lua stub (like texlua)</short> + </flag> + <flag name="forcemp"> + <short>force mp stub</short> + </flag> + </subcategory> + <subcategory> + <flag name="arrange"> + <short>run extra imposition pass, given that the style sets up imposition</short> + </flag> + <flag name="noarrange"> + <short>ignore imposition specifications in the style</short> + </flag> + </subcategory> + <subcategory> + <flag name="jit"> + <short>use luajittex with jit turned off (only use the faster virtual machine)</short> + </flag> + <flag name="jiton"> + <short>use luajittex with jit turned on (in most cases not faster, even slower)</short> + </flag> + </subcategory> + <subcategory> + <flag name="once"> + <short>only run once (no multipass data file is produced)</short> + </flag> + <flag name="batchmode"> + <short>run without stopping and do not show messages on the console</short> + </flag> + <flag name="nonstopmode"> + <short>run without stopping</short> + </flag> + <flag name="synctex"> + <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1)</short> + </flag> + </subcategory> + <subcategory> + <flag name="generate"> + <short>generate file database etc. (as luatools does)</short> + </flag> + <flag name="paranoid"> + <short>do not descend to .. and ../..</short> + </flag> + <flag name="version"> + <short>report installed context version</short> + </flag> + </subcategory> + <subcategory> + <flag name="global"> + <short>assume given file present elsewhere</short> + </flag> + <flag name="nofile"> + <short>use dummy file as jobname</short> + </flag> + </subcategory> + </category> + <category name="expert"> + <subcategory> + <flag name="touch"> + <short>update context version number (remake needed afterwards, also provide <ref name="expert"/>)</short> + </flag> + <flag name="nostatistics"> + <short>omit runtime statistics at the end of the run</short> + </flag> + <flag name="update"> + <short>update context from website (not to be confused with contextgarden)</short> + </flag> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + </flag> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + </subcategory> + <subcategory> + <flag name="extra=name"> + <short>process extra (mtx-context-... in distribution)</short> + </flag> + <flag name="extras"> + <short>show extras</short> + </flag> + </subcategory> + </category> + <category name="special"> + <subcategory> + <flag name="pdftex"> + <short>process file with texexec using pdftex</short> + </flag> + <flag name="xetex"> + <short>process file with texexec using xetex</short> + </flag> + <flag name="mkii"> + <short>process file with texexec</short> + </flag> + </subcategory> + <subcategory> + <flag name="pipe"> + <short>do not check for file and enter scroll mode (<ref name="dummyfile"/>=whatever.tmp)</short> + </flag> + </subcategory> + </category> + </flags> +</application> diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index e8de4ee70..0207724dd 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -11168,7 +11168,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 4104, stripped down to: 3380 +-- original size: 5959, stripped down to: 4592 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11241,9 +11241,41 @@ local function showhelp(specification,...) end local reporthelp=reporters.help local exporthelp=reporters.export -function reporters.help(t,...) +local function xmlfound(t) local helpinfo=t.helpinfo - if type(helpinfo)=="string" and string.find(helpinfo,"^<%?xml") then + if type(helpinfo)=="table" then + return false + end + if type(helpinfo)~="string" then + helpinfo="Warning: no helpinfo found." + t.helpinfo=helpinfo + return false + end + if string.find(helpinfo,".xml$") then + local ownscript=environment.ownscript + local helpdata=false + if ownscript then + local helpfile=file.join(file.pathpart(ownscript),helpinfo) + helpdata=io.loaddata(helpfile) + if helpdata=="" then + helpdata=false + end + end + if not helpdata then + local helpfile=resolvers.findfile(helpinfo,"tex") + helpdata=helpfile and io.loaddata(helpfile) + end + if helpdata and helpdata~="" then + helpinfo=helpdata + else + helpinfo=formatters["Warning: help file %a is not found."](helpinfo) + end + end + t.helpinfo=helpinfo + return string.find(t.helpinfo,"^<%?xml") and true or false +end +function reporters.help(t,...) + if xmlfound(t) then showhelp(t,...) else reporthelp(t,...) @@ -11251,16 +11283,30 @@ function reporters.help(t,...) end local exporters=logs.exporters function reporters.export(t,method,filename) + if not xmlfound(t) then + return exporthelp(t) + end dofile(resolvers.findfile("trac-exp.lua","tex")) if not exporters or not method then return exporthelp(t) end + if not method or method=="" then + method=environment.argument["exporthelp"] + end + if not filename or filename=="" then + filename=environment.files[1] + end if method=="all" then method=table.keys(exporters) else method={ method } end - filename=type(filename)=="string" and filename~="" and filename or false + if type(filename)~="string" or filename=="" then + filename=false + elseif file.pathpart(filename)=="" then + t.report("export file %a will not be saved on the current path (safeguard)") + filename=false + end for i=1,#method do local m=method[i] local result=exporters[m](t,m) @@ -15525,8 +15571,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 : 642686 --- stripped bytes : 233038 +-- original bytes : 644541 +-- stripped bytes : 233681 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index e8de4ee70..0207724dd 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -11168,7 +11168,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 4104, stripped down to: 3380 +-- original size: 5959, stripped down to: 4592 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11241,9 +11241,41 @@ local function showhelp(specification,...) end local reporthelp=reporters.help local exporthelp=reporters.export -function reporters.help(t,...) +local function xmlfound(t) local helpinfo=t.helpinfo - if type(helpinfo)=="string" and string.find(helpinfo,"^<%?xml") then + if type(helpinfo)=="table" then + return false + end + if type(helpinfo)~="string" then + helpinfo="Warning: no helpinfo found." + t.helpinfo=helpinfo + return false + end + if string.find(helpinfo,".xml$") then + local ownscript=environment.ownscript + local helpdata=false + if ownscript then + local helpfile=file.join(file.pathpart(ownscript),helpinfo) + helpdata=io.loaddata(helpfile) + if helpdata=="" then + helpdata=false + end + end + if not helpdata then + local helpfile=resolvers.findfile(helpinfo,"tex") + helpdata=helpfile and io.loaddata(helpfile) + end + if helpdata and helpdata~="" then + helpinfo=helpdata + else + helpinfo=formatters["Warning: help file %a is not found."](helpinfo) + end + end + t.helpinfo=helpinfo + return string.find(t.helpinfo,"^<%?xml") and true or false +end +function reporters.help(t,...) + if xmlfound(t) then showhelp(t,...) else reporthelp(t,...) @@ -11251,16 +11283,30 @@ function reporters.help(t,...) end local exporters=logs.exporters function reporters.export(t,method,filename) + if not xmlfound(t) then + return exporthelp(t) + end dofile(resolvers.findfile("trac-exp.lua","tex")) if not exporters or not method then return exporthelp(t) end + if not method or method=="" then + method=environment.argument["exporthelp"] + end + if not filename or filename=="" then + filename=environment.files[1] + end if method=="all" then method=table.keys(exporters) else method={ method } end - filename=type(filename)=="string" and filename~="" and filename or false + if type(filename)~="string" or filename=="" then + filename=false + elseif file.pathpart(filename)=="" then + t.report("export file %a will not be saved on the current path (safeguard)") + filename=false + end for i=1,#method do local m=method[i] local result=exporters[m](t,m) @@ -15525,8 +15571,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 : 642686 --- stripped bytes : 233038 +-- original bytes : 644541 +-- stripped bytes : 233681 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index e8de4ee70..0207724dd 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -11168,7 +11168,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-xml"] = package.loaded["trac-xml"] or true --- original size: 4104, stripped down to: 3380 +-- original size: 5959, stripped down to: 4592 if not modules then modules={} end modules ['trac-xml']={ version=1.001, @@ -11241,9 +11241,41 @@ local function showhelp(specification,...) end local reporthelp=reporters.help local exporthelp=reporters.export -function reporters.help(t,...) +local function xmlfound(t) local helpinfo=t.helpinfo - if type(helpinfo)=="string" and string.find(helpinfo,"^<%?xml") then + if type(helpinfo)=="table" then + return false + end + if type(helpinfo)~="string" then + helpinfo="Warning: no helpinfo found." + t.helpinfo=helpinfo + return false + end + if string.find(helpinfo,".xml$") then + local ownscript=environment.ownscript + local helpdata=false + if ownscript then + local helpfile=file.join(file.pathpart(ownscript),helpinfo) + helpdata=io.loaddata(helpfile) + if helpdata=="" then + helpdata=false + end + end + if not helpdata then + local helpfile=resolvers.findfile(helpinfo,"tex") + helpdata=helpfile and io.loaddata(helpfile) + end + if helpdata and helpdata~="" then + helpinfo=helpdata + else + helpinfo=formatters["Warning: help file %a is not found."](helpinfo) + end + end + t.helpinfo=helpinfo + return string.find(t.helpinfo,"^<%?xml") and true or false +end +function reporters.help(t,...) + if xmlfound(t) then showhelp(t,...) else reporthelp(t,...) @@ -11251,16 +11283,30 @@ function reporters.help(t,...) end local exporters=logs.exporters function reporters.export(t,method,filename) + if not xmlfound(t) then + return exporthelp(t) + end dofile(resolvers.findfile("trac-exp.lua","tex")) if not exporters or not method then return exporthelp(t) end + if not method or method=="" then + method=environment.argument["exporthelp"] + end + if not filename or filename=="" then + filename=environment.files[1] + end if method=="all" then method=table.keys(exporters) else method={ method } end - filename=type(filename)=="string" and filename~="" and filename or false + if type(filename)~="string" or filename=="" then + filename=false + elseif file.pathpart(filename)=="" then + t.report("export file %a will not be saved on the current path (safeguard)") + filename=false + end for i=1,#method do local m=method[i] local result=exporters[m](t,m) @@ -15525,8 +15571,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 : 642686 --- stripped bytes : 233038 +-- original bytes : 644541 +-- stripped bytes : 233681 -- end library merge diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index f71ffc3d5..2ad5a63e6 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.03.22 20:06} +\newcontextversion{2013.03.22 22:21} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 008dc6fb3..818845c7d 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.03.22 20:06} +\newcontextversion{2013.03.22 22:21} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex bdec51852..cfa0f7218 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex a574743b8..3e28b44b8 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 802d727a4..c41e6374e 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2013.03.22 20:06} +\edef\contextversion{2013.03.22 22:21} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index c16530695..5386f68b2 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.03.22 20:06} +\edef\contextversion{2013.03.22 22:21} %D For those who want to use this: diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 31f682298..28d37dd34 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 557386802..109161ab4 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/trac-xml.lua b/tex/context/base/trac-xml.lua index 39cfcfb22..df213ba2d 100644 --- a/tex/context/base/trac-xml.lua +++ b/tex/context/base/trac-xml.lua @@ -6,6 +6,19 @@ if not modules then modules = { } end modules ['trac-xml'] = { license = "see context related readme files" } +-- Application helpinfo can be defined in several ways: +-- +-- helpinfo = "big blob of help" +-- +-- helpinfo = { basic = "blob of basic help", extra = "blob of extra help" } +-- +-- helpinfo = "<?xml version=1.0?><application>...</application/>" +-- +-- helpinfo = "somefile.xml" +-- +-- In the case of an xml file, the file should be either present on the same path +-- as the script, or we should be be able to locate it using the resolver. + local formatters = string.formatters local reporters = logs.reporters local xmlserialize = xml.serialize @@ -77,9 +90,42 @@ end local reporthelp = reporters.help local exporthelp = reporters.export -function reporters.help(t,...) +local function xmlfound(t) local helpinfo = t.helpinfo - if type(helpinfo) == "string" and string.find(helpinfo,"^<%?xml") then + if type(helpinfo) == "table" then + return false + end + if type(helpinfo) ~= "string" then + helpinfo = "Warning: no helpinfo found." + t.helpinfo = helpinfo + return false + end + if string.find(helpinfo,".xml$") then + local ownscript = environment.ownscript + local helpdata = false + if ownscript then + local helpfile = file.join(file.pathpart(ownscript),helpinfo) + helpdata = io.loaddata(helpfile) + if helpdata == "" then + helpdata = false + end + end + if not helpdata then + local helpfile = resolvers.findfile(helpinfo,"tex") + helpdata = helpfile and io.loaddata(helpfile) + end + if helpdata and helpdata ~= "" then + helpinfo = helpdata + else + helpinfo = formatters["Warning: help file %a is not found."](helpinfo) + end + end + t.helpinfo = helpinfo + return string.find(t.helpinfo,"^<%?xml") and true or false +end + +function reporters.help(t,...) + if xmlfound(t) then showhelp(t,...) else reporthelp(t,...) @@ -89,16 +135,30 @@ end local exporters = logs.exporters function reporters.export(t,method,filename) + if not xmlfound(t) then + return exporthelp(t) + end dofile(resolvers.findfile("trac-exp.lua","tex")) if not exporters or not method then return exporthelp(t) end + if not method or method == "" then + method = environment.argument["exporthelp"] + end + if not filename or filename == "" then + filename = environment.files[1] + end if method == "all" then method = table.keys(exporters) else method = { method } end - filename = type(filename) == "string" and filename ~= "" and filename or false + if type(filename) ~= "string" or filename == "" then + filename = false + elseif file.pathpart(filename) == "" then + t.report("export file %a will not be saved on the current path (safeguard)") + filename = false + end for i=1,#method do local m = method[i] local result = exporters[m](t,m) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 7a27cb694..f5ef2222d 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 03/22/13 20:06:00 +-- merge date : 03/22/13 22:21:59 do -- begin closure to overcome local limits and interference |