2,788
edits
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
function export.create_list(data) | function export.create_list(data) | ||
if not data.terms then error("{{columns}} must be supplied with a list of terms") end | if not data.terms then error("{{columns}} must be supplied with a list of terms") end | ||
table.sort(data.terms, function(a, b) return a.term < b.term end) | |||
local out = '<div class="ul-columns" data-column-count="' .. data.columns .. '">' | local out = '<div class="ul-columns" data-column-count="' .. data.columns .. '">' | ||
for _, term in ipairs(terms) do | for _, term in ipairs(data.terms) do | ||
out = out .. '\n* ' .. m_links.full_link{term = term.term, language = data.language, alt = term.alt, gloss = text.gloss, pos = text.pos} | out = out .. '\n* ' .. m_links.full_link{term = term.term, language = data.language, alt = term.alt, gloss = text.gloss, pos = text.pos} | ||
end | end |