From 6bb39561d4571fb85aac56a686b837a9f3c910cd Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 21 Mar 2013 15:00:17 +0200 Subject: beta 2013.03.21 13:42 --- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-base.lmx | 73 +++++------ tex/context/base/context-version.pdf | Bin 4134 -> 4137 bytes tex/context/base/context-version.png | Bin 40182 -> 40520 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/luat-run.lua | 5 +- tex/context/base/status-files.pdf | Bin 24788 -> 24796 bytes tex/context/base/status-lua.pdf | Bin 211561 -> 211440 bytes tex/context/base/trac-exp.lua | 138 +++++++++++++-------- tex/context/base/trac-lmx.lua | 19 ++- tex/context/base/trac-log.lua | 5 + tex/context/base/trac-tim.lua | 2 +- tex/context/base/trac-xml.lua | 37 ++++-- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 16 files changed, 183 insertions(+), 106 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 4eaa92ddc..2a48ec5db 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.20 21:07} +\newcontextversion{2013.03.21 13:42} %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 4a89abc96..30ea51f5d 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.20 21:07} +\newcontextversion{2013.03.21 13:42} %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-base.lmx b/tex/context/base/context-base.lmx index 2b093c3e1..482d43e88 100644 --- a/tex/context/base/context-base.lmx +++ b/tex/context/base/context-base.lmx @@ -2,6 +2,8 @@ + + - -
+ + -
+
-
- -
+
-
-
+
+
-
- -
+
-
-
+
+
-
- -
+
-
- + +
- +
- +
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 45ca003ab..398afdd50 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index 71514b2c2..804c18555 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index b65181bbf..7da4eb13e 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.20 21:07} +\edef\contextversion{2013.03.21 13:42} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 980e650a6..33b230506 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.20 21:07} +\edef\contextversion{2013.03.21 13:42} %D For those who want to use this: diff --git a/tex/context/base/luat-run.lua b/tex/context/base/luat-run.lua index 34d45d096..eaede1030 100644 --- a/tex/context/base/luat-run.lua +++ b/tex/context/base/luat-run.lua @@ -139,8 +139,9 @@ directives.register("system.synctex", function(v) else report_system("synctex functionality is disabled!") end + synctex = tonumber(synctex) or (toboolean(synctex,true) and 1) or (synctex == "zipped" and 1) or (synctex == "unzipped" and -1) or false -- currently this is bugged: - tex.synctex = synctex and 1 or 0 + tex.synctex = synctex -- so for the moment we need: context.normalsynctex() if synctex then @@ -151,7 +152,7 @@ directives.register("system.synctex", function(v) end) statistics.register("synctex tracing",function() - if synctex or tex.synctex > 0 then + if synctex or tex.synctex ~= 0 then return "synctex has been enabled (extra log file generated)" end end) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index d1d5c4328..adb9c707d 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index b97167234..b82cb9420 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/trac-exp.lua b/tex/context/base/trac-exp.lua index d1ce3c458..cd30500a2 100644 --- a/tex/context/base/trac-exp.lua +++ b/tex/context/base/trac-exp.lua @@ -35,9 +35,9 @@ local function categorytitle(category) return xmltext(xmlfirst(category,"/title")) or "" end -local exporters = { } +local exporters = logs.exporters -exporters.man = function(specification,...) +function exporters.man(specification,...) local root = xml.convert(specification.helpinfo or "") if not root then return @@ -54,9 +54,23 @@ exporters.man = function(specification,...) -- local result = { } -- - result[#result+1] = formatters['.TH %s\n.SH "NAME"\n%s.SH "SYNOPSIS"\n\\fB%s\\fP [ \\fIOPTIONS\\fP ... ]\n.SH "DESCRIPTION"\n%s\n']( - banner,name,name,detail - ) + -- .TH "context" "1" "some date" "version" "ConTeXt" -- we use a fake date as I don't want to polute the git repos + -- + local runner = string.match(name,"^mtx%-(.*)") + if runner then + runner = formatters["mtxrun --script %s"](runner) + else + runner = name + end + -- + result[#result+1] = formatters[ [[.TH "%s" "1" "%s" "version %s" "%s" ]] ](name,os.date("01-01-%Y"),version,detail) + result[#result+1] = formatters[ [[.SH "NAME" %s]] ] () + result[#result+1] = ".PP" + result[#result+1] = formatters[ [[.SH "SYNOPSIS" ]] ](name) + result[#result+1] = ".PP" + result[#result+1] = formatters[ [[.SH \fB%s\fP [ \fIOPTIONS\fP ... ] [ \fIFILENAMES\fP ] ]] ](runner) + result[#result+1] = formatters[ [[.SH "DESCRIPTION"\n%s\n ]] ](detail) + -- for category in xmlcollected(root,"/application/flags/category") do if nofcategories > 1 then result[#result+1] = formatters['.SH "OPTIONS: %s"'](string.upper(category.at.name or "all")) @@ -89,7 +103,7 @@ local craptemplate = [[ ]] -exporters.xml = function(specification,...) +function exporters.xml(specification,...) local helpinfo = specification.helpinfo if type(helpinfo) == "string" then if string.find(helpinfo,"^<%?xml") then @@ -103,54 +117,80 @@ exporters.xml = function(specification,...) return formatters[craptemplate](specification.banner or "?",helpinfo) end +-- the following template is optimized a bit for space + +-- local bodytemplate = [[ +--

Command line options

+-- +-- +-- +-- +-- +-- +-- 1 then +-- ?> +-- +-- +-- +-- +-- +-- +--
flagvaluedescription
--
+--
+--





+-- ]] + local bodytemplate = [[

Command line options

- - - - - - 1 then - ?> - - - - - - + + 1 then ?> + + + + + +
flagvaluedescription
--
flagvaluedescription
--
-



+
+ +

+ + +

+

]] -exporters.html = function(specification,...) +function exporters.html(specification,...) local root = xml.convert(specification.helpinfo or "") if not root then return @@ -186,5 +226,3 @@ exporters.html = function(specification,...) -- return html end - -logs.exporters = exporters diff --git a/tex/context/base/trac-lmx.lua b/tex/context/base/trac-lmx.lua index b7e811860..18c7f6020 100644 --- a/tex/context/base/trac-lmx.lua +++ b/tex/context/base/trac-lmx.lua @@ -13,7 +13,7 @@ local format, sub, gsub = string.format, string.sub, string.gsub local concat = table.concat local collapsespaces = string.collapsespaces local P, Cc, Cs, C, Carg, lpegmatch = lpeg.P, lpeg.Cc, lpeg.Cs, lpeg.C, lpeg.Carg, lpeg.match -local joinpath, replacesuffix, pathpart = file.join, file.replacesuffix, file.pathpart +local joinpath, replacesuffix, pathpart, filesuffix = file.join, file.replacesuffix, file.pathpart, file.suffix local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex @@ -221,7 +221,7 @@ local function do_type_variable(str) end end -local function do_include(filename) +local function do_include(filename,option) local data = loadedsubfile(filename) if (not data or data == "") and givenpath then data = loadedsubfile(joinpath(givenpath,filename)) @@ -241,6 +241,9 @@ local function do_include(filename) -- report_lmx("included file: %s",filename) data = do_nested_include(data) end + if filesuffix(filename,"css") and option == "strip" then -- new + data = lmx.stripcss(data) + end return data end @@ -425,6 +428,8 @@ end local whitespace = lpeg.patterns.whitespace local optionalspaces = whitespace^0 +local dquote = P('"') + local begincomment = P("") @@ -435,10 +440,12 @@ local beginembedcss = P("/*") local endembedcss = P("*/") local gobbledendxml = (optionalspaces * endembedxml) / "" -local argumentxml = (1-gobbledendxml)^0 +----- argumentxml = (1-gobbledendxml)^0 +local argumentxml = (whitespace^1 + dquote * C((1-dquote)^1) * dquote + C((1-gobbledendxml-whitespace)^1))^0 local gobbledendcss = (optionalspaces * endembedcss) / "" -local argumentcss = (1-gobbledendcss)^0 +----- argumentcss = (1-gobbledendcss)^0 +local argumentcss = (whitespace^1 + dquote * C((1-dquote)^1) * dquote + C((1-gobbledendcss-whitespace)^1))^0 local commentxml = (begincomment * (1-endcomment)^0 * endcomment) / "" @@ -697,7 +704,7 @@ end -- Test 2: -- local str = [[ --- +-- -- -- some content a -- some content b @@ -715,7 +722,7 @@ end -- -- -- ]] --- + -- local defaults = { trace = true, a = 3, b = 3 } -- local result = lmx.new(str,defaults) -- inspect(result.data) diff --git a/tex/context/base/trac-log.lua b/tex/context/base/trac-log.lua index 4f1d9ac01..211734ef3 100644 --- a/tex/context/base/trac-log.lua +++ b/tex/context/base/trac-log.lua @@ -703,7 +703,12 @@ local reporters = { export = reportexport, } +local exporters = { + -- empty +} + logs.reporters = reporters +logs.exporters = exporters function logs.application(t) t.name = t.name or "unknown" diff --git a/tex/context/base/trac-tim.lua b/tex/context/base/trac-tim.lua index 25ae6b1bc..527efa088 100644 --- a/tex/context/base/trac-tim.lua +++ b/tex/context/base/trac-tim.lua @@ -16,7 +16,7 @@ moduledata.progress = progress local report_timing = logs.reporter("timing") -progress.parameters = nodes.snapshots.getparameters +progress.parameters = nodes and nodes.snapshots.getparameters progress.defaultfilename = ((tex and tex.jobname) or "whatever") .. "-luatex-progress" -- storage diff --git a/tex/context/base/trac-xml.lua b/tex/context/base/trac-xml.lua index e44f3c399..39cfcfb22 100644 --- a/tex/context/base/trac-xml.lua +++ b/tex/context/base/trac-xml.lua @@ -41,9 +41,9 @@ local function showhelp(specification,...) -- local short = xmlserialize(short,xs) 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() @@ -66,6 +66,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 @@ -80,13 +86,30 @@ function reporters.help(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 diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index cf2316ac2..5e187a841 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/20/13 21:07:28 +-- merge date : 03/21/13 13:42:24 do -- begin closure to overcome local limits and interference -- cgit v1.2.3