Module:Fo/data
De Commission Historique
< Module:Fo
Révision datée du 24 février 2022 à 16:10 par L.strappazon (discussion | contributions)
La documentation pour ce module peut être créée à Module:Fo/data/doc
local fields = '_pageName,ZoteroKey,TitleItem,Author,Editor,Date,Date__precision,Place,ItemType,Publisher,PublicationTitle,Volume,PublicationYear,Pages,Url,FilingDate,AccessDate,Type,Number,IssuingAuthority,Archive,Medium,Interviewer,AccessDate'
local fieldds = mw.text.split(fields,',')
local args = {groupBy = 'ZoteroKey', orderBy = 'ZoteroKey', limit = 4000}
local bib = mw.ext.cargo.query('Zotero', fields, args)
local bbib={}
for _,r in ipairs(bib) do
bbib[r['ZoteroKey']] = {}
for _,f in ipairs(fieldds) do
bbib[r['ZoteroKey']][f] = r[f] or ''
end
if r['Date__precision'] == '3' then
bbib[r['ZoteroKey']]['Date'] = mw.text.truncate(r['Date'],4,'')
end
if not r['ZoteroKey']['PublicationYear'] then
bbib[r['ZoteroKey']]['PublicationYear'] = bbib[r['ZoteroKey']]['Date']
end
end
return bbib