打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:读音显示:修订间差异

来自潮语辞书
无编辑摘要
标签已被回退
无编辑摘要
标签手工回退
第26行: 第26行:
     local html = string.format([[
     local html = string.format([[
<div class="entry-section regional-pronunciation-section %s">
<div class="entry-section regional-pronunciation-section %s">
   <h2>各地方音</h2><div class="toggle-wrapper"><span class="toggle-pronunciation-btn">切换为 IPA</span></div>
   <h2>各地方音</h2>
   <div class="region-group">
   <div class="region-group">
     <ul class="dialect-list">
     <ul class="dialect-list">

2025年7月10日 (四) 06:38的版本

此模块的文档可以在模块:读音显示/doc创建

local p = {}
local mw = mw

function p.render(frame)
    local char = frame.args[1] or "三"
    local mode = frame.args[2] or "潮拼"
    local regions = {
        "三饶", "凤凰", "新丰", "新塘", "汤溪", "浮山", "浮滨", "东山"
    }

    local result = {}
    for _, region in ipairs(regions) do
        local reading = frame:callParserFunction{
            name = "#invoke",
            args = { "字表调用", "getReading", char, region, mode }
        }
        table.insert(result,
            string.format(
                '<li><span class="place">%s</span><span class="pronunciation">%s</span></li>',
                region, reading or "查无"
            )
        )
    end

    local class = (mode == "IPA") and "pronunciation-ipa" or "pronunciation-chao"
    local html = string.format([[
<div class="entry-section regional-pronunciation-section %s">
  <h2>各地方音</h2>
  <div class="region-group">
    <ul class="dialect-list">
      %s
    </ul>
  </div>
</div>]], class, table.concat(result, "\n"))

    return html
end

return p