Diferencia entre revisiones de «Módulo:Formato texto»

De Hispanopedia
Sin resumen de edición
Sin resumen de edición
Línea 26: Línea 26:


function z.enVariasLineas(lista)
function z.enVariasLineas(lista)
return mw.text.listToText(lista,'<br/>')
return mw.text.listToText(require('Módulo:Tablas').copiarElementosConValor(lista),'<br/>')
end
end


function z.separadosPorComa(lista)
function z.separadosPorComa(lista)
return mw.text.listToText(lista,', ',', ')
return mw.text.listToText(require('Módulo:Tablas').copiarElementosConValor(lista),', ',', ')
end
end


return z
return z

Revisión del 21:27 22 sep 2015

La documentación para este módulo puede ser creada en Módulo:Formato texto/doc

local z = {}

function z.entreComillas(texto, ref)
	if ref and texto then
		return '«' .. texto .. '»' .. ref
	elseif texto then
	    return '«' .. texto .. '»'
	end
end

function z.entreParentesis(texto, calificativo)
	if texto and calificativo then
	    return texto .. ' (' .. calificativo .. ')'
	else
		return texto
	end
end

function z.enCursivas(texto, ref)
	if ref and texto then
		return '<i>' .. texto .. '</i>' .. ref
	elseif texto then
	    return '<i>' .. texto .. '</i>'
	end
end

function z.enVariasLineas(lista)
	return mw.text.listToText(require('Módulo:Tablas').copiarElementosConValor(lista),'<br/>')
end

function z.separadosPorComa(lista)
	return mw.text.listToText(require('Módulo:Tablas').copiarElementosConValor(lista),', ',', ')
end

return z