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

De Wikincat
Ir para navegação Ir para pesquisar
imported>Jaideraf
(Criou página com 'local p = {} function p.BibRules( frame ) -- Define o alvo -- local target = frame:getParent().args[1] -- if target == '' or target == nil then -- target...')
(Sem diferença)

Edição das 16h36min de 25 de julho de 2021

A documentação para este módulo pode ser criada em Módulo:BibRules/doc

local p = {}

function p.BibRules( frame )
    -- Define o alvo
    -- local target = frame:getParent().args[1]
    -- if target == '' or target == nil then
    --     target = mw.uri.decode( frame:callParserFunction( '#urlget', 'fullpagename' ) )
    -- end
    -- if target == '' or target == nil then
    --     target = mw.title.getCurrentTitle().prefixedText
    -- end
    local test
    local info = ''
    if frame:expandTemplate{ title = 'Exist', args = { '245' } } ~= '' then

      test = frame:expandTemplate{ title = 'Field data string', args = { '000', '5', '1', property = 'Leader' } } or false

      if test == 'n' then
        info = "* Segundo o Líder, este é um registro '''novo''' (não um alterado ou revisado, expandido, excluído, etc.)."
      elseif test == 'c' then
        info = "* Segundo o Líder, este é um registro '''alterado ou revisado''' (não um novo, expandido, excluído, etc.)."
      elseif test == 'a' or test == 'd' or test == 'p' then
        info = "* Segundo o Líder, este é um registro '''expandido''' ou '''excluído''' (não novo)."
      end
    end
    return info

end

return p