This module provides the programming logic of headword templates, such as {{mul-morse letter}}
, that are used in Morse code entries
local export = {}
local sc = require("Module:scripts").getByCode("Morse")
local submap = {
= "]",
= "]",
= "]",
}
function export.textToImages(text)
return mw.ustring.gsub(text, "", submap)
end
local types = {
= "letters",
= "numbers",
= "punctuation marks",
= "symbols",
= "interjections",
}
function export.headword(frame)
local m_head = require("Module:headword")
local type = frame.args ~= "" and frame.args
local head = frame:getParent().args
if not head or head == "" then
head = mw.loadData("Module:headword/data").pagename
end
local langCode = frame.args or "mul"
local lang = require("Module:languages").getByCode(langCode)
local display = '<span style="display:inline-block;vertical-align:middle">' .. export.textToImages(head) .. '</span>'
local data = {lang = lang, sc = sc, categories = {}, sort_key = head, heads = {display}, translits = {"-"}}
if types then
data.pos_category = types
end
return m_head.full_headword(data)
end
return export