Modulo:Citazione: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Ripristino alla versione 92770056 datata 2017-11-25 12:49:00 di Sakretsu tramite popup |
m riapplico modifica di Moroboshi |
||
Riga 30:
-- Ritorna il nostro {{Collegamento interrotto}}
local function interrupted_url(
return
end
Riga 133:
-- -- arguments: una lista di argomenti opzionali per la formattazione del messaggio
-- -- raw: ritorna una coppia: {messaggio di errore, visibilità} invece del messaggio
--
-- -- prefix: stringa da aggiungere in testa al messaggio
-- -- suffix: stringa da aggiungere in coda al messaggio
Riga 292:
- self.first_priority: priorità del separatore di apertura
- self.sep_key: codice del carattere separatore di default da usare
se unita a un altro frammento
===============================================================================]]
local Fragment = {}
Fragment.
local Fragment_mt = { __index = Fragment }
Fragment.new = function(texts, sep_key)
if type(texts) == "string" then texts = { texts } end
▲ if not fpriority[sep_key] then sep_key = "" end
local tx = { }
tx.last_priority = 0
Riga 312 ⟶ 310:
if el ~= "" then
tx[#tx+1] = el
tx[#tx+1] =
end
end
if #tx > 1 then
tx.last_priority =
else
tx[1] = ""
Riga 327 ⟶ 325:
function Fragment:start(sep_key)
if #self == 0 then return self end
local separator = Fragment.
self[1] = separator.sep
self.first_priority = separator.order
Riga 336 ⟶ 334:
function Fragment:last(sep_key)
if #self == 0 then return self end
local separator = Fragment.
self[#self] = separator.sep
self.last_priority = separator.order
Riga 884 ⟶ 882:
Genera la citazione
===============================================================================]]
local function citation0( config, args
local A = argument_wrapper( args );
local i
Riga 892 ⟶ 890:
local PPPrefix = (is_set( A['NoPP'] ) and "") or Style.ppprefix
local PPrefix = (is_set( A['NoPP'] ) and "") or Style.pprefix
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
Riga 937 ⟶ 934:
local isPubblicazione = (config.CitationClass == 'pubblicazione') or
------------------------------------------------------------------------------
Riga 988 ⟶ 985:
elseif check_error > 60 then
TimeError[#TimeError+1] = set_error('minutes_wrong')
end
ComposeTime[#ComposeTime+1] = Minutes .. ' min'
end
Riga 1 399 ⟶ 1 396:
Language_code = Language
else
local
for lingua in mw.ustring.gmatch(Language, "%S+") do
end
if #
local lg_error
if lg_error and #lg_error > 0 then
local error_string = mw.text.listToText(lg_error, ", ", " e " )
Riga 1 519 ⟶ 1 515:
local fragment_Title
local PostTitle = A['PostTitle']
if is_set(Title) then
if DeadURL and not is_set( ArchiveURL ) then
-- Report a dead URL without an archived URL
Title = Title .. interrupted_url(
end
fragment_Title = Fragment.new({Title, Format, TitleType, PostTitle}, ' '):last(",")▼
▲ fragment_Title = Fragment.new({Title, Format, TitleType}, ' '):last(",")
else
fragment_Title = Fragment.new({ })
if is_set(Chapter) then
Chapter = DeadURL and not is_set( ArchiveURL )
and tostring(Fragment.new({Chapter, interrupted_url(
or tostring(Fragment.new({Chapter,
end
end
Riga 1 569 ⟶ 1 564:
end
fragment_citation:appends( { Conference, Periodical, Translator, Illustrator, Others, Series,
local fragment_ID_list = Fragment.new(ID_list, sepc):append(ID):start(",")
local fragment_URL = Fragment.new(URL):start(",")
Riga 1 595 ⟶ 1 590:
end
--
--
--
--
--
if is_set(Ref) then
Riga 1 713 ⟶ 1 708:
end
end
return citation0( config, args
end
-- Funzione per generare direttamente una citazione web da un altro modulo
function z.citaweb(args)
return citation0( {CitationClass = 'web'}, args )
end
Riga 1 726:
for _,key in ipairs(keys) do
rows[#rows+1] = '|-\n|' .. key .. '|| [[' .. cfg.external_link_type[key].link ..
end
rows[#rows+1] = "|}"
|