Module:km-pron/generate
Appearance
- The following documentation is located at Module:km-pron/generate/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
This module is used to generate the content on {{km-IPA/documentation}}
(well, partly).
local export = {}
local m_links = require("Module:links")
local test_data = require('Module:km-pron/testcases/data')
function export.make(frame)
local result, args = {}, {}
for _, data in pairs(test_data) do
local args = mw.text.split(data.respelling or data.word, ", ")
args["word"] = data.word
table.insert(result,
"<h3>" ..
m_links.language_link{
term = data.word,
lang = require("Module:languages").getByCode("km")
} ..
"</h3>\n" ..
"<pre>{{km-IPA" ..
(data.respelling and "|" .. mw.ustring.gsub(data.respelling, ", ", "|") or "") ..
"}}</pre>\n" ..
mw.getCurrentFrame():expandTemplate{
title = "Template:km-IPA",
args = args} .. "\n\n")
end
return table.concat(result)
end
return export