Модуль:Universal infocard/configdoc

Материал из Народные Сказки
Версия от 15:20, 24 июня 2023; ru>Andras (Новая страница: «local p = {} -- p stands for package function p.showSkippedProperties (frame) local config = require('Module:Universal infocard/config') local ids = {} for key in pairs(config.skipPropertyIds) do table.insert(ids, tonumber(key:sub(2))) end table.sort(ids) local results = {} for _, id in ipairs(ids) do table.insert(results, mw.ustring.format('<li>P%s: %s</li>', id, id, frame:expandTemplate{ title = 'WD la...»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Для документации этого модуля может быть создана страница Модуль:Universal infocard/configdoc/doc

local p = {} -- p stands for package

function p.showSkippedProperties (frame)
	local config = require('Module:Universal infocard/config')

	local ids = {}
	for key in pairs(config.skipPropertyIds) do
	    table.insert(ids, tonumber(key:sub(2)))
	end
	table.sort(ids)
	
	local results = {}
	for _, id in ipairs(ids) do
	    table.insert(results, mw.ustring.format('<li>P%s: [[d:P:P%s|%s]]</li>',
	    	id,
	    	id,
	    	frame:expandTemplate{
				title = 'WD label',
				args = { 'P' .. id }
			}
		))
	end

	return '<ul>' .. table.concat(results) .. '</ul>'
end

return p