Module:columns: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 4: Line 4:
local m_links = require("Module:links")
local m_links = require("Module:links")
local m_parameters = require("Module:parameters")
local m_parameters = require("Module:parameters")
local m_inline = require("Module:inline")


local params = {
local params = {
Line 11: Line 12:
["t"] = {list = true, allow_holes = true},
["t"] = {list = true, allow_holes = true},
["pos"] = {list = true, allow_holes = true},
["pos"] = {list = true, allow_holes = true},
["columns"] = {type = "int", default = 2, aliases = {"cols"}},
["columns"] = {type = "int", default = 2},
["cols"] = {alias_of = "columns"},
}
}


Line 30: Line 32:
local i = 1
local i = 1
while args[2][i] do
while args[2][i] do
local i_term, i_args = m_inline.parse(args[2][i])
table.insert(terms, {
table.insert(terms, {
term = args[2][i],
term = i_term,
alt = args["alt"][i],
alt = args["alt"][i] or i_args["alt"],
gloss = args["t"][i],
gloss = args["t"][i] or i_args["t"],
pos = args["pos"][i],
pos = args["pos"][i] or i_args["pos"],
})
})
i = i + 1
i = i + 1