Modulo:Wikidata/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
lettura fonti |
Nessun oggetto della modifica |
||
(5 versioni intermedie di 2 utenti non mostrate) | |||
Riga 16:
-- =============================================================================
require('
local getArgs = require('Module:Arguments').getArgs
local mConvert = require('Module:Conversione')
local mLanguages = require('Module:
local mCitation = require('
-- Categoria per le pagine con errori
Riga 369:
local function formatReferences(references, args)
local formattedReferences = {}
local
web = { parameter = 'url', property = 'P854' }▼
titolo = 'P1476', data = 'P577', url = 'P854', dataaccesso = 'P813',
editore = 'P123', urlarchivio = 'P1065', dataarchivio = 'P2960'
}
▲ local refArgs = {}
for parameter, property in pairs(snaks) do▼
refArgs.titolo = refArgs.titolo or refArgs.url
▲ if reference.snaks[property] then
if snaks.P407 then
local langs = {}
▲ end
▲ if reference.snaks.P407 then
table.insert(langs, mw.wikibase.getLabel(lang) or lang)
▲ refArgs.lingua = formatSnak(reference.snaks.P407, { formatting = 'raw' })
▲ end
local formattedReference = mw.getCurrentFrame()▼
:extensionTag('ref', mCitation.cita_da_modulo(citeClass, refArgs))▼
table.insert(formattedReferences, formattedReference)▼
end
refArgs.lingua = table.concat(langs, ',')
end
if refArgs.urlarchivio then refArgs.urlmorto = 'sì' end
name = 'ref',
args = { name = references[1].hash }
}
end
return table.concat(formattedReferences)
Riga 902 ⟶ 907:
function p.checkProperty(frame)
return select(2, xpcall(function()
return p._N(getArgs(frame, { parentOnly = true })) > 0 and
end, errhandler))
end
|