Module:ko-attest/data/table

Hello, you have come here looking for the meaning of the word Module:ko-attest/data/table. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:ko-attest/data/table, but we will also tell you about its etymology, its characteristics and you will know how to say Module:ko-attest/data/table in singular and plural. Everything you need to know about the word Module:ko-attest/data/table you have here. The definition of the word Module:ko-attest/data/table will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:ko-attest/data/table, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local export = {}

local works_data = mw.loadData("Module:ko-attest/data").works
local ko = require("Module:languages").getByCode("ko")
local tag_text = require("Module:script utilities").tag_text
local concat = table.concat

function export.make()
	local rows = {}
	for k, v in pairs(works_data) do
		if type(v) == "table" then
			local row = {}
			rows = row
			
			row = v.year
			row = tag_text(k, ko)			
			row = {}
			if v.aliases then
				for _, alias in ipairs(v.aliases) do
					row + 1] = alias
				end
			end
			row = tag_text(concat(row, ", "), ko)
			row = v.url and "Yes" or "No"
			row = (v.url and v.url.page) and "Yes" or "No"
		end
	end
	
	table.sort(rows, function (a, b) return a < b end)
	
	for i = 1,#rows do
		rows = concat(rows, " || ")
	end
	rows = concat(rows, "\n|-\n| ")
	
	return "{| class=\"wikitable sortable mw-collapsible mw-collapsed\"\n"
		.. "! colspan=5 | List of work presets\n"
		.. "|-\n"
		.. "! Year !! Work !! Aliases !! URL !! Images\n"
		.. "|-\n"
		.. "|" .. rows .. "\n"
		.. "|-\n"
		.. "! colspan=5 | Generated from ] via ]\n"
		.. "|}"
end

return export