Ir al contenido
Menú principal
Menú principal
mover a la barra lateral
ocultar
Navegación
Página principal
Cambios recientes
Página aleatoria
Ayuda sobre MediaWiki
Wiki TVenserio
Buscar
Buscar
Crear una cuenta
Acceder
Herramientas personales
Modo oscuro
Crear una cuenta
Acceder
Páginas para editores desconectados
más información
Contribuciones
Discusión
Edición de «
Módulo:Link de arquivo
»
Módulo
Discusión
English
Leer
Editar código
Ver historial
Herramientas
Herramientas
mover a la barra lateral
ocultar
Acciones
Leer
Editar código
Ver historial
General
Lo que enlaza aquí
Cambios relacionados
Páginas especiales
Información de la página
Advertencia:
no has iniciado sesión. Tu dirección IP se hará pública si haces cualquier edición. Si
inicias sesión
o
creas una cuenta
, tus ediciones se atribuirán a tu nombre de usuario, además de otros beneficios.
Comprobación antispam. ¡
No
rellenes esto!
-- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "erro de tipo em parâmetro '%s' de '_main' (string esperado, recebido(a) %s)", key, type(val) ), level) end end local ret = {} -- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end -- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end -- Filename args.file = args.file or args.ficheiro or args.arquivo checkArg('file', args.file, 3) ret[#ret + 1] = 'Ficheiro:' .. args.file -- Format args.format = args.format or args.formato args.formatfile = args.formatfile or args.ficheiroformato or args.arquivoformato if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end -- Border if yesno(args.border or args.borda) then ret[#ret + 1] = 'border' end addPositional('location') addPositional('localização') addPositional('alignment') addPositional('alinhamento') addPositional('size') addPositional('tamanho') addNamed('upright') addNamed('vertical') addNamed('link') addNamed('ligação') addNamed('alt') addNamed('page') addNamed('página') addNamed('class') addNamed('classe') addNamed('lang') addNamed('líng') addNamed('ling') addNamed('língua') addNamed('idioma') addNamed('start') addNamed('iniciar') addNamed('começar') addNamed('início') addNamed('começo') addNamed('end') addNamed('fim') addNamed('finalizar') addNamed('terminar') addNamed('thumbtime') addNamed('tempominiatura') addPositional('caption') addPositional('legenda') return string.format('[[%s]]', table.concat(ret, '|')) end function p.main(frame) local origArgs = require('Módulo:Arguments').getArgs(frame, { wrappers = 'Predefinição:Link de arquivo' }) if not origArgs.file and not origArgs.ficheiro and not origArgs.arquivo then error("Parâmetro 'file', 'ficheiro' ou 'arquivo' em falta em [[Predefinição:Link de arquivo]]", 0) end -- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like [[File:Example.png|link=]]. if v == '_BLANK' or v == '_EMBRANCO' then v = '' end args[k] = v end return p._main(args) end return p
Resumen:
Ten en cuenta que todas las contribuciones a Wiki TVenserio pueden ser editadas, modificadas o eliminadas por otros colaboradores. Si no deseas que las modifiquen sin limitaciones, no las publiques aquí.
Al mismo tiempo, asumimos que eres el autor de lo que escribiste, o lo copiaste de una fuente en el dominio público o con licencia libre (véase
Wiki TVenserio:Derechos de autor
para más detalles).
¡No uses textos con copyright sin permiso!
Cancelar
Ayuda de edición
(se abre en una ventana nueva)
Plantilla usada en esta página:
Módulo:Link de arquivo/doc
(
editar
)
Activar o desactivar el límite de anchura del contenido