Generates part of the documentation of Module:family tree/etymology languages.
local export = {}
function export.etymology_language_data(frame)
local Array = require "Module:array"
local output = Array()
local etymology_languages = require "Module:family tree/etymology languages"
local function sort_etymology_language_codes(code1, code2)
return etymology_languages < etymology_languages
end
for code, data in require "Module:table".sortedPairs(etymology_languages, sort_etymology_language_codes) do
local code_list = data.codes
if code_list then
table.sort(code_list)
output:insert("* " .. data .. " (<code>" .. code .. "</code>): "
.. Array(code_list)
:filter(function(alt_code)
return alt_code ~= code
end)
:map(function(alt_code)
return "<code>" .. alt_code .. "</code>"
end)
:concat(", "))
end
end
return output:concat("\n")
end
return export