<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://nationalatlas.ign.es/index.php?action=history&amp;feed=atom&amp;title=Module%3ALua_banner</id>
	<title>Module:Lua banner - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://nationalatlas.ign.es/index.php?action=history&amp;feed=atom&amp;title=Module%3ALua_banner"/>
	<link rel="alternate" type="text/html" href="http://nationalatlas.ign.es/index.php?title=Module:Lua_banner&amp;action=history"/>
	<updated>2026-04-04T10:15:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://nationalatlas.ign.es/index.php?title=Module:Lua_banner&amp;diff=3118&amp;oldid=prev</id>
		<title>Ane: 1 revisión importada</title>
		<link rel="alternate" type="text/html" href="http://nationalatlas.ign.es/index.php?title=Module:Lua_banner&amp;diff=3118&amp;oldid=prev"/>
		<updated>2018-11-16T07:59:03Z</updated>

		<summary type="html">&lt;p&gt;1 revisión importada&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements the {{lua}} template.&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local mList = require('Module:List')&lt;br /&gt;
local mTableTools = require('Module:TableTools')&lt;br /&gt;
local mMessageBox = require('Module:Message box')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = frame:getParent().args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		v = v:match('^%s*(.-)%s*$')&lt;br /&gt;
		if v ~= '' then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local modules = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local box = p.renderBox(modules)&lt;br /&gt;
	local trackingCategories = p.renderTrackingCategories(args, modules)&lt;br /&gt;
	return box .. trackingCategories&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderBox(modules)&lt;br /&gt;
	local boxArgs = {}&lt;br /&gt;
	if #modules &amp;lt; 1 then&lt;br /&gt;
		boxArgs.text = '&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: no modules specified&amp;lt;/strong&amp;gt;'&lt;br /&gt;
	else&lt;br /&gt;
		local moduleLinks = {}&lt;br /&gt;
		for i, module in ipairs(modules) do&lt;br /&gt;
			moduleLinks[i] = string.format('[[:%s]]', module)&lt;br /&gt;
		end&lt;br /&gt;
		local moduleList = mList.makeList('bulleted', moduleLinks)&lt;br /&gt;
		boxArgs.text = 'This ' .. &lt;br /&gt;
			(mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..&lt;br /&gt;
			' uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList&lt;br /&gt;
	end&lt;br /&gt;
	boxArgs.type = 'notice'&lt;br /&gt;
	boxArgs.small = true&lt;br /&gt;
	boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=|link=]]'&lt;br /&gt;
	return mMessageBox.main('mbox', boxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderTrackingCategories(args, modules, titleObj)&lt;br /&gt;
	if yesno(args.nocat) then&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local cats = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Error category&lt;br /&gt;
	if #modules &amp;lt; 1 then&lt;br /&gt;
		cats[#cats + 1] = 'Lua templates with errors'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Lua templates category&lt;br /&gt;
	titleObj = titleObj or mw.title.getCurrentTitle()&lt;br /&gt;
	local subpageBlacklist = {&lt;br /&gt;
		doc = true,&lt;br /&gt;
		sandbox = true,&lt;br /&gt;
		sandbox2 = true,&lt;br /&gt;
		testcases = true&lt;br /&gt;
	}&lt;br /&gt;
	if titleObj.namespace == 10 &lt;br /&gt;
		and not subpageBlacklist[titleObj.subpageText]&lt;br /&gt;
	then&lt;br /&gt;
		local category = args.category&lt;br /&gt;
		if not category then&lt;br /&gt;
			local categories = {&lt;br /&gt;
				['Module:String'] = 'Lua String-based templates',&lt;br /&gt;
				['Module:Math'] = 'Templates based on the Math Lua module',&lt;br /&gt;
				['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',&lt;br /&gt;
				['Module:Citation'] = 'Lua-based citation templates'&lt;br /&gt;
			}&lt;br /&gt;
			categories['Module:Citation/CS1'] = categories['Module:Citation']&lt;br /&gt;
			category = modules[1] and categories[modules[1]]&lt;br /&gt;
			category = category or 'Lua-based templates'&lt;br /&gt;
		end&lt;br /&gt;
		cats[#cats + 1] = category&lt;br /&gt;
		local protLevels = {&lt;br /&gt;
			autoconfirmed = 1,&lt;br /&gt;
			extendedconfirmed = 2,&lt;br /&gt;
			templateeditor = 3,&lt;br /&gt;
			sysop = 4&lt;br /&gt;
		}&lt;br /&gt;
		local currentProt = titleObj.protectionLevels[&amp;quot;edit&amp;quot;][1]&lt;br /&gt;
		if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end&lt;br /&gt;
		for i, module in ipairs(modules) do&lt;br /&gt;
			local moduleProt = mw.title.new(module).protectionLevels[&amp;quot;edit&amp;quot;][1]&lt;br /&gt;
			if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end&lt;br /&gt;
			if moduleProt &amp;lt; currentProt then&lt;br /&gt;
				cats[#cats + 1] = &amp;quot;Templates using under-protected Lua modules&amp;quot;&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, cat in ipairs(cats) do&lt;br /&gt;
		cats[i] = string.format('[[Category:%s]]', cat)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(cats)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ane</name></author>
		
	</entry>
</feed>