คุณอาจจะต้องการสร้างคู่มือการใช้งานของนี้ ผู้เขียนสามารถทำการทดลองได้ที่กระบะทราย (สร้าง | คัดลอก) และชุดทดสอบ (สร้าง) ของมอดูลนี้ โปรดเพิ่มหมวดหมู่ไปที่หน้าย่อย |
-- This module generates automatic documentation for [[Template:IPAc-en]]. local pronunciationData = mw.loadData('Module:IPAc-en/pronunciation') local phonemeData = mw.loadData('Module:IPAc-en/phonemes') local p = {} local function makeCode(s) return string.format('<code>%s</code>', mw.text.nowiki(s)) end local function buildTable(options) local ret = {} ret[#ret + 1] = '{| class="wikitable"' if options.headerRow then for i, header in ipairs(options.headerRow) do ret[#ret + 1] = '! ' .. header end end if options.rows then for i, t in ipairs(options.rows) do ret[#ret + 1] = '|-' for j, data in ipairs(t) do ret[#ret + 1] = '| ' .. data end end end ret[#ret + 1] = '|}' return table.concat(ret, '\n') end local function makeCodeTable(data, headers, callback) local headerRow = {'โค้ด', 'โค้ดอื่น'} for i, header in ipairs(headers) do headerRow[#headerRow + 1] = header end local rows = {} for i, t in ipairs(data) do local aliases = {} if t.aliases then for i, alias in ipairs(t.aliases) do aliases[#aliases + 1] = makeCode(alias) end end aliases = table.concat(aliases, ', ') rows[#rows + 1] = {makeCode(t.code), aliases, callback(t)} end return buildTable{ headerRow = headerRow, rows = rows } end function p.pronunciation() return makeCodeTable(pronunciationData, {'ผลลัพธ์'}, function (t) return t.text end) end function p.phonemes() return makeCodeTable( phonemeData, {'Display text', 'Tooltip', 'Type'}, function (t) return t.label, t.tooltip or '', t.tooltip and 'diaphoneme' or 'separator' end ) end return p
wikipedia, แบบไทย, วิกิพีเดีย, วิกิ หนังสือ, หนังสือ, ห้องสมุด, บทความ, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม, มือถือ, โทรศัพท์, Android, iOS, Apple, โทรศัพท์โมบิล, Samsung, iPhone, Xiomi, Xiaomi, Redmi, Honor, Oppo, Nokia, Sonya, MI, PC, พีซี, web, เว็บ, คอมพิวเตอร์
khumuxkarichnganmxdul srang khunxaccatxngkarsrangkhumuxkarichngankhxngmxdulni phuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulni oprdephimhmwdhmuipthihnayxy doc hnayxykhxngmxdulni This module generates automatic documentation for Template IPAc en local pronunciationData mw loadData Module IPAc en pronunciation local phonemeData mw loadData Module IPAc en phonemes local p local function makeCode s return string format lt code gt s lt code gt mw text nowiki s end local function buildTable options local ret ret ret 1 class wikitable if options headerRow then for i header in ipairs options headerRow do ret ret 1 header end end if options rows then for i t in ipairs options rows do ret ret 1 for j data in ipairs t do ret ret 1 data end end end ret ret 1 return table concat ret n end local function makeCodeTable data headers callback local headerRow okhd okhdxun for i header in ipairs headers do headerRow headerRow 1 header end local rows for i t in ipairs data do local aliases if t aliases then for i alias in ipairs t aliases do aliases aliases 1 makeCode alias end end aliases table concat aliases rows rows 1 makeCode t code aliases callback t end return buildTable headerRow headerRow rows rows end function p pronunciation return makeCodeTable pronunciationData phllphth function t return t text end end function p phonemes return makeCodeTable phonemeData Display text Tooltip Type function t return t label t tooltip or t tooltip and diaphoneme or separator end end return p ekhathungcak https th wikipedia org w index php title mxdul IPAc en documentation amp oldid 9223527