summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/publ-dat.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/publ-dat.lua')
-rw-r--r--tex/context/base/mkiv/publ-dat.lua31
1 files changed, 24 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua
index 382f70471..64aaaf460 100644
--- a/tex/context/base/mkiv/publ-dat.lua
+++ b/tex/context/base/mkiv/publ-dat.lua
@@ -379,6 +379,7 @@ function publications.new(name)
suffixes = { },
xmldata = xmlconvert(xmlplaceholder),
details = { },
+ missing = { },
ordered = { },
nofbytes = 0,
entries = nil, -- empty == all
@@ -732,6 +733,7 @@ do
end
end
end
+-- inspect(luadata)
statistics.stoptiming(publications)
end
@@ -1172,18 +1174,31 @@ do
end
end
- function savers.lua(dataset,filename,tobesaved)
- local list = { }
- local n = 0
- for tag, data in next, tobesaved do
+ function savers.lua(dataset,filename,tobesaved,options)
+ local list = { }
+ local n = 0
+
+ local function totable(data,category)
local t = { }
for key, value in next, data do
if not privates[key] then
- d[key] = value
+ t[key] = value
end
end
- list[tag] = t
+ t.category = category
n = n + 1
+ return t
+ end
+
+ if options.category then
+ setmetatableindex(list,"table")
+ for tag, data in next, tobesaved do
+ list[data.category or "unknown"][tag] = totable(data)
+ end
+ else
+ for tag, data in next, tobesaved do
+ list[tag] = totable(data,data.category)
+ end
end
report("%s entries from dataset %a saved in %a",n,dataset,filename)
table.save(filename,list)
@@ -1200,6 +1215,7 @@ do
local filename = specification.filename
local filetype = specification.filetype
local criterium = specification.criterium
+ local options = settings_to_hash(specification.options or "")
statistics.starttiming(publications)
if not filename or filename == "" then
report("no filename for saving given")
@@ -1229,7 +1245,7 @@ do
end
end
end
- saver(dataset,filename,tobesaved)
+ saver(dataset,filename,tobesaved,options)
else
report("unknown format %a for saving %a",filetype,dataset)
end
@@ -1250,6 +1266,7 @@ do
{ "filename" },
{ "filetype" },
{ "criterium" },
+ { "options" },
}
}
}