From ba9a57343987f1c2c72396e7c38f1fa30352c24c Mon Sep 17 00:00:00 2001 From: Mojca Miklavec Date: Mon, 5 May 2014 20:29:55 +0000 Subject: ConTeXt 2014.04.28 23:24 git-svn-id: svn://tug.org/texlive/trunk@33856 c570f23f-e606-0410-a88d-b1316a301751 --- .../scripts/context/lua/mtx-server-ctx-help.lua | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/scripts/context/lua/mtx-server-ctx-help.lua') diff --git a/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-help.lua b/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-help.lua index b8dc0dfb278..d948c6e46d1 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-help.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-help.lua @@ -542,11 +542,11 @@ function document.setups.collect(name,int,lastmode) local left, right = d[k].at.name or "?", { } if tag == "inherit" then local name = d[k].at.name or "?" - local goto = format(document.setups.formats.href_as_command[lastmode],name,lastmode,name) + local url = format(document.setups.formats.href_as_command[lastmode],name,lastmode,name) if #parameters > 0 and not find(parameters[#parameters],"
") then parameters[#parameters+1] = format(formats.parameter,"
","","") end - parameters[#parameters+1] = format(formats.parameter,what,format(formats.special,translate("inherits",int)),goto) + parameters[#parameters+1] = format(formats.parameter,what,format(formats.special,translate("inherits",int)),url) else for r, d, k in xml.elements(d[k],"(cd:constant|cd:resolve)") do local tag = d[k].tg @@ -664,9 +664,23 @@ local function doit(configuration,filename,hashed) if document.setups.showsources and lastsource and lastsource ~= "" then -- todo: mkii, mkiv, tex (can be different) - local data = io.loaddata(resolvers.findfile(lastsource)) - variables.maintitle = lastsource - variables.maintext = format(formats.listing,data) + local name = lastsource + local full = resolvers.findfile(name) + if full == "" and file.suffix(lastsource) == "tex" then + name = file.replacesuffix(lastsource,"mkiv") + full = resolvers.findfile(name) + if full == "" then + name = file.replacesuffix(lastsource,"mkvi") + full = resolvers.findfile(name) + end + end + if full == "" then + variables.maintitle = lastsource + variables.maintext = format(formats.listing,"no source found") + else + variables.maintitle = name + variables.maintext = format(formats.listing,io.loaddata(full)) + end lastsource = "" elseif lastcommand and lastcommand ~= "" then local data = document.setups.collect(lastcommand,lastinterface,lastmode) -- cgit v1.2.3