Módulo:ABNT: mudanças entre as edições

Ir para navegação Ir para pesquisar
imported>Jaideraf
Sem resumo de edição
imported>Jaideraf
(teste)
-- Alvo definido
-- Definir se há criador(es) para o início da referência
local creator = 'Hitzler, Pascal' -- frame:callParserFunction{ name = '#show', args = { target, '?Has creator#', link = 'none', valuesep = '; '} }
-- Definir se há editores(es) para o início da referência
local contributor = 'Krötzsch, Markus; Rudolph, Sebastian' -- frame:callParserFunction{ name = '#show', args = { target, '?Has contributor#', link = 'none', valuesep = '; '} }
-- Definir o título e o subtítulo
local title = frame:callParserFunction{ name = '#show', args = { target, '?Display title of#', link = 'none' } }
local agents={}
local newagents={}
local newnewagents={}
if #creator >= 1 or #contributor >= 1 then
 
table.insert(agents, creator)
for strv in string.gmatch(contributor, "([^;]+)") do
table.insert(agents, strv)
end
for k, v in pairs(agents) do
if string.match( v, '^(.*,.*),') then
v = string.match( v, '^(.*,.*),') -- Assis, Machado de, 1839-1908
end
end
for k, v in pairs(agentsnewagents) do
if string.match( v, '^(.*)%s%(') then
v = string.match( v, '^(.*)%s%(') -- Tolkien, J. R. R. (John Ronald Reuel), 1892-1973
table.insert(newagentsnewnewagents, v)
end
end
 
agentstr = table.concat(newagentsnewnewagents, "; ")
agentstr = frame:callParserFunction{ name = '#regex', args = { agentstr, '/(^.*?,)|(;.*?,)/', '<span style="text-transform: uppercase;">$1$2</span>' } }
reference = agentstr .. '. <b>' .. title .. '</b>. '