Search Results: Module:If empty/doc
Sorry, the article you're looking for isn't specifically available. Here are related topics:
Module:If preview
Kamis, 2018-02-22 08:08:13depending on whether it is being previewed. Usage: {{#invoke:If preview|main|value_if_preview|value_if_not_preview}} ]] function p.main(frame) local result...
Click to read more »Module:If empty
Kamis, 2020-10-15 01:12:59local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false}) -- For backwards compatibility reasons, the...
Click to read more »Module:Asbox
Sabtu, 2021-01-30 20:55:31it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end})...
Click to read more »Module:Check for unknown parameters
Kamis, 2020-10-15 01:12:52passed to the parent -- with a list of arguments, returning a specified result if an argument is -- not on the list local p = {} local function trim(s) return...
Click to read more »Module:Authority control
Minggu, 2022-10-23 22:18:48====================]] function p.getCatForId( id ) local catName = '' if namespace == 0 then catName = 'Wikipaedia airticles wi '..id..' identifiers'...
Click to read more »Module:Citation/CS1
Minggu, 2022-10-23 22:19:13-- if first is initials with or without suffix if 3 > mw.ustring.len (name) then -- if one or two initials if suffix then ...
Click to read more »Module:Convert
Rabu, 2020-09-02 02:10:55{{convert|123|lb|kg}} --> 123 pounds (56 kg) -- See [[:en:Template:Convert/Transwiki guide]] if copying to another wiki. local MINUS = '−' -- Unicode U+2212 MINUS SIGN...
Click to read more »Module:NUMBEROF
Kamis, 2023-09-07 04:56:00local function trimArg(arg, i) arg = mw.text.trim(arg or '') if arg == '' then if i then error('Parameter ' .. i .. ' is missing. See template...
Click to read more »Module:String
Jumat, 2022-01-28 01:50:39not return nil if encoding is invalid. Does not count the bytes 192, 193, and 245-255. They are not used in UTF-8 and will not occur if the string is...
Click to read more »Module:Documentation
Kamis, 2022-12-29 06:19:20Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type...
Click to read more »Module:UserLinks
Sabtu, 2018-02-17 15:15:53and that it is not the blank string. Returns the code if -- the check passes, and nil if not. if type(code) == 'string' and code ~= '' then return...
Click to read more »Module:InfoboxImage
Kamis, 2020-10-15 03:04:10set to yes, if the image has to be centered -- upright - upright image param -- suppressplaceholder - if yes then checks to see if image is a placeholder...
Click to read more »Module:Settlement short description
Selasa, 2019-12-17 09:29:15cattype) if category then p.categories = p.categories..category end --categorize end --sanity and other checks function p.validate (parameter, cat) if not...
Click to read more »Module:Gl-noun
Senin, 2020-04-27 08:06:38local g1 = args[1]; if g1 == "" then g1 = nil end local g2 = args["g2"]; if g2 == "" then g2 = nil end g1 = g1 or "?" if g1 == "morf" or g1 ==...
Click to read more »Module:Lang
Minggu, 2022-10-23 22:19:23markup, if any; ignore single quote seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote if '' ~=...
Click to read more »Module:ISO 3166
Kamis, 2020-10-15 03:12:42pairs(cdata["isonames"] or {}) do if sqry==p.strip(tname) then return true end end for _,tname in pairs(cdata["altnames"] or {}) do if sqry==p.strip(tname)...
Click to read more »Module:Lang/sandbox
Minggu, 2022-10-23 22:19:28>------------------------------------------------------------------ Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil)...
Click to read more »Module:Dsb-headword
Senin, 2020-04-27 08:06:09args["head"]; if head == "" then head = nil end -- See if a function exists for the particular part-of-speech type, and call it if there is one. if pos_functions[poscat]...
Click to read more »Module:Homophones
Senin, 2020-04-27 08:06:44args = frame:getParent().args local lang = args["lang"]; if lang == "" then lang = nil end if not lang then lang = "en" end lang = require("Module:languages")...
Click to read more »Module:Usex
Minggu, 2020-11-01 13:08:03function wrap(tag, class, text, lang) if lang then lang = ' lang="' .. lang .. '"' else lang = "" end if text and class then return table.concat{'<'...
Click to read more »Module:Category relatit
Jumat, 2020-10-23 03:30:06newCategoryLinker(options) local formatString if options.project then if options.showPrefix then if options.boldLink then formatString = '<b>[[:'...
Click to read more »Module:Pt-plural
Senin, 2020-04-27 08:11:062); if (suf3 == "ção" or suf3 == "são") then return pre2 .. "ões" end if (suf3 == "çaõ") then return pre3 .. "çoens" end if (suf2 ==...
Click to read more »Module:Infobox
Kamis, 2020-10-15 03:06:03return s and s:match( '%S' ) end local function fixChildBoxes(sval, tt) if notempty(sval) then local marker = '<span class=special_infobox_marker>'...
Click to read more »Module:Video gemme wikidata
Jumat, 2017-08-11 00:06:43if(platformA == nil) then platformA = mw.wikibase.label('Q'..a['qualifiers']['P400'][1]['datavalue']['value']['numeric-id']); end; end; if...
Click to read more »Module:Gl-plural
Senin, 2020-04-27 08:06:38if (suf1 == "z") then return pre1 .. "ces" end if (suf1 == "r") then return lemma .. "es" end if (suf1 == "x") then return lemma end if (is_vowel(suf1)...
Click to read more »Module:Es-conj
Senin, 2020-04-27 08:06:11json, combined, json_combined} end function strip_accents(form) if form then if mw.ustring.match(form, ',') then local result_t = {} for term...
Click to read more »Module:Nn-noun
Senin, 2020-04-27 08:08:28PAGENAME:gsub("e$", "") local root_sg = nil local root_pl = nil if classType ~= 'multi' then if args[1] and args[1] ~= '' and not args[2] then root_sg...
Click to read more »Module:Es-conj/table
Senin, 2020-04-27 08:06:14end if (defective_t[69]) then forms["d69"] = defective_t[69] end if (defective_t[70]) then forms["d70"] = defective_t[70] end if (defective_t[71])...
Click to read more »Module:Parameters
Senin, 2020-04-27 08:11:01true end if param.list then local key = name if type(name) == "string" then key = string.gsub(name, "=", "") end if param.default...
Click to read more »Module:Nn-verb-irreg
Senin, 2020-04-27 08:08:29local p = {} function p.link(word, form) if word == form then link = word else link = "[[" .. form .. "#Norwegian Nynorsk|" ....
Click to read more »Module:Coordinates
Minggu, 2022-10-23 22:18:54used in detecting DMS formatting ]] local function dmsTest(first, second) if type(first) ~= 'string' or type(second) ~= 'string' then return nil end...
Click to read more »Module:Ro-headword
Senin, 2020-04-27 08:11:08local function is_equal(a1, a2) if a1 == a2 then return true end if #a1 == #a2 then for i = 1, #a1 do if a1[i] ~= a2[i] then return false...
Click to read more »Module:Labels
Senin, 2020-04-27 08:06:59":" .. cat) if script then table.insert(categories, lang_code .. ":" .. cat .. " in " .. script .. " script") end if script2 then table...
Click to read more »Module:Uk-headword
Senin, 2020-04-27 08:11:26head2=, head3= etc. local head = args[1]; if head == "" then head = nil end local i = 2 while head do if m_common.needs_accents(head) then table...
Click to read more »Module:Sl-headword
Senin, 2020-04-27 08:11:20for accents local check_accents = true -- If the first headword given is "-", then skip the check. if data.heads[1] == "-" then data.heads[1] = ""...
Click to read more »Module:Es-headword
Senin, 2020-04-27 08:06:15= {}, inflections = {}, categories = {}} if args["suff"] then data.pos_category = "suffixes" if suffix_categories[poscat] then local singular_poscat...
Click to read more »Module:Utilities
Senin, 2020-04-27 08:11:31string -- Magic characters: ^$()%.[]*+-? function export.pattern_escape(text) if type(text) == "table" then text = text.args[1] end text = mw.ustring.gsub(text...
Click to read more »Module:Ca-headword
Senin, 2020-04-27 08:06:01= {}, inflections = {}, categories = {}} if args["suff"] then data.pos_category = "suffixes" if poscat == "adjectives" then table.insert(data...
Click to read more »Module:Pt-noun
Senin, 2020-04-27 08:11:06'<abbr title="plural number">pl</abbr>'}, } } function splitter(s, c) if (s == nil or c == nil) then return nil end local t = {} local cpos =...
Click to read more »Module:Links
Senin, 2023-03-06 07:20:09unsupported_titles if unsupported_titles[target] then return "Unsupported titles/" .. unsupported_titles[target] end -- If the link contains unexpanded...
Click to read more »Module:Protected edit request
Rabu, 2014-02-19 07:07:51---------------------------- local function makeWikilink(page, display) if display then return mw.ustring.format('[[%s|%s]]', page, display) else...
Click to read more »Module:En-headword
Sabtu, 2020-09-19 13:00:28"boolean"}, ["sort"] = {}, } local pos_data = pos_functions[poscat] if pos_data then for key, val in pairs(pos_data.params) do params[key] =...
Click to read more »Module:Languages/templates
Senin, 2020-04-27 08:08:20module invocation.") lang = require("Module:languages").getByCode(lang) if lang then return "1" else return "" end end -- Used by the following...
Click to read more »Module:Nl-common
Senin, 2020-04-27 08:08:27dash if empty. function export.link_form(form, tag) if not PAGENAME then PAGENAME = mw.title.getCurrentTitle().text end if type(form)...
Click to read more »Module:Lua banner
Kamis, 2020-10-15 01:53:50title = mw.title.getCurrentTitle() if title.subpageText == "doc" then title = title.basePageTitle end if title.contentModel == "Scribunto" then...
Click to read more »Module:Ja-headword
Senin, 2020-04-27 08:06:48%-%^]' local is_suru_verb = false local function detect_kana_script(kana) if find(kana, katakana_pattern) then return 'kata' elseif find(kana, hiragana_pattern)...
Click to read more »Module:Headword
Sabtu, 2023-04-08 08:22:19getByCode(script_code) local characters if sc then characters = sc:getCharacters() end local out if characters then text = mw.ustring.gsub(text...
Click to read more »Module:IPA
Senin, 2020-04-27 08:05:48mw.title.getCurrentTitle().nsText if err then err_text = '<span class="error">' .. err .. '</span>' else if hasKey[lang:getCode()] then IPA_key...
Click to read more »Module:Utils
Senin, 2020-04-27 08:11:32append to list if element not already present function export.insert_if_not(tab, item, pos) if not export.contains(tab, item) then if pos then ...
Click to read more »Module:Script utilities
Senin, 2020-04-27 08:11:15local U = mw.ustring.char if lang and text then -- [[Special:WhatLinksHere/Template:tracking/script/ang/acute]] if lang:getCode() == "ang" then...
Click to read more »Module:Pt-conj
Senin, 2020-04-27 08:11:05local exports = {} local function verbData(ending) local group if ending == 'pôr' or ending == 'por' then group = 'er' elseif ending ==...
Click to read more »Module:Template wrapper
Minggu, 2022-10-23 22:19:44for value; return true if found, false else ]] local function is_in_table (tbl, value) for k, v in pairs (tbl) do if v == value then return...
Click to read more »Module:La-headword
Senin, 2020-04-27 08:06:54format(array, concatenater) if #array == 0 then return "" else local concatenated = table.concat(array, concatenater) if concatenated == "" then ...
Click to read more »Module:Fr-headword
Senin, 2020-04-27 08:06:33newlist = {} for _, item in ipairs(list) do local form if suffix == "s" then if rfind(item, "[sx]$") then form = item elseif rfind(item...
Click to read more »Module:Italics
Senin, 2020-04-27 08:06:47gsub = mw.ustring.gsub function export.i(text) if text == "" or text == nil then return nil end if type(text) == "table" and text.args then text...
Click to read more »Module:Template:also
Minggu, 2020-11-01 09:53:09with serial "and" and serial comma local function serial_comma_join(seq) if #seq == 0 then return "" elseif #seq == 1 then return seq[1] -- nothing...
Click to read more »Module:Ro-adjective
Senin, 2020-04-27 08:11:08indefinite form if it's --not the lemma. Many of these situations will never happen. local ret = lemma if only.def then if only.pl then if only.f then...
Click to read more »Module:Fro-headword
Senin, 2020-04-27 08:06:34if head == "" then head = nil end local op = args["op"] or args[2]; if op == "" then op = nil end local ns = args["ns"] or args[3]; if ns...
Click to read more »Module:ConvertNumeric
Selasa, 2020-01-28 08:18:30numerator, if any (default = 1 if a denominator is given) -- denominator (string or nil): denominator, if any -- sp_us (boolean): true if sp=us -- negative_word...
Click to read more »Module:Uk-common
Senin, 2020-04-27 08:11:25function export.needs_accents(word) if mw.ustring.find(word, "\204\129") then return false -- A word needs accents if it contains more than one vowel ...
Click to read more »Module:Ko-translit
Senin, 2020-04-27 08:06:51ustring.gsub(word,'%([一丁-龯㐀-䶵]+%)','') word = mw.ustring.gsub(word,'—','-') if mw.ustring.gsub(word,'[ㅂㅈㄷㄱㅅㅁㄴㅇㄹㅎㅋㅌㅊㅍㄸㅃㅉㄲㅆㅛㅕㅑㅐㅔㅗㅓㅏㅣㅠㅜㅡㅖㅒ%-]','') == '' then...
Click to read more »Module:Sports table
Minggu, 2022-10-23 22:19:49if we are using section transclusion for a different section if( isnotblank(Pargs['transcludesection']) and isnotblank(Args['section']) ) then if(...
Click to read more »Module:Pt-headword
Senin, 2020-04-27 08:11:06{}} -- Call POS-specific function if pos_functions[poscat] then pos_functions[poscat](args, data) end if #data.heads == 0 then data.heads =...
Click to read more »Module:Nb-noun
Senin, 2020-04-27 08:08:26root_pl = args[2] if args[1] and args[1] ~= '' then root_sg = args[1] end end local gen_dsg = args['gen_dsg']; if gen_dsg == "" then gen_dsg...
Click to read more »Module:Sv-nouns
Senin, 2020-04-27 08:11:21local args = frame:getParent().args if args["base"] then require("Module:debug").track("sv-nouns/base") end if args["betydelser"] then require("Module:debug")...
Click to read more »Module:Ga-common
Senin, 2020-04-27 08:06:35word, hpro = word} local word_l = mw.ustring.lower(word) if tag ~= "nolen" then if mw.ustring.find(word_l, "^[bcdfgmpt]") then ret.len = mw.ustring...
Click to read more »Module:Infobox school tracking
Rabu, 2018-04-18 23:06:20local count = 0 if args['Campuses'] then table.insert(unknown_parameters, 'Campuses = use campuses instead') end if args['Classes offered']...
Click to read more »Module:Compound/templates
Senin, 2023-03-27 01:26:54local function if_not_empty(val) if val == "" then return nil else return val end end local function to_boolean(val) if not val or val ==...
Click to read more »Module:Ru-headword
Senin, 2020-04-27 08:11:11if m_common.needs_accents(head) then if not args.notrcat then table.insert(data.categories, "Russian terms needing accents") end end if...
Click to read more »Module:Palindromes
Senin, 2020-04-27 08:11:00Language-specific substitutions -- Ignore entire scripts (e.g. romaji in Japanese) if langdata.ignore then sc_name = sc and sc:getCode() or require("Module:scripts")...
Click to read more »Module:Tg-translit
Senin, 2020-04-27 08:11:23if e == 'е' then e = 'ye' end if e == 'Е' then e = 'Ye' end if e == 'и' then e = 'yi' end if e ==...
Click to read more »Module:Headword/templates
Senin, 2020-04-27 08:06:43translits = args["tr"] data.genders = args["g"] -- Script local cat_sc if args["cat sc"] then data.sc = (args["cat sc"] and (require("Module:scripts")...
Click to read more »Module:String utilities
Senin, 2020-04-27 08:11:21(string.gsub(str, "{(\\?)((\\?)[^{}]*)}", function (p1, name, p2) if #p1 + #p2 == 1 then return format_escapes[name] or error(module_name...
Click to read more »Module:Translit-redirect
Senin, 2020-04-27 08:11:25local language_data = data[lang] if language_data then script_data = language_data[sc] if script_data then if script_data.module then local...
Click to read more »Module:Pi-headword
Senin, 2020-04-27 08:11:02also be 'ຢ', but seemingly -- not if a Buddhist Institute consonant is used. if scriptCode == 'Laoo' then if not mw.ustring.find(t2, '[ຆຌຏຐຑຒຓຘຠຨຩ]')...
Click to read more »Module:Scripts
Senin, 2020-04-27 08:11:16Script:getParent() return self._rawData.parent end function Script:getSystems() if not self._systemObjects then local m_systems = require("Module:Writing systems")...
Click to read more »Module:La-nominal
Senin, 2020-04-27 08:06:55if linked_variant > max_linked_variant then linked_variant = 1 num = num + 1 if num > #nums then num = 1 case = case + 1 if case...
Click to read more »Module:Table
Sabtu, 2020-09-19 04:00:25isPositiveInteger -- -- This function returns true if the given value is a positive integer, and false -- if not. Although it doesn't operate on tables, it...
Click to read more »Module:Indtr
Senin, 2020-04-27 08:06:46frame:getParent().args local pagename = mw.title.getCurrentTitle().text if (args[1] == nil and mw.title.getCurrentTitle().nsText == "Template") then...
Click to read more »Module:Vi
Senin, 2020-04-27 08:11:33toTraditionalTones(text) if type(text) == "table" then text = text.args[1] end return (mw.ustring.gsub(text, "%a+", function (word) if mw.ustring.match(word...
Click to read more »Module:It-head
Senin, 2020-04-27 08:06:47= {}, inflections = {}} local stem = args[1] local end1 = args[2] if not stem then -- all specified data.heads = args[2] data.inflections =...
Click to read more »Module:Languages
Senin, 2023-03-06 07:19:41two or three groups of three lowercase letters with hyphens between them. If such a pattern is not found, it is likely the editor simply forgot to enter...
Click to read more »Module:Json
Senin, 2020-04-27 08:05:50jsonValueFromValue(val, opts) opts = opts or {} function converter(val) if type(val) == 'nil' then return 'null' elseif type(val) == 'boolean' then...
Click to read more »Module:Etymology
Senin, 2020-04-27 08:06:17export = {} --[[ If language is an etymology language, iterates through parent languages until it finds a non-etymology language. | If language is an...
Click to read more »Module:Number list
Senin, 2020-04-27 08:08:29list/data/" .. lang:getCode()) local cur_data = m_data.numbers[cur_num] if not cur_data then error('The number "' .. cur_num .. '" is not found in...
Click to read more »Module:Translations
Senin, 2023-03-06 07:15:40show_terminfo(terminfo) -- Translations must be for mainspace languages if terminfo.lang:getType() == "reconstructed" or terminfo.lang:getType() ==...
Click to read more »Module:Etymology/templates
Sabtu, 2020-09-19 07:19:07confusing... if not lang then lang = "sco" elseif lang == "-" then lang = nil end if lang then lang = fetch_lang(lang, 2) end if lang and (lang:getCode()...
Click to read more »Module:Etymtree
Senin, 2020-04-27 08:06:23branch_term, root_lang, root_term) if not branch_term then branch_term = mw.title.getCurrentTitle().subpageText if branch_lang:getType() == "reconstructed"...
Click to read more »Module:Nl-headword
Senin, 2020-04-27 08:08:28invocation.") local params = { ["head"] = {list = true, default = ""}, } if pos_functions[poscat] then for key, val in pairs(pos_functions[poscat].params)...
Click to read more »Module:Wikimedia languages
Senin, 2020-04-27 08:11:34return "Wikimedia" end function WikimediaLanguage:getWiktionaryLanguage() if not self._wiktionaryLanguageObject then self._wiktionaryLanguageObject =...
Click to read more »Module:Ru-nominal
Senin, 2020-04-27 08:11:11split_russian_tr(term, dopair) local ru, tr if not rfind(term, "//") then ru = term else splitvals = rsplit(term, "//") if #splitvals ~= 2 then error("Must...
Click to read more »Module:IPA/templates
Senin, 2020-04-27 08:05:49langCode, symbols, category) if langObject and langObject:getCode() == langCode then if type(symbols) == "string" then if mw.ustring.find(IPA, symbols)...
Click to read more »Module:Ru-noun
Senin, 2020-04-27 08:11:12b' d' f' f''). Multiple values can be specified, separated by commas. If omitted, defaults to a or b depending on the position of stress on the...
Click to read more »Module:Unicode data
Kamis, 2025-07-24 17:48:21local p = {} local floor = math.floor local function errorf(level, ...) if type(level) == "number" then return error(string.format(...), level + 1)...
Click to read more »Module:Ru-common
Senin, 2020-04-27 08:11:10-)$") if not w then return nil end if string.find(" всей всём всех мне ",' '..ulower(w)..' ',1,true) then return 'обо' end local ws=usub(w,1,2) if ws==uupper(ws)...
Click to read more »Module:Data tables
Senin, 2020-04-27 08:06:06maybe_mw_load(x) local success, val = pcall(function() return mw.loadData(x) end) if success then return val else return nil end end local unsharded, i = {},...
Click to read more »Module:Form of
Minggu, 2020-11-01 12:28:51shortcuts[tag] end if not expansion then return tag end -- Maybe track the expansion if it's not the same as the raw tag. if do_track and expansion...
Click to read more »Module:Pi-decl/noun
Senin, 2020-04-27 08:11:02pairs(endings.two) do if wordEnd == key then return key end for _, val in ipairs(arr) do if wordEnd == val then if key == 'ent' then ...
Click to read more »Module:Video gemme reviews
Minggu, 2022-10-23 22:21:54getActiveSystems(args) local activeSystems = {} for k,v in pairs(args) do if data.systems[k] and yesno(v) then table.insert(activeSystems, k) end...
Click to read more »Module:Ru-adjective
Senin, 2020-04-27 08:11:09early version by Wikitiki89 Arguments: 1: lemma; nom sg, or just the stem if an explicit declension type is given in arg 2 2: declension type (usually...
Click to read more »Module:Compound
Senin, 2020-04-27 08:06:04if #possible_scripts == 1 then -- 2. If the language has only one possible script, use it. scode = possible_scripts[1] else -- 3. Check if...
Click to read more »Module:Ja-kanjitab
Senin, 2020-04-27 08:06:49two-kanji compounds if yomi == "on" or yomi == "o" then yomi = "on" end if yomi == "kun" or yomi == "k" then yomi = "kun" end if yomi == "irr" or yomi...
Click to read more »Module:Infobox body of water tracking
Minggu, 2014-01-19 00:12:42local cats = '' local args = frame:getParent().args if (isblank(args['image']) and isblank(args['image_lake']) and isblank(args['image_ocean'])...
Click to read more »Module:La-noun
Senin, 2020-04-27 08:06:55for _, key in ipairs(case_order) do if args[key] or data.forms[key] then local user_specified = false if args[key] then val = args[key] ...
Click to read more »Module:Fi-utilities
Senin, 2020-04-27 08:06:27function export.make_weak(before, strong, after, check) local weak = strong if strong == "pp" then weak = "p" elseif strong == "tt" then weak = "t"...
Click to read more »Module:Accent qualifier
Senin, 2020-04-27 08:05:57qualifier/data") if type(qualifiers) ~= "table" then qualifiers = { qualifiers } end local accents = {} for _, accent in ipairs(qualifiers) do if data[accent]...
Click to read more »Module:La-pronunc
Senin, 2020-04-27 08:06:57phonemes[i] = "t͡s" end if phonemes[i] == "kʰ" then phonemes[i] = "k" end if phonemes[i] == "tʰ" then phonemes[i] = "t" end if phonemes[i+1] and phonemes[i]...
Click to read more »Module:Hms
Senin, 2017-07-03 04:45:15= {} if tonumber(args[1]) or args[2] or args[3] then if args[4] then return p._error('Parameter number 4 should not be specified') end if not args[1]...
Click to read more »Module:Fun
Senin, 2020-04-27 08:06:35iterableTypes = { "table", "string" } local function _check(funcName, expectType) if type(expectType) == "string" then return function(argIndex, arg, nilOk)...
Click to read more »Module:Eo-headword
Senin, 2020-04-27 08:06:11frame:getParent().args["pos"] or frame.args["poscat"] or getPOS(PAGENAME) if not poscat then if mw.title.getCurrentTitle().nsText == "Template" then poscat...
Click to read more »Module:Hu-nominals
Senin, 2020-04-27 08:06:44parameter 1 to the module invocation") local args = frame:getParent().args if not inflections[infl_type] then error("Unknown inflection type '" .. infl_type...
Click to read more »Module:Gender and number
Senin, 2020-04-27 08:06:37export.show_list(frame) local args = frame.args local lang = args["lang"]; if lang == "" then lang = nil end local list = {} local i = 1 while args[i]...
Click to read more »Module:Pl-IPA
Senin, 2020-04-27 08:11:03= true if vowel[pcurr] then if had_vowl then same_syl = false end had_vowl = true elseif had_vowl then if vowel[pnext] then...
Click to read more »Module:TemplatePar
Rabu, 2023-04-19 21:20:37access ] if not suited then finer() lucky, r = pcall( fun, "Module:" .. storage ) end if not lucky then if not suited...
Click to read more »Module:Weather box/row
Selasa, 2019-07-09 07:52:53second) if not self:isValid() then return nil end local display = self.string if display == 'trace' then if second then -- If a cell displays...
Click to read more »Module:Taxonbar
Minggu, 2022-10-23 22:23:12) if thing == nil or thing == '' then return true end return nil end local function getIdFromWikidata( item, property ) local id = nil if property...
Click to read more »Module:Team appearances list
Sabtu, 2017-04-29 09:25:54strip_to_nil(text) -- If text is a string, return its trimmed content, or nil if empty. -- Otherwise return text (which may, for example, be nil). if type(text)...
Click to read more »Module:Pl-noun
Senin, 2020-04-27 08:11:04export.make_links(text, splitchars, title) if not title then title = mw.title.getCurrentTitle().fullText end if empty_item(text) then return "—" elseif...
Click to read more »Module:Category described in year
Minggu, 2022-10-23 22:23:2912th, etc. if tonumber(i) then local s = tostring(i) local tens = string.match(s, '1%d$') local ones = string.match(s, '%d$') if tens ...
Click to read more »Module:Links/templates
Senin, 2020-04-27 08:08:24["ts"] = {}, ["sc"] = {}, } -- Compatibility mode for {{term}}. -- If given a nonempty value, the function uses lang= to specify the -- language...
Click to read more »Module:Date
Rabu, 2026-02-18 11:57:04} end local function strip_to_nil(text) -- If text is a string, return its trimmed content, or nil if empty. -- Otherwise return text (convenient when...
Click to read more »Module:Tlg
Senin, 2020-09-28 22:46:47local i, _ = s:find(':', 1, true) if i == nil then return 'Template:' .. s end local ns = s:sub(1, i - 1) if ns == '' or mw.site.namespaces[ns]...
Click to read more »Module:Array
Senin, 2020-04-27 08:05:59floor(index) if index < 0 then index = #self + index + 1 end return index end -- string.sub-style slicing. function array_methods:slice(i, j) if i == nil...
Click to read more »Module:Ny-headword
Senin, 2020-04-27 08:08:31= plural_classes[args[1]]}, request = true} -- If no plural was provided, generate one if not args[2] then local singular = args["head"] and...
Click to read more »Module:Val
Minggu, 2018-02-18 08:42:20range = range_types[arg] if range then if type(index) == 'number' and (index % 2 == 0) then if index == 2 then if numbers[1] and numbers[1]...
Click to read more »Module:Delink
Minggu, 2022-10-23 22:20:13local p = {} local getArgs local function delinkReversePipeTrick(s) if s:match("^%[%[|.*[|\n]") then -- Check for newlines or multiple pipes. ...
Click to read more »Module:Sl-noun
Senin, 2020-04-27 08:11:20local num = args["n"]; if num == "" then num = nil end local data = {forms = {}, title = nil, categories = {}, num = num} if inflections[infl_type]...
Click to read more »Module:Grc-utilities
Senin, 2020-04-27 08:06:38add(list, index, chars, text) if not chars then error("The function add cannot act on a nil character.") end if list[index] then list[index] =...
Click to read more »Module:Lb-headword
Senin, 2020-04-27 08:08:20PAGENAME = mw.title.getCurrentTitle().text local head = args["head"]; if head == "" then head = nil end local poscat = frame.args[1] or error("Part...
Click to read more »Module:Alternative forms
Senin, 2020-04-27 08:05:57) if not data then if alias_of then data = dialect_data[alias_of] or ( dialect_data.labels and dialect_data.labels[alias_of] ) end end if data...
Click to read more »Module:Template link general
Kamis, 2022-01-20 19:24:53local i, _ = s:find(':', 1, true) if i == nil then return 'Template:' .. s end local ns = s:sub(1, i - 1) if ns == '' or mw.site.namespaces[ns]...
Click to read more »Module:Form of/cats
Senin, 2020-04-27 08:06:29or any abbreviation; if that tag is present among the user-supplied tags, SPEC is applied, otherwise ELSESPEC is applied if present. SPEC and ELSESPEC...
Click to read more »Module:La-verb
Senin, 2020-04-27 08:06:58-- 4. (DONE) Add 4++ that has alternative perfects -īvī/-iī. -- 5. (DONE) If sup but no perf, allow passive perfect forms unless no-pasv-perf. -- 6. (DONE)...
Click to read more »Module:Wd
Rabu, 2020-07-08 09:39:07= ... local i18n local function loadI18n(aliasesP, frame) local title if frame then -- current module invoked by page/template, get its title from...
Click to read more »Module:Labels/templates
Sabtu, 2020-09-19 03:06:19local sort_key = args["sort"] local sort_key2 = args["sort2"] if not lang then if mw.title.getCurrentTitle().nsText == "Template" then lang = "und"...
Click to read more »Module:Flags
Minggu, 2013-08-18 02:53:31code search if #territory.args[1] == 2 then for flagParameter,commonsFile in pairs(master.twoLetter) do if flagParameter ==...
Click to read more »Module:Zh
Minggu, 2022-10-23 22:22:48parameters; see if there's a first parameter, ignoring its name if (args[1]) then -- if there is treat it as Chinese label = "" if (uselabels)...
Click to read more »Module:Reply to
Sabtu, 2018-02-17 15:12:36usernames = 0 for k, v in pairs(origArgs) do if type(k) == 'number' then if mw.ustring.match(v,'%S') then if k > maxArg then maxArg = k end usernames...
Click to read more »Module:Unsubst
Senin, 2018-06-04 23:35:27content' } function p.main(frame, body) -- If we are substing, this function returns a template invocation, and if -- not, it returns the template body....
Click to read more »Module:Convert/wikidata
Selasa, 2018-01-30 07:50:04= {} Collection.__index = Collection do function Collection:add(item) if item ~= nil then self.n = self.n + 1 self[self.n] = item end end...
Click to read more »Module:Debug
Senin, 2020-04-27 08:06:08dump(value, prefix, tsort) local t = type(value) prefix = prefix or "" if t == "string" then return '"' .. escape(value) .. '"' elseif t == "table"...
Click to read more »Module:Armenian
Rabu, 2017-04-26 05:41:40If we are being called from #invoke, then the number is the first positional -- argument. If not, it is the frame parameter. local num if...
Click to read more »Module:Navseasoncats
Jumat, 2020-01-03 10:35:20testcasecolon = '' local testcases = (currtitle.subpageText == 'testcases') if testcases then testcasecolon = ':' end local navborder = true local followRs...
Click to read more »Module:Location map
Rabu, 2023-03-01 08:34:39math.floor(n * pow + 0.5) / pow end function p.getMapParams(map, frame) if not map then error('The name of the location map definition to use must...
Click to read more »Module:Unsubst-infobox
Senin, 2017-07-03 04:42:02function ( frame ) if not frame:getParent() then error( '{{#invoke:Unsubst-infobox|}} makes no sense without a parent frame' ) end if not frame.args['$B']...
Click to read more »Module:Archive list
Sabtu, 2018-02-17 15:13:38num ) if num then num = tonumber( num ) if type( num ) == 'number' then num = math.floor( num ) if num >= 0...
Click to read more »Module:WikidataIB
Senin, 2023-02-13 20:06:53Can take a named parameter |qid which is the Wikidata ID for the article -- if not supplied, it will use the Wikidata ID associated with the current page...
Click to read more »Module:Object usage
Senin, 2020-04-27 08:08:31local export = {} -- if not empty local function ine(val) if val == "" then return nil end return val end local function parse_form(args, i, default)...
Click to read more »Module:Letters
Senin, 2020-04-27 08:08:20frame:getParent().args local namespace = mw.title.getCurrentTitle().nsText if namespace ~= "Appendix" then return export.letters2(frame) end -- The...
Click to read more »Module:Rail-interchange multi
Senin, 2019-09-23 08:25:32v1 in ipairs(data) do args = {} if v1 ~= '' and v1 ~= '\\' then local tmp = mw.text.split(v1, '\\') if i1 == 1 then default = tmp[1] ...
Click to read more »Module:Dts
Jumat, 2017-05-26 04:37:27self:parseDate(args[1]) end -- Raise an error on invalid values if self.year then if self.year == 0 then error('years cannot be zero', 0) elseif...
Click to read more »Module:Type in location
Senin, 2018-06-04 03:11:13--Gets general location from more specific one for short descriptions --i.e if a location is specified to be "P. Sherman 42 Wallaby Way Sydney, Australia"...
Click to read more »Module:Template:R:Dokumentasjonsprosjektet
Senin, 2020-04-27 08:05:55= frame:getParent().args if args['lang'] then lang = args['lang'] else lang = 'no' end if lang == 'nb' then specifier...
Click to read more »Module:Ja
Senin, 2020-04-27 08:06:48data.grade5, grade6 = data.grade6 } function export.hira_to_kata(text) if type(text) == "table" then text = text.args[1] end return (gsub(text, '[ぁ-ゖ]'...
Click to read more »Module:TimeAgo
Selasa, 2016-06-21 23:49:55args.spelloutmax -- Add a purge link if something (usually "yes") is entered into the purge parameter if purge then purge = ' <span class="plainlinks">(['...
Click to read more »Module:Infobox cyclist tracking
Senin, 2018-05-07 08:05:28prefixes[k] local maxindex = maxindices[k] if (isnotblank(args[prefix .. 'years']) ) then hasyears[k] = 1 end if (isnotblank(args[prefix .. 'years']) and...
Click to read more »Module:Arguments
Sabtu, 2021-03-13 06:11:50local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == '' then return nil else return...
Click to read more »Module:Form of/templates
Senin, 2020-04-27 08:06:32",")) do local param = rmatch(ignore, "^(.*):list$") if param then if rfind(param, "^[0-9]+$") then table.insert(numbered_list_params_to_ignore...
Click to read more »Module:British regnal year
Rabu, 2017-04-26 05:42:18an integer if possible. Return "N/A" if the input could -- not be converted, or if the converted input is too big or too small. if type( inputYear...
Click to read more »Module:Families
Senin, 2020-04-27 08:06:24function Family:getType() return "family" end function Family:getFamily() if self._rawData.family and not self._familyObject then self._familyObject...
Click to read more »Module:Labels/data/functions
Senin, 2020-04-27 08:07:45export = {} function export.handle_languages(labels) if type(labels) ~= "table" then error('The function "handle_languages" requires a table as argument...
Click to read more »Module:Ca-common
Senin, 2020-04-27 08:06:01dash if empty. function export.link_form(form, tag) if not PAGENAME then PAGENAME = mw.title.getCurrentTitle().text end if type(form)...
Click to read more »Module:Scots byleid note
Rabu, 2020-10-21 00:07:41making iupac and oxford not be added to the id if it doesn't exist --Generate the text if it isn't specified if not n.text then p.modify_text () p.base_text...
Click to read more »Module:Check isxn
Sabtu, 2017-03-04 05:19:47loop through all of the bytes and calculate the checksum if v == string.byte( "X" ) then -- if checkdigit is X (compares the byte value of 'X' which is...
Click to read more »Module:Yesno
Jumat, 2021-04-09 09:44:13similarly to the template {{yesno}}. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you --...
Click to read more »Module:Links2
Sabtu, 2020-09-19 04:13:17unsupported_titles if unsupported_titles[target] then return "Unsupported titles/" .. unsupported_titles[target] end -- If the link contains unexpanded...
Click to read more »Module:R:Perseus
Senin, 2020-04-27 08:05:53']]}} should be a Greek word.') end if args[1] then if is_polytonic(args[1]) then if not word then word = args[1] else ...
Click to read more »Module:Factorization
Minggu, 2013-08-18 02:57:38primeLink = frame.args['prime'] and true number = math.floor(number) if number < 2 or number > 1000000 then return '<strong class="error">number...
Click to read more »Module:Columns
Senin, 2020-04-27 08:06:03format_list_items(items, lang) local result = {} for i, item in ipairs(items) do if lang and not string.find(item, "<span") then item = m_links.full_link({lang...
Click to read more »Module:Zu-headword
Senin, 2020-04-27 08:11:36local function remove_prefix(word, class) if not class or not prefixes[class] then return nil end -- If there is a capital letter in the word, --...
Click to read more »Module:Relatit
Sabtu, 2020-10-03 05:34:35relatit article or articles. It implements the -- template {{relatit}}. -- -- If the module is used in category or category talk space, it produces -- "relatit...
Click to read more »Module:Relatit/sandbox
Sabtu, 2020-10-03 05:33:12relatit article or articles. It implements the -- template {{relatit}}. -- -- If the module is used in category or category talk space, it produces -- "relatit...
Click to read more »Module:Ca-IPA
Senin, 2020-04-27 08:06:00-- Allophones of r if i == 1 then current.onset = mw.ustring.gsub(current.onset, "^ɾ", "r") end if i > 1 then if mw.ustring.find(previous...
Click to read more »Module:Sidebar games events
Minggu, 2022-10-23 22:20:57navbar = require('Module:Navbar')._navbar function p.sidebar(frame, args) if not args then args = getArgs(frame) end local root = mw.html.create()...
Click to read more »Module:Road data/parser
Kamis, 2014-08-28 22:55:56parser(formatStr, args, form) local function ifexists(name) if name == '' then return false end local title if form == 'shield' then title = mw.title.new(name...
Click to read more »Module:Track gauge
Minggu, 2017-03-05 00:37:59---------------------- local function prepareArgs(frame) local origArgs if frame == mw.getCurrentFrame() then origArgs = frame:getParent().args for...
Click to read more »Module:Historical populations
Rabu, 2026-02-18 20:23:09lazy initialization local function ifexist(page) if not page then return false end if mw.title.new(page).exists then return true end return...
Click to read more »Module:SportsRankings
Minggu, 2022-10-23 22:22:43content if v and v ~= "" then templateArgs[k]=v --parents.args[k] end end for k,v in pairs(frame.args) do --check content if v and v ~=...
Click to read more »Module:Calendar date
Minggu, 2022-10-23 22:24:41trimArg >----------------------- trimArg returns nil if arg is "" while trimArg2 returns 'true' if arg is "" trimArg2 is for args that might accept...
Click to read more »Module:Gutenberg
Senin, 2019-12-23 07:57:06author" -- name of calling template. Change if template is renamed. local id = nil ...
Click to read more »Module:High-use
Kamis, 2022-12-29 06:25:46require('Module:Yesno') function p.num(frame, count) if count == nil then if yesno(frame.args['fetch']) == false then if (frame.args[1] or '') ~= '' then count...
Click to read more »Module:Navbox Canada
Minggu, 2018-02-18 04:52:30require('Module:Navbox') local function bordercss(t) c = '#CC0000' local s = '' if t == 'a' then s = 'inset 1px 1px 0 ' .. c .. ', inset -1px -1px 0 ' .. c...
Click to read more »Module:Sl-common
Senin, 2020-04-27 08:11:19local export = {} function export.has_accents(word) if mw.ustring.find(mw.ustring.lower(word), "[áéíóúŕàèìòùêô]") then return true else return false...
Click to read more »Module:Side box
Kamis, 2020-10-15 01:13:05args = {} for k, v in pairs(origArgs) do v = v:match('%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function...
Click to read more »Module:Autovirusbox
Minggu, 2022-10-23 22:24:37==================================== function p.main(frame) local args if frame.args['direct'] == 'yes' then args = frame.args else args = frame:getParent()...
Click to read more »Module:Weather box
Selasa, 2019-07-09 07:56:13stripToNil(text) -- If text is a non-empty string, return its trimmed content. -- Otherwise, return nothing (text is an empty string or is not a string). if type(text)...
Click to read more »Module:Message box
Selasa, 2025-07-15 09:49:30expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end local function union(t1, t2) -- Returns...
Click to read more »Module:Wikidata
Senin, 2020-09-28 23:19:08ret_lang, ret_icon = '', '' if icon then if lang and lang ~= uselang then ret_lang = " <sup>(" .. lang .. ")</sup>" end if label_id and (lang == nil...
Click to read more »Module:La-utilities
Senin, 2020-04-27 08:06:58function export.main(frame) if(frame.args[1] == 'strip_macrons') then return lang:makeEntryName(frame.args[2]) end if type(p[frame.args[1]]) == 'function'...
Click to read more »Module:Math
Sabtu, 2021-03-13 06:12:28throw an error if given an explicit nil parameter, so we need to use if statements to check the params. if first and second then if first <= second...
Click to read more »Module:PrevalenceData
Selasa, 2017-05-02 10:21:48prevalenceValue = prevalenceClaim.mainsnak.datavalue.value if prevalenceValue then if string.len( pRange ) > 0 then -- Split multiple claims...
Click to read more »Module:Category handler
Jumat, 2022-01-28 01:49:57trimWhitespace(s, removeBlanks) if type(s) ~= 'string' then return s end s = s:match('^%s*(.-)%s*$') if removeBlanks then if s ~= '' then return s...
Click to read more »Module:Collation
Senin, 2020-04-27 08:06:02"function" end local function check_lang_object(funcName, argIdx, lang) if not is_lang_object(lang) then error("bad argument #" .. argIdx .. " to "...
Click to read more »Module:Redirect
Jumat, 2022-01-28 01:50:33new, ...) if success then return titleObj else return nil end end -- Gets the name of a page that a redirect leads to, or nil if it isn't a --...
Click to read more »Module:UserLinks/shared
Senin, 2018-04-23 02:06:50load the module s. If it succeeds, returns the module; -- otherwise, returns false. local success, mdl = pcall(require, s) if success then return...
Click to read more »Module:Location map/info
Sabtu, 2021-03-13 06:12:27name .. '\n' .. [=[ |- ! name |colspan="3"| ]=] .. map.name .. [=[ |- ]=] if map.top then retval = retval .. [=[!rowspan="4"|border<br/>coordinates |-...
Click to read more »Module:Currency
Minggu, 2022-10-23 22:24:55code, linked) local symbol; local position = properties[code].position; if linked then symbol = string.format ('[[%s|%s]]', properties[code].page,...
Click to read more »Module:Pagelist
Sabtu, 2014-01-18 06:14:45the page -- specified, or nil if there are errors in the title, if the -- expensive function count has been exceeded, or if the page was not -- specified...
Click to read more »Module:Pagetype
Senin, 2018-04-23 02:43:31param) if param ~= false then -- No check if specifically disallowed. for _, alias in ipairs(aliasTable) do if class == alias then if type(param)...
Click to read more »Module:Hidden ping
Minggu, 2020-02-09 04:04:42{} local function makeError(msg, frame) -- Show error only in preview if (frame:preprocess( "{{REVISIONID}}" ) ~= "") then return '' end msg ='<strong>Error...
Click to read more »Module:Sh-headword
Senin, 2020-04-27 08:11:18require("Module:scripts").findBestScript(title.subpageText, lang) local other_sc if sc:getCode() == "Latn" then other_sc = "Cyrl" elseif sc:getCode() == "Cyrl"...
Click to read more »Module:Roman
Sabtu, 2019-07-13 05:38:20exit displaying nothing if the input is empty. if args[1] == nil then return end local num = tonumber(args[1]) if not num or num < 0 or num...
Click to read more »Module:Namespace detect
Senin, 2017-01-30 09:29:14The -- -- module can also use the corresponding subject namespace value if it is -- -- used on a talk page. Parameter names can be configured for...
Click to read more »Module:Aligned table
Selasa, 2019-12-17 10:43:56end -- add table classes if isnotempty(args['class']) then root:addClass(args['class']) end -- add table style if isnotempty(args['style']) then...
Click to read more »Module:College color
Minggu, 2018-03-25 06:17:17leading # (if there is one) c = mw.ustring.match(c, '^[#]*([a-f0-9]*)$') -- split into rgb local cs = mw.text.split(c or '', '') if( #cs == 6 )...
Click to read more »Module:Road data/util
Sabtu, 2023-07-29 07:08:20error is raised if `overwrite` is not true -- and any key in `arr` is already in `target`. function util.addAll(target, arr, overwrite) if type(target)...
Click to read more »Module:Routemap
Senin, 2018-05-07 01:03:44'">' if not t1 or string.find(t1, '^%s*$') then if not t2 then t2 = '' end if string.find(t2, '<br ?/?>') == nil then t1 = ' ' end end if not...
Click to read more »Module:Location map/multi
Minggu, 2022-10-23 22:20:53= {} if not args then args = getArgs(frame, {wrappers = 'Template:Location map+', valueFunc = locmap.valueFunc}) end if not map then if args[1]...
Click to read more »Module:Section link
Minggu, 2022-10-23 22:23:54MediaWiki doesn't allow these in `page`, so only need to do for `section` if type(section) == 'string' then section = string.gsub(section, "{", "{")...
Click to read more »Module:Japanese calendar
Rabu, 2017-04-26 05:45:37year = tonumber( year ) if type( year ) ~= 'number' then return end for i, t in ipairs( eras ) do if year > t.startYear then ...
Click to read more »Module:Table tools
Senin, 2020-04-27 08:11:22pairs(frame.args) do if val ~= "" then args[key] = val end end local i = 1 for _, val in ipairs(frame:getParent().args) do if val and val ~= ""...
Click to read more »Module:TaxonList
Senin, 2018-06-04 02:24:20taxon name with any † before it removed and either '†' if it was present or the empty string if not. =================================================...
Click to read more »Module:Clickable button 2
Selasa, 2017-01-31 05:51:01'Template:Clickable button 2' }) return p.luaMain(args) end function p.luaMain(args) if not args[1] and not args.url then return '' end local data = p.makeLinkData(args)...
Click to read more »Module:Wikidata/debug
Jumat, 2021-02-12 18:40:54getEntityObject(f.args.id) if not data then return end local i = 1 while true do local index = f.args[i] if not index then return...
Click to read more »Module:Gridiron color
Senin, 2019-11-04 13:49:54nil if ( team and use_default[team:lower()] ) then colors = unknown else if mw.ustring.find(team, "%d?%d?%d%dthru%d?%d?%d%d$") then if (not year...
Click to read more »Module:Weather box/colors
Selasa, 2019-07-09 07:53:33text_color .. ";" end local function range_pos( value, start, stop ) if start < stop then if value < start then return 0 elseif value > stop then return...
Click to read more »Module:Episode list
Minggu, 2015-11-08 07:52:44list(frame) return main(frame,false) end function main(frame, sublist) if not getArgs then getArgs = require('Module:Arguments').getArgs end local...
Click to read more »Module:Age
Kamis, 2018-05-31 13:57:06stripToNil(text) -- If text is a string, return its trimmed content, or nil if empty. -- Otherwise return text (which may, for example, be nil). if type(text)...
Click to read more »Module:Template link
Senin, 2020-04-27 08:11:22templ:match("^(.-):(.*)") if marker then local lcmarker = marker:lower() if parser_functions[lcmarker] then if parser_function_hooks[lcmarker]...
Click to read more »Module:Excerpt
Minggu, 2026-05-10 22:46:34if title.isRedirect then title = title.redirectTarget if fragment == "" then fragment = title.fragment -- page merge potential end end if...
Click to read more »Module:Gapnum
Rabu, 2016-04-13 03:24:20local p = {} local getArgs function p.main(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end local args = getArgs(frame...
Click to read more »Module:Multiple image
Sabtu, 2020-07-04 10:33:34''):match('^(.*)[Pp][Xx]%s*$') or s end local function getdimensions(s, w, h) if tonumber(w) and tonumber(h) then nonautoscaledimages = true return tonumber(w)...
Click to read more »Module:Ahnentafel
Selasa, 2018-05-15 02:47:36= -1,-1 -- tracking local tcats = '' local function checkparameters(k) if (k == 'align' or k == 'collapsed' or k == 'collapsible' or k == 'title'...
Click to read more »Module:Complex date
Senin, 2023-02-13 21:49:35math.max(#langList,2),'default') for i,language in ipairs(langList) do if list[language] then return list[language] end end end --...
Click to read more »Module:Ny-IPA
Senin, 2020-04-27 08:08:301) if (first == "ʰ") then ipa = "h"..mw.ustring.sub(ipa,2) end if (first == "ʲ") then ipa = "j"..mw.ustring.sub(ipa,2) end if (first...
Click to read more »Module:Language utilities
Senin, 2020-04-27 08:07:48function allows templates to access this data. -- Returns an empty string if the item does not exist. function export.lookup_language(frame) local...
Click to read more »Module:Taxonbar/candidate
Selasa, 2019-07-09 03:31:26check(frame) local taxonbarExists = require('Module:Taxonbar/exists').check if taxonbarExists(frame) then return '' else local resolveEntity = require(...
Click to read more »Module:ResolveEntityId
Selasa, 2019-07-09 04:21:09function p._id(id,alt) if type(id) == 'string' then id = mw.ustring.upper(mw.ustring.sub(id,1,1))..mw.ustring.sub(id,2) if mw.ustring.match(id,'^Q%d+$')...
Click to read more »Module:Autotaxobox
Minggu, 2022-10-23 22:21:34is assumed that a valid taxobox colour is defined using CSS rgb() syntax. If no taxon that sets a taxobox colour is found, then 'transparent' is returned...
Click to read more »Module:Transcluder
Jumat, 2026-02-06 21:33:43values -- @todo Somehow internationalize it local function truthy(value) if not value or value == '' or value == 0 or value == '0' or value == 'false'...
Click to read more »Module:Families/templates
Senin, 2020-04-27 08:06:26module invocation.") fam = require("Module:families").getByCode(fam) if fam then return "1" else return "" end end function export.getByCode(frame)...
Click to read more »Module:Etymology languages/templates
Senin, 2020-04-27 08:06:22etymlang = require("Module:etymology languages").getByCode(etymlang) if etymlang then return "1" else return "" end end function export.getByCode(frame)...
Click to read more »Module:Webarchive
Minggu, 2022-10-23 22:20:36function make_wikilink (link, display, no_link) if nil == no_link then if link and ('' ~= link) then if display and ('' ~= display) then return table...
Click to read more »Module:Catalog lookup link
Minggu, 2022-10-23 22:22:13listed. Whitespace is trimmed off both ends and the strings are urlencoded as if they were query strings. |article-link=: Optional Wikipedia article name to...
Click to read more »Module:ExistNotRedirect
Jumat, 2020-02-07 05:38:39myArgs[1] if (myPageName == nil) or (myPageName == "") then return "" end local mypageTitle = mw.title.makeTitle("", myPageName) if mypageTitle...
Click to read more »Module:Gallery
Selasa, 2019-12-17 11:36:57local tracking, preview local function checkarg(k,v) if k and type(k) == 'string' then if k == 'align' or k == 'state' or k == 'style' or k == 'title'...
Click to read more »Module:Protect
Kamis, 2019-02-28 03:00:53processResult(options, success, ...) if not success then local message = tostring(... or '(no message)') if options.removeLocation then message...
Click to read more »Module:R:The Bokmål and Nynorsk dictionaries
Senin, 2020-04-27 08:05:54= frame:getParent().args if args['lang'] then lang = args['lang'] else lang = 'no' end if lang == 'nb' then specifier...
Click to read more »Module:BaseConvert
Rabu, 2013-07-03 09:32:39from = tonumber(from) if not from or from < 34 then local c n, c = n:gsub('^(-?)0[Xx]', '%1') if c > 0 and not from then from...
Click to read more »Module:Asbox stubtree
Jumat, 2014-01-10 07:47:15if #t == 0 then temppage = removeditem1 .. "-stub" end temppageexists = i.exists(temppage) if temppageexists...
Click to read more »Module:Infobox/dates
Jumat, 2018-05-04 01:13:39dates(frame) local returnval; local args = getArgs(frame); if table.getn(args) < 2 then if args['1'] == nil and args['2'] == nil then return ''; ...
Click to read more »Module:ParameterCount
Sabtu, 2017-03-11 00:57:17positional key, and if so, returns it. If -- the key is invalid, this returns nil. local function isPositionalKey(s) s = trim(s) if s:find('^[1-9][0-9]*$')...
Click to read more »Module:Gaps
Sabtu, 2017-09-02 03:19:20local p = {} local getArgs function p.main(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end local args = getArgs(frame...
Click to read more »Module:AFC submission catcheck
Kamis, 2017-04-27 09:05:59local p = {} local function removeFalsePositives(str) if not str then return '' end return mw.ustring.gsub(mw.ustring.gsub(str, "<!--.--->", "")...
Click to read more »Module:Sorted plain list
Senin, 2018-04-23 13:36:14if entity and entity.claims then claims = entity.claims[propertyID] end if claims then -- if wiki-linked value output as link if possible if (claims[1]...
Click to read more »Module:Series overview
Minggu, 2022-10-23 22:22:39then regular season if entry.startA then if not entry[key..'A'] then spanlength = spanlength + 1 else break end if not entry[key..'B'] then...
Click to read more »Module:Fi-nominals
Senin, 2020-04-27 08:06:26Postprocess postprocess(args, data) if args["nocheck"] then table.insert(data.categories, "fi-decl with nocheck") end if args["nosg"] then table.insert(data...
Click to read more »Module:Ja/k2r-old
Senin, 2020-04-27 08:06:50loadData("Module:ja/data") function export.kana_to_romaji(text, nodiacr, keepdot) if type(text) == "table" then -- assume a frame. text, nodiacr = text.args[1]...
Click to read more »Module:Iucn
Minggu, 2022-10-23 22:24:46url_assesment_ID local msg if args.doi then doi_taxon_ID, doi_assesment_ID = args.doi:match ('[Tt](%d+)[Aa](%d+)%.en$') if not doi_taxon_ID then ...
Click to read more »Module:WikidataCheck
Senin, 2015-03-02 22:04:48check if we're in a good namespace local ns = mw.title.getCurrentTitle().namespace for v in mw.text.gsplit( namespaces, ",", true) do if tonumber(v)...
Click to read more »Module:Unicode data/control
Senin, 2025-07-28 22:41:41index, cols in ipairs(data.data) do if cols[1] and cols[2] then first_char=string.sub(cols[2], 1, 1) if first_char == "C" or first_char == "Z"...
Click to read more »Module:Biota infobox/param
Minggu, 2022-10-23 22:23:18if type(k)=='string' then local j,n = string.gsub(k, " ", "_") -- substitute spaces if n > 0 then --if j ~= k then -- if substitution...
Click to read more »Module:Effective protection level
Kamis, 2022-01-20 20:04:00given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename)...
Click to read more »Module:Greek
Kamis, 2018-02-22 07:38:55-- check if thousand marker exists if letter == "," then thousand_flag = true else if thousand_flag ==...
Click to read more »Module:URL
Kamis, 2020-10-15 01:13:07msg == 'false' -- boolean: true if msg is "false" or starts with n or N if url == '' then if text == '' then if nomsg then return nil else...
Click to read more »Module:TeamBracket
Jumat, 2017-04-07 04:43:23local max = math.pow(2, r) for i = 1, count do local pos = i * 2 if before then pos = pos - 1 end table.insert(seeds, pos, max - seeds[i *...
Click to read more »Module:Transclusion count
Kamis, 2022-12-29 06:19:21Use demo parameter if it exists, otherswise use current template name local namespace = mw.title.getCurrentTitle().namespace if frame.args["demo"] and...
Click to read more »Module:EditAtWikidata
Sabtu, 2017-03-11 01:25:25entry for the article where this is placed. -- This message is only displayed if a local_parameter is not supplied -- i.e. when called from a template, it...
Click to read more »Module:Automated taxobox
Minggu, 2022-10-23 22:23:22end -- set the taxobox name if not supplied, italicizing it if appropriate. if name == '' then name = basePagename if italicTitle == 'yes' then ...
Click to read more »Module:Nl-adjectives
Senin, 2020-04-27 08:08:27if pred_pos == "-" then pred_pos = nil else pred_pos = pred_pos or base end infl_pos = infl_pos or export.make_inflected(base) if...
Click to read more »Module:TeamBracket-Tennis
Selasa, 2017-07-11 06:38:18== 1) and pargs or fargs for k,v in pairs(targs) do if type(k) == 'string' then if k:find('^[R3][Dr][d1-9]b?%-[a-z][a-z]*00*') then k =...
Click to read more »Module:Infobox mapframe
Senin, 2019-06-24 02:56:28for key, val in pairs(argsTable) do if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val ~= '' then cleanArgs[key] = val...
Click to read more »Module:Portal bar
Minggu, 2022-10-23 22:19:57bar}}. function p._main( portals, args ) if #portals < 1 then return '' end -- Don't display a blank navbox if no portals were specified. local list =...
Click to read more »Module:Ugly hacks
Senin, 2020-04-27 08:11:25= 1 for item in mw.text.gsplit(frame.args[1], frame.args[2], true) do if count == wanted_index then return item end count = count + 1 end...
Click to read more »Module:El-translit
Senin, 2020-04-27 08:06:09["Ώ"] = "Ó" } -- transliterates any words or phrases function M.tr(text) if type(text) == 'table' then text = text.args[1] end local gsub = mw.ustring...
Click to read more »Module:Exponential search
Kamis, 2020-10-15 11:08:50search(testFunc, i, lower, upper) if testFunc(i) then if i + 1 == upper then return i end lower = i if upper then i = midPoint(lower, upper)...
Click to read more »Module:Unbulleted list
Minggu, 2014-01-12 07:53:48function getListItem( data, style, itemStyle ) if not data then return nil end if style or itemStyle then style = style or ''...
Click to read more »Module:Roa-jer-headword
Senin, 2020-04-27 08:11:09PAGENAME = mw.title.getCurrentTitle().text local head = args["head"]; if head == "" then head = nil end -- The part of speech. This is also...
Click to read more »Module:Jct
Selasa, 2019-12-17 10:58:55args.province or '' local type = args.type if rdt then return 'x17' elseif state == 'FL' then if type == 'Toll' or type == 'FLTP' or type == 'HEFT'...
Click to read more »Module:Km-translit
Senin, 2020-04-27 08:06:51char_type[c[i]] end for i = 1, #c + 1 do local next_types = {} if i == #c + 1 or chartype[i] == 'ZWS' then progress = 'none' table.insert(syl...
Click to read more »Module:Effective protection expiry
Kamis, 2022-12-29 06:19:19expiry of a restriction of an action on a given title, or unknown if it cannot be known. -- If no title is specified, the title of the page being displayed...
Click to read more »Module:Ancient Olympiads
Selasa, 2019-12-17 10:44:28) -- Convert the input to an integer if possible. Return "N/A" if the input could -- not be converted, or if the converted input is too big or too small...
Click to read more »Module:Current events calendar
Sabtu, 2014-06-07 19:43:18[[Portal:Current events]]. local p = {} local function makeWikilink(link, display) if display then return string.format('[[%s|%s]]', link, display) else return...
Click to read more »Module:Color contrast
Jumat, 2022-01-28 01:49:59(v) if (v <= 0.03928) then v = v / 12.92 else v = math.pow((v+0.055)/1.055, 2.4) end return v end local function rgbdec2lum(R, G, B) if ( 0 <=...
Click to read more »Module:Navbox
Jumat, 2022-01-28 01:50:22= cfg.class.navbox_odd_part, cfg.class.navbox_even_part if args[cfg.arg.evenodd] then if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then ...
Click to read more »Module:WikidataIdentifiers
Senin, 2017-12-18 01:54:39qid = frame.args.qid if qid and (#qid == 0) then qid = nil end local entity = mw.wikibase.getEntityObject(qid) local props if entity and entity.claims...
Click to read more »Module:Respell
Rabu, 2017-11-01 10:52:06if v and v ~= '' and v ~= "'" then hasUnsc[i] = mw.ustring.find(v, '_') if hasUnsc[i] then v = mw.ustring.gsub(v, '_', ' ') else if mw...
Click to read more »Module:Unicode data/category
Senin, 2025-07-28 23:04:52tab") for index, cols in ipairs(data.data) do if cols[1] and cols[2] then if cols[2] ~= "Cn" then result.singles[tonumber(cols[1],...
Click to read more »Module:Preview warning
Senin, 2018-06-04 02:53:33local p = {} --[[ main This function returns parameter 1 as a warning if the page containing it is being previewed. Usage: {{#invoke:Preview...
Click to read more »Module:Team bracket tracking
Senin, 2018-05-07 05:47:16frame:getParent().args for k, v in pairs(args) do if tostring(k):match('%-team[0-9]') then if tostring(v):match('[Bb][Rr][^<>]*>[%s]*.[Nn][Bb][Ss][Pp]')...
Click to read more »Module:Sidebar
Minggu, 2022-10-23 22:19:53collapsible lists}} -- implementation, which passed some parameters through {{#if}} to trim -- their whitespace. This also triggered the automatic newline...
Click to read more »Module:Citation/CS1/Utilities
Kamis, 2020-10-15 01:12:54]] local function has_accept_as_written (str, allow_empty) local count; if true == allow_empty then str, count = str:gsub ('^%(%((.*)%)%)$', '%1');...
Click to read more »Module:Senseid
Senin, 2020-04-27 08:11:17return mw.ustring.match(id, "Q%d+") end function export.anchor(lang, id) if not (type(id) == "string" or type(id) == "number") then error("The second...
Click to read more »Module:List
Jumat, 2019-12-20 08:40:54passed to p.renderList. local data = {} -- Classes data.classes = {} if listType == 'horizontal' or listType == 'horizontal_ordered' then table...
Click to read more »Module:IrelandBiCoontyCatNav
Sabtu, 2018-05-12 23:09:26blueLinkCount = blueLinkCount - 1 if greyLinkCount == 0 then return "[[Category:" .. templateName .. " wi nae gray airtins]]" end if blueLinkCount == 0 then...
Click to read more »Module:Uses TemplateStyles
Jumat, 2019-12-20 08:40:54args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function...
Click to read more »Module:Flagg
Selasa, 2019-12-17 11:28:00value) if value then value = mw.text.trim(value) --Change empty string to nil for all args except 'image' and 'border' if key=="image"...
Click to read more »Module:Easter
Selasa, 2019-12-17 11:29:01loadEasterYear(year) if not year then return false, formatEasterError(EasterData.errorMissingYear) end local result = tonumber(year) if not result...
Click to read more »Module:Pop density
Selasa, 2019-12-17 10:57:56unsupported units]]' if(pop ~= '' and area1 ~= '') then -- pop and area are defined local popnum = tonumber(pop) if not popnum then error(string...
Click to read more »Module:Mapframe
Rabu, 2020-07-08 09:38:43parameter value if found, or nil if not found ]]-- function util.getParameterValue(args, param_id, suffix) suffix = suffix or '' if type( L10n.para[param_id]...
Click to read more »Module:TaxonItalics
Jumat, 2019-11-22 02:34:59algorithm used is: * If the name has italic markup at the start or the end, do nothing. * Else * Remove (internal) italic markup. * If the name is made...
Click to read more »Module:Year in various calendars
Senin, 2018-05-07 13:11:31-- Checks if a value is an integer. If so, returns the value converted to a number. -- If not, returns false. num = tonumber( num ) if num and math...
Click to read more »Module:Et-nominals
Senin, 2020-04-27 08:06:16Postprocess postprocess(args, data) if args["nosg"] then table.insert(data.categories, "et-decl with nosg") end if args["nopl"] then table.insert(data...
Click to read more »Module:A or an
Selasa, 2019-02-26 08:17:37if find(s, '^' .. v .. '$') then return true end end end function p._main(args) local s = args[1] local pron = 'a' local ret = '' if s...
Click to read more »Module:Navseasoncats/navyear
Kamis, 2020-01-02 12:30:07category, if it exists -- If it doesn't exist, just display the greyed unlinked title function makeCatLink(catname, disp) local displaytext = catname if disp...
Click to read more »Module:Sortkey
Selasa, 2019-12-24 08:10:10sortkey nesting. -- Example: {{sort|{{dts|2013|07|07}}|{{dts|1990|12|01}}}} if string.find(sortkey, "sortkey") or string.find(sortkey, "data-sort-value")...
Click to read more »Module:FindYDCportal
Kamis, 2020-01-02 12:30:41either a year (e.g. "1879", "1123") or a decade (e.g. "1940s", "790s"). If a portal is found, return its name without the namespace prefix (e.g. for...
Click to read more »Module:Navbar
Jumat, 2022-01-28 01:50:11get_title_arg(is_collapsible, template) local title_arg = 1 if is_collapsible then title_arg = 2 end if template then title_arg = 'template' end return title_arg...
Click to read more »Module:AfC
Kamis, 2013-08-15 06:49:02title, short) cols[2] = size if display_notes then cols[3] = p.notes(frame) else cols[3] = "" end if special_id then cols[4] = p...
Click to read more »Module:Infobox road/length
Rabu, 2018-03-07 15:11:00tonumber(args["length_round" .. num]) if '' == km then local n = tonumber(mi) prec = prec or precision(mi) if n then lengths...
Click to read more »Module:Team roster navbox
Senin, 2018-07-09 01:10:08require('Module:Navbox') local function colorlinks(v, s) if v and v ~= '' and s and s ~= '' then if not mw.ustring.match(v, '<span style') then v = mw...
Click to read more »Module:Requested move
Kamis, 2023-11-23 17:20:00paramNum) -- Validates a page name, and if it is valid, returns true and the title -- object for that page. If it is not valid, returns false and the...
Click to read more »Module:Sports table/WDL
Senin, 2018-06-25 09:03:50local sort_text = '' local sort_table_val = Args['sortable_table'] or 'no' if yesno(sort_table_val) then sort_text = 'sortable' end local rounds_won =...
Click to read more »Module:Multiple releases
Minggu, 2017-04-09 02:29:38KeepCheckingForArgs = false if a > 1 then IsEmpty = false end end a = a + 1 end if IsEmpty == false then return...
Click to read more »Module:Hatnote
Sabtu, 2020-10-03 05:17:02'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local...
Click to read more »Module:Portal
Jumat, 2019-12-20 08:40:54if (string.match(thisPageLC, "/archive") ~= nil) then return false end if (string.match(thisPageLC, "/doc") ~= nil) then return false end if (string...
Click to read more »Module:Shortcut
Jumat, 2022-01-28 01:50:37local templatePath, prefix if templateMode then -- Namespace detection local titleObj = mw.title.new(shortcut, 10) if titleObj.namespace == 10...
Click to read more »Module:Infobox gene
Minggu, 2018-06-03 13:56:15--local u= table.upack(args) local exist, val = pcall(f, unpack(args)) if exist and val ~= nil then return(val) else -- Leaking some debugging...
Click to read more »Module:Citation/CS1/Identifiers
Kamis, 2020-10-15 01:12:54todays_date = lang:formatDate ('U'); if good1 then -- if embargo date is a good date if tonumber (embargo_date) >= tonumber (todays_date)...
Click to read more »Module:Football box collapsible teamname
Rabu, 2018-04-11 09:05:21local suffix = ""; local team = frame.args["team"] or ""; if mw.ustring.sub(team,1,3) ~= "'''" and mw.ustring.sub(team,-3) ~= "'''" then...
Click to read more »Module:ISOdate
Senin, 2023-02-13 21:54:31_ISOyear( input ) if not input then return '' end input = mw.text.trim( input ) -- if empty string then return it if input == "" then return...
Click to read more »Module:Infobox road/locations
Rabu, 2018-03-07 15:11:22"no", default = "yes"} local yesOrNo = data[country] or data.default if yesOrNo == "no" then return args.countries else return...
Click to read more »Module:R:M&A
Senin, 2020-04-27 08:05:51exported function `phrasebook' retrieves the calling template's argument or, if none exists, the calling page's name, and passes this into the table found...
Click to read more »Module:I18n
Jumat, 2018-01-12 09:17:080 local function tableMerge(t1, t2, overwrite) for k,v in pairs(t2) do if type(v) == "table" and type(t1[k]) == "table" then -- since type(t1[k])...
Click to read more »Module:Infobox3cols
Selasa, 2016-08-23 00:02:58of the arguments that exist -- for the specified prefix. For example, if the prefix was 'data', and -- 'data1', 'data2', and 'data5' exist, it...
Click to read more »Module:Offeecial wabsteid
Selasa, 2020-01-28 07:13:40failure. local function quickPcall(func) local success, result = pcall(func) if success then return result end end -- Gets the rank for a Wikidata property...
Click to read more »Module:WikitextParser
Rabu, 2026-02-11 21:55:10Wikitext to parse. -- @return Wikitext of the lead section. May be empty if the lead section is empty. function parser.getLead( wikitext ) wikitext =...
Click to read more »Module:Sports table/sub
Senin, 2018-06-25 09:04:19colhead(ttt,width,text) -- For individual column headers local head_string if width=='auto' then head_string = '! scope="col" |'..text..'\n' else head_string...
Click to read more »Module:Ancient Egypt kings
Rabu, 2017-04-26 05:40:24) -- Convert the input to an integer if possible. Return "N/A" if the input could -- not be converted, or if the converted input is too big or too small...
Click to read more »Module:Ancient Egypt era
Rabu, 2017-04-26 05:38:25) -- Convert the input to an integer if possible. Return "N/A" if the input could -- not be converted, or if the converted input is too big or too small...
Click to read more »Module:Xpsoc
Rabu, 2017-04-19 08:45:54args[1] if not name then error('no template name passed to xpsoc', 2) end local invArgs = {} for k, v in pairs(args) do if k ~= 1 then if type(k)...
Click to read more »Module:Ru-pron
Senin, 2020-04-27 08:11:12this also in VCʲj and V‿Cʲj and VCj and V‿Cj sequences; ask Cinemantique if this makes sense. 4. (DONE, CINEMANTIQUE OK WITH FIXES) Fix non-palatal е...
Click to read more »Module:Infobox military conflict
Minggu, 2022-10-23 22:22:29only time colspans[1] wouldn't be set is if no -- combatant has a field with the given prefix and suffix. if colspans[1] then -- Since each found argument...
Click to read more »Module:Infobox road/map
Rabu, 2018-03-07 15:11:36map = args.map or '' if args.map_custom == "yes" then return format('<span style="white-space:nowrap;">%s</span>', map) end if map == '' then local...
Click to read more »Module:Language/text
Senin, 2019-12-23 08:14:09language code. If no name can be -- found, returns nil. if not code then return nil end local name = mLanguageName.fuzzy{code = code} if name and name...
Click to read more »Module:Citation/CS1/Date validation
Kamis, 2020-10-15 01:12:54C C E S S D A T E >---------------------------------------- returns true if: Wikipedia start date <= accessdate < today + 2 days Wikipedia start date...
Click to read more »Module:Qualifier/subvarieties
Senin, 2020-04-27 08:11:07local labels = {} for key, val in pairs(m_subvarieties.labels) do if val.languages then labels[key] = val end end return labels...
Click to read more »Module:Rhymes
Senin, 2023-03-27 01:39:17= {} local function tag_rhyme(rhyme, lang) local formatted_rhyme, cat if lang:getCode() == "te" then formatted_rhyme = require("Module:script utilities")...
Click to read more »Module:Error
Selasa, 2015-08-11 08:39:09lower(tostring(args.tag)) -- Work out what html tag we should use. if not (tag == 'p' or tag == 'span' or tag == 'div') then tag = 'strong'...
Click to read more »Module:Singles
Selasa, 2017-08-01 01:14:37of the arguments that exist -- for the specified prefix. For example, if the prefix were to be 'data', and -- 'data1', 'data2', and 'data5' were...
Click to read more »Module:SDcat
Kamis, 2022-12-29 06:19:19associated qid of the current article if omitted) and the local short description passed as |sd= It returns a category if there is an associated Wikidata entity...
Click to read more »Module:Nl-adjective
Senin, 2020-04-27 08:08:26[[User:MewBot]] uses this module to automatically create entries for adjective forms. If you change how this module works, please notify the bot owner so the bot...
Click to read more »Module:File link
Kamis, 2022-01-20 20:04:00ret[#ret + 1] = 'File:' .. args.file -- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile'...
Click to read more »Module:Football manager history
Senin, 2017-10-09 10:21:55Return text, if not empty, after trimming leading/trailing whitespace. -- Otherwise return default which is nil unless set by caller. if text then ...
Click to read more »Module:Biota infobox
Minggu, 2022-10-23 22:23:26subspecies3 = "", "", "" --if (templateArgs['subspecies1'] and templateArgs['subspecies2']) if templateArgs['subspecies1'] or...
Click to read more »Module:Protection banner
Rabu, 2026-02-18 15:57:12dateType) if not lang then lang = mw.language.getContentLanguage() end local success, result = pcall(lang.formatDate, lang, 'U', dateString) if success...
Click to read more »Module:Parameter names example
Rabu, 2018-02-14 05:59:59local template if args._template then template = args._template else local currentTitle = mw.title.getCurrentTitle() if currentTitle...
Click to read more »Module:Br separated entries
Jumat, 2014-01-10 04:25:23v ) if mw.ustring.match( v, '%S' ) then table.insert( t, sep ) lastsep = #t end end if lastsep then ...
Click to read more »Module:Geobox map
Rabu, 2017-04-26 02:13:40100 end local function aspect_ratio(s) local f = mw.title.new(s).file if f ~= nil and f ~= false then return f['width'] / f['height'] else return...
Click to read more »Module:Buffer
Kamis, 2018-02-22 08:52:47=============================--]] local function Valid(v)--type validation if v and v~=true then--reject nil/boolean; faster than 2 type() comparisons ...
Click to read more »Module:Str endswith
Sabtu, 2018-02-17 14:52:05args = frame:getParent().args local s = args[1] local pattern = args[2] if not s or not pattern then -- TRUE_STRING is not the natural choice here...
Click to read more »Module:Ns has subpages
Jumat, 2017-03-10 05:05:59function p._main(ns, frame) -- Get the current namespace if we were not passed one. if not ns then ns = mw.title.getCurrentTitle().namespace end...
Click to read more »Module:ParseVauthors
Sabtu, 2017-10-21 11:33:23vauthors local authorTable local lastfirstTable local nauthors if vauthors then if string.find(vauthors, ';') or string.find(vauthors, '%.') then ...
Click to read more »Module:Hatnote list
Sabtu, 2020-10-03 05:14:07do if options[k] == nil then options[k] = v end end local s = options.space -- Format the list if requested if options.formatted then...
Click to read more »Module:Ofs-decl-noun
Senin, 2020-04-27 08:08:32"s"} data.forms["dat_sg"] = {args.pal or (args[2] or (args[1] .. "e"))} if not args.nopl then data.forms["nom_pl"] = {a2 .. "ar", a2 .. "a"} data...
Click to read more »Module:RoundN
Rabu, 2018-06-27 12:32:48'#C96', '#f9f9f9'}, reuseStr = {}, saveStr = function(self, name, ...) if not self.reuseStr[name] then self.reuseStr[name] = table.concat{...} ...
Click to read more »Module:Biota infobox/core
Minggu, 2022-10-23 22:23:15taxoboxTable, target, headerText) local wikiText = "" -- return if we don't have value if not templateArgs[target] or templateArgs[target] == '' then return...
Click to read more »Module:Vi-pron
Senin, 2020-04-27 08:11:33end if loc == "hcmc" then if initial == "-" then nucleus = gsub(nucleus, "^u", "w") end if hcmc_opt_w[initial]...
Click to read more »Module:TNT
Minggu, 2025-12-28 01:06:08ipairs(names) do if columnName == 'name' then name = row[pos] else newVal[columnName] = row[pos] end end if name then if ( (type(name)...
Click to read more »Module:Random
Kamis, 2014-06-05 20:18:52---------------------------------------------------- -- Set this to true if your wiki has a traffic rate of less than one edit every two minutes or so...
Click to read more »Module:WPSHIPS utilities
Minggu, 2022-10-23 22:24:15(frag, frag_len) local nat = ''; if not nationality_list [frag[1]] then -- if not a one-word nationality if 2 <= frag_len - 2 then ...
Click to read more »Module:Ancient Greek
Kamis, 2018-07-26 11:36:54shared among different characters so that they can be checked -- for equality if needed, and to use less space. local vowel = { vowel = true, diacritic_seat...
Click to read more »Module:Zh-hanzi-box
Senin, 2020-04-27 08:11:35optional. -- The first parameter represents the simplified form of an entry. If the characters are the same in both scripts, then only the first parameter...
Click to read more »Module:Check bibcode
Minggu, 2022-10-23 22:24:01year; if 19 ~= id:len() then err_type = 'length'; else year = id:match ("^(%d%d%d%d)[%a][%a&%.][%a&%.%d][%a&%.%d][%a%d%.]+[%a%.]$") -- if not year...
Click to read more »Module:Redirect hatnote
Sabtu, 2017-10-28 02:50:21= {} for i = 1, numRedirects do -- Return an error if a redirect parameter is missing. if not args[i] then return mHatnote.makeWikitextError(...
Click to read more »Module:WDL
Minggu, 2022-10-23 22:23:58played, won, drawn, lost, category) if played == '-' or played == '—' then return '—' elseif not played then if not won and not drawn and not lost...
Click to read more »Module:Internet Archive
Sabtu, 2017-03-11 01:36:36sopt) if sopt then sopt = mw.ustring.lower(sopt) if sopt == "tight" then sopt = "t" end if sopt == "tightx" then sopt = "tx" end if sopt...
Click to read more »Module:Io-IPA
Senin, 2020-04-27 08:06:46{} function export.show(word,alternative,do_debug) local debug = {} if type(word) == 'table' then do_debug = word.args[4] word = word.args[1]...
Click to read more »Module:Language
Minggu, 2022-10-23 22:24:19gsub(word, "\'\'", "") if data == nil then return word else local replacements = data and data["replacements"] if replacements == nil then...
Click to read more »Module:Usex/templates
Minggu, 2020-11-01 13:04:57"") ~= "" local template_inline = (frame.args["inline"] or "") ~= "" if compat then params["lang"] = {required = true} params["t"].alias_of =...
Click to read more »Module:Infobox road/route
Sabtu, 2023-07-29 07:08:52parser local function banner(args, style) if args.marker_image then return nil end local bannerSize if style == 'small' then bannerSize = "40px"...
Click to read more »Module:IPAc-en/data
Rabu, 2016-06-22 00:49:56k, v in pairs(old) do if k ~= 'aliases' and k ~= 'code' then new[k] = v end end newData[old.code] = new if old.aliases then for i...
Click to read more »Module:IPAc-ro/data
Minggu, 2018-01-21 03:19:11k, v in pairs(old) do if k ~= 'aliases' and k ~= 'code' then new[k] = v end end newData[old.code] = new if old.aliases then for i...
Click to read more »Module:Track listing
Jumat, 2018-02-23 01:30:22class. local function addMixin(class, mixin) for k, v in pairs(mixin) do if k ~= 'init' then class[k] = v end end end ------------------------...
Click to read more »Module:NumberSpell
Selasa, 2016-06-21 23:51:37local num = tonumber(args[1]) local success, result = pcall(p._main, num) if success then return result else return string.format('<strong class="error">Error:...
Click to read more »Module:Infobox road
Sabtu, 2023-07-29 07:07:52function p.headerStyle(frame) local args = getArgs(frame) local header if args.header_type == nil then header = args.header_type else header...
Click to read more »Module:TableTools
Kamis, 2020-10-15 01:13:05isPositiveInteger -- -- This function returns true if the given value is a positive integer, and false -- if not. Although it doesn't operate on tables, it...
Click to read more »Module:Qualifier
Minggu, 2023-03-05 23:45:44= {} function export.format_qualifier(list) if type(list) ~= "table" then list = { list } end if #list == 0 then return '' end return '<span...
Click to read more »Module:Vep-nominals
Senin, 2020-04-27 08:11:32n = args["n"]; if data.n == "" then data.n = nil end -- Generate the forms inflections[infl_type](args, data) -- Postprocess if infl_type ~= "ppron"...
Click to read more »Module:Wikibase
Jumat, 2023-06-16 01:29:06the entity ID of the item linked to the current page. function p.id(frame) if not mw.wikibase then return "no mw.wikibase" end return mw.wikibase...
Click to read more »Module:Template:attention
Senin, 2020-04-27 08:05:56local p = {} function p.main(frame) if frame.args[1] == 'html_encode' then return p.html_encode(frame.args[2]) else error('Unrecognized command')...
Click to read more »Module:La-noun/data
Senin, 2020-04-27 08:06:56forms["abl_pl"] = stem .. "īs" data.forms["voc_pl"] = stem .. "ae" -- abus if data.types.abus then table.insert(data.subtitles, {"dative/ablative plural...
Click to read more »Module:CallAssert
Sabtu, 2019-02-16 06:43:05result[i] = func(array[i]) end return result end local function quote(value) if type(value) == 'string' then return (string.gsub(string.format('%q', value)...
Click to read more »Module:Clade
Minggu, 2022-10-23 22:21:39"" then -- if using a newick string instead of a clade structure newickString = p.processNewickString(newickString,childNumber) if nodeLabel ==...
Click to read more »Module:Redirect-distinguish
Selasa, 2017-04-11 07:57:03p._redirectDistinguish(args) end function p._redirectDistinguish(args) if not args[1] then return mHatnote.makeWikitextError( 'no redirect supplied'...
Click to read more »Module:Subject bar
Selasa, 2019-12-17 11:18:44numbers of the arguments that exist for the specified prefix. For example, if the -- prefix was 'data', and 'data1', 'data2', and 'data5' exist, it...
Click to read more »Module:Category handler/shared
Jumat, 2022-01-28 01:49:58in ipairs(blacklist) do local match = mw.ustring.match(page, pattern) if match then return true end end return false end function p...
Click to read more »Module:SDcat/doc
Kamis, 2022-12-29 06:19:21associated qid of the current article if omitted) and the local short description passed as |sd= It returns a category if there is an associated Wikidata entity...
Click to read more »Module:CountryData
Kamis, 2017-04-20 12:28:47a Lua table --If not a valid data template, return empty table local bool, s = pcall(getcontents,frame,country,params or {}) if bool and string...
Click to read more »Module:Ar-translit
Senin, 2020-04-27 08:05:58always be preceded by fatḥa, alif, alif madda or -- dagger alif; infer fatḥa if not {"([^" .. fatHa .. alif .. alif_madda .. dagger_alif .. "])" .. taa_marbuuTa...
Click to read more »Module:Main
Selasa, 2018-05-15 01:35:10main article or articles. It implements the -- template {{main}}. -- -- If the module is used in category or category talk space, it produces "The --...
Click to read more »Module:Unicode data/aliases
Sabtu, 2025-07-26 22:17:33in ipairs(data.data) do if cols[1] and cols[2] and cols[3] and cols[4] then code_point=tonumber("0x"..cols[1]) if cols[2] == 1 then result[code_point]={}...
Click to read more »Module:Es-pronunc
Senin, 2020-04-27 08:06:15function export.show(word,LatinAmerica,phonetic,do_debug) local debug = {} if type(word) == 'table' then do_debug = word.args[4] word = word.args[1]...
Click to read more »Module:Es-conj/data/entry data
Senin, 2020-04-27 08:06:13insert(result, 'ending='..ending) if form_param_table.mood then table.insert(result, 'mood='..form_param_table.mood) end if form_param_table.tense then...
Click to read more »Module:Italic title
Minggu, 2022-10-23 22:20:41the key up in. local function checkKey(name, argId, key, lookupTable) if not lookupTable[key] then error(string.format( "bad argument #%d...
Click to read more »Module:TeamBracket-Compact-Tennis
Jumat, 2015-05-22 23:59:42addBlank(rows[index]):css('border-color', 'black') if left and round == 1 then return nil else if left or round < rounds and not left then cell:css(prop...
Click to read more »Module:Syllables
Senin, 2020-04-27 08:11:21. "ᵻ" .. "ᵿ" local U = mw.ustring.char --[[ Add diphthongs to the list if they do not contain semivowel symbols: /j w ɰ ɥ/. Do not include non-syllabic...
Click to read more »Module:DateI18n
Senin, 2023-02-13 21:58:15local function yesno(val, default) if type(val) == 'boolean' then return val elseif type(val) == 'number' then if val==1 then return true elseif...
Click to read more »Module:Footnotes
Selasa, 2018-06-05 09:25:12P2 = "", P3 = "", P4 = "", P5 = "" } }; function trim( str ) if str == nil then return nil; end return str:match( "^%s*(.-)%s*$"); end...
Click to read more »Module:Language/scripts
Minggu, 2017-05-28 21:17:18end function p.isLatn(text) if type(tostring(text)) == "string" then local count = countCharacters(text, "Latn") if count < (length(text) / 4) then...
Click to read more »Module:Purge
Selasa, 2016-07-26 16:06:46-- Make the URL local url do local title if args.page then title = mw.title.new(args.page) if not title then error(string.format( "'%s'...
Click to read more »Module:Citation
Jumat, 2014-04-18 20:48:59syntaxhighlight = true, timeline = true, } } function trim( str ) if str == nil then return nil; end return str:match( "^%s*(.-)%s*$"...
Click to read more »Module:Infobox multi-lingual name
Minggu, 2022-10-23 22:22:35>------------------------------------------------------------------ Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil)...
Click to read more »Module:Pl-adj
Senin, 2020-04-27 08:11:04+)([os])n)[yae]$"] = function (pargs, stem, substem, extra) local mpl_suffix if stem:match("zielon$") or stem:match("czerwon$") or stem:match("słon$") then...
Click to read more »Module:Navbox with striping
Selasa, 2016-06-28 08:15:59local t = {} for k,v in pairs(args) do if type(k) == 'string' and k:match('^list[0-9][0-9]*$') then if( v and v ~= '') then listcount = listcount...
Click to read more »Module:Baseball color
Jumat, 2018-02-23 05:07:56= 1, ["retired"] = 1, ["free agent"] = 1, } local colors = nil if ( team and use_default[team:lower()] ) then colors = {"DCDCDC", "000000"...
Click to read more »Module:Citation/CS1/COinS
Kamis, 2020-10-15 01:12:53script) if is_set (title) then title = strip_apostrophe_markup (title); -- strip any apostrophe markup else title=''; -- if not...
Click to read more »Module:Xal-translit
Senin, 2020-04-27 08:11:35gcodepoint(mw.ustring.toNFC(text)) do if (num == 0x0415) or (num == 0x0435) then -- CYRILLIC CAPITAL/SMALL LETTER IE if gives_e[last] then result = result...
Click to read more »Module:Wikipedia
Sabtu, 2020-09-19 04:11:28script code \"" .. sc .. "\" is not valid.")) or nil local linkdata = {} if args["cat"] then table.insert(linkdata, {term = "Category:" .. args["cat"]...
Click to read more »Module:User
Senin, 2018-04-23 03:00:52blank arguments -- are treated as nil. if not arg then return nil end arg = arg:match('^%s*(.-)%s*$') if arg ~= '' then return arg else return...
Click to read more »Module:WikidataCoord
Minggu, 2022-10-23 22:21:50-- table of lat/long coords extracted from wikidata return if not is_set (args[1]) then -- in case wikidata returns nothing (happens...
Click to read more »Module:Collapsible list
Kamis, 2020-10-15 03:48:31{{collapsible list}}. local p = {} local function gettitlestyletracking( ts ) if not ts then return '' end ts = mw.ustring.gsub(mw.ustring.lower(ts), '%s'...
Click to read more »Module:Road data/parser/hooks
Kamis, 2014-08-28 23:06:43function p.split(parameters, args) local route = tonumber(args.route) or 0 if route < parameters.split then return parameters.below else return parameters...
Click to read more »Module:Solar eclipse
Selasa, 2019-12-17 11:02:27a,b) if (s and s ~= '') then return a else return bs end end local function ifexist(page) if not page then return false end if mw.title...
Click to read more »Module:Bibleverse
Selasa, 2020-01-07 05:39:48split( s, '_') for i, s in ipairs(words) do s = string.lower(s) if i > 1 then if not alwayslower[s] then s = mw.getContentLanguage():ucfirst(s)...
Click to read more »Module:Babel
Sabtu, 2019-12-21 01:47:32= '' if nocat then maybeNocat = '|nocat=yes' end return frame:preprocess('{{Uiser '..v..maybeNocat..'}}') end function p.main(frame) if not getArgs...
Click to read more »Module:Ru-translit
Senin, 2020-04-27 08:11:13local export = {} --[=[ FIXME: 1. (DONE) If you write '''Б'''ез, it transliterates to '''B'''jez instead of '''B'''ez. 2. (DONE) Convert ъ to nothing...
Click to read more »Module:Redirect-multi
Kamis, 2017-04-27 12:16:15table.maxn aren't friends local maxArg = 0 for k, v in pairs(args) do if type(k) == 'number' and k > maxArg then maxArg = k end end --Get number...
Click to read more »Module:Toolbar
Sabtu, 2018-02-17 14:55:40local toolbarItems = p.makeToolbarItems(args) if not toolbarItems then -- Return the blank string if no arguments were specified, rather than -- returning...
Click to read more »Module:For nowiki
Jumat, 2019-06-14 06:39:55{} code = mw.text.unstripNoWiki(code) for i, value in ipairs(args) do if i > offset then argstosub["i"] = i - offset argstosub["1"] = value ...
Click to read more »Module:Sports color
Sabtu, 2018-11-10 14:55:28= 1, ["retired"] = 1, ["free agent"] = 1, } local colors = nil if ( team and use_default[team:lower()] ) then colors = {"DCDCDC", "000000"...
Click to read more »Module:Icon
Selasa, 2018-01-30 07:46:33iconData if code then code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case iconData = data[code] end if not iconData...
Click to read more »Module:La-adj/table
Senin, 2020-04-27 08:06:52colors[i][j] if col==0 or row==0 then return "" end local entry = data.finish_show_form(data, slots[i][j]) if col==1 then if row==1 then ...
Click to read more »Module:Osx-decl-adj
Senin, 2020-04-27 08:10:59"}}}" end }) end local wikicode = {} if parent_args.decl == "st" then -- do nothing yet else if parent_args[1] ~= "" then insert_all(wikicode...
Click to read more »Module:Random portal component
Senin, 2018-06-04 01:29:53template parameters appear in wikitext. If the -- specified argument exists, its value is returned, and if not the argument -- name is returned inside...
Click to read more »Module:Demography
Senin, 2018-06-04 00:51:17----------------------------------------------- function p.isInteger(v) if type(v) == 'number' and floor(v) == v then return true else return false...
Click to read more »Module:Pn
Sabtu, 2020-07-04 11:34:21pairs(frame:getParent().args) do args[k] = v end if not args[1] then return nil end local idx = tonumber(args.idx) or 1 if idx < 0 then idx = #args + idx + 1 end...
Click to read more »Module:Episode table
Jumat, 2018-08-03 12:27:26:css('width',width ~= '' and width .. '%' or nil) :wikitext(text) -- Reference if reference then cell:wikitext(" " .. EpisodeTable.reference(reference...
Click to read more »Module:ForLoop
Selasa, 2018-05-29 14:18:29ipairs(variableVals) do v = mw.text.trim(v) -- trim whitespace if #v > 0 or not yesno(args.skipBlanks) then if addSeparator then result = result .. sep end...
Click to read more »Module:La-noun/table
Senin, 2020-04-27 08:06:57Array = require 'Module:array' local function add_forms(wikitable, forms) if type(wikitable) ~= 'string' then error('Expected string, got ' .. type(wikitable))...
Click to read more »Module:Other uses
Kamis, 2016-06-30 08:03:23emptyArgs = true for k, v in pairs(args) do if type(k) == 'number' then emptyArgs = false break end end if emptyArgs then args = { options.defaultPage...
Click to read more »Module:Gazette util
Minggu, 2022-10-23 22:23:08pages; -- only one; prefer |page= if is_set (page_or_pages) then if 'pages' == args.param then if page_or_pages:match ('[,%-–]') then ...
Click to read more »Module:Photo montage
Kamis, 2015-03-12 22:13:11args['foot_montage'] or '' local lastnum = nil local rownum = nil local floatstyle = nil if( position == 'left' or position == 'right' or position == 'none') then floatstyle...
Click to read more »Module:Page
Sabtu, 2019-02-16 06:42:26= args['p'..i] or pargs['p'..i] end if not id and not mw.ustring.match( page, '%S' ) then page = nil end if id then title = callAssert(mw.title...
Click to read more »Module:Escape
Rabu, 2018-06-27 12:31:59('%x%s%s'):format(chr:byte(), safe, safe), ('%s%x'):format(safe, chr:byte()) ) if not self[self[1]] then self[self[1]] = { char = chr, text = ('%s(...
Click to read more »Module:Based on
Jumat, 2019-04-26 03:15:14lua_main(frame) local s = frame.args[1] if frame.args[3] then local args = {} for i, v in ipairs(frame.args) do if i >= 2 then args[#args+1] = v...
Click to read more »Module:Unicode data/scripts
Selasa, 2025-07-29 23:29:54get("Unicode/data/scripts/singles.tab") for index, cols in ipairs(data.data) do if cols[1] and cols[2] then result.singles[tonumber(cols[1], 16)]=cols[2]...
Click to read more »Module:Convert character width
Rabu, 2017-04-26 05:47:04local function getHalf( s ) for half, full in pairs( data ) do if s == full then return half end end return s end...
Click to read more »Module:Lang/utilities
Minggu, 2022-10-23 22:22:07>------------------------------------------------------------------ return true if code is one of the listed Chinese, Japanese, Korean ISO 639 codes, false else...
Click to read more »Module:Term cleanup
Senin, 2020-04-27 08:11:23local term = (args[1] or "") .. (args[2] or "") if not lang or lang == "" then if title.nsText == "Template" then return...
Click to read more »Module:R:Duden
Senin, 2020-04-27 08:05:50= args[1] or mw.ustring.gsub(title,'[äöüÄÖÜß-]',chart) local link = "" if termURLCode == '' then link = "''Duden'' online" else link = "[http://www...
Click to read more »Module:MultiReplace
Kamis, 2019-07-18 06:31:282] do local change = {pattern = args[i * 2], repl = args[i * 2 + 1]} if not change.repl then return require('Module:Error').error{ 'MultiReplace:...
Click to read more »Module:IPA symbol
Selasa, 2017-03-28 03:27:37args.output or 'wikipage' if not args[1] or args[1] == "" then return args[3] or "" end id = data.symbols[args[1]] if not id then return html_error('"'...
Click to read more »Module:NUMBEROF/data
Minggu, 2020-05-17 20:43:23ipairs(statistics.schema.fields) do -- Assume "site" is first entry and skip it. if i > 1 then map[v.name] = i - 1 -- name is lowercase end end return...
Click to read more »Module:Cy-mut
Senin, 2020-04-27 08:06:06ustring.sub(radical,2,-1) first_two = initial .. mw.ustring.sub(final,1,1) if first_two=='ll' or first_two=='rh' or first_two=='ch' then initial = first_two...
Click to read more »Module:Script utilities/data
Senin, 2020-04-27 08:11:16"ltr", }, ["default"] = {}, } for key, value in pairs(data.translit) do if not value.tag then value.tag = "span" end end data.faces = { ["term"]...
Click to read more »Module:Myv-translit
Senin, 2020-04-27 08:08:26tr(word) if type(word) == 'table' then -- called directly from a template word = word.args[1] end -- Ё needs converting if is decomposed...
Click to read more »Module:IPAc-en
Selasa, 2017-03-28 03:06:56local function makePronunciationText(id) id = id and string.lower(trim(id)) if id and id ~= '' and data.pronunciation[id] then return data.pronunciation[id]...
Click to read more »Module:IPAc-ro
Minggu, 2018-01-21 03:18:31local function makePronunciationText(id) id = id and string.lower(trim(id)) if id and id ~= '' and data.pronunciation[id] then return data.pronunciation[id]...
Click to read more »Module:Unicode data/combining
Rabu, 2025-07-30 19:28:51get("Unicode/data/combining/singles.tab") for index, cols in ipairs(data.data) do if cols[1] and cols[2] then result.singles[tonumber(cols[1], 16)]=cols[2]...
Click to read more »Module:Bua-translit
Senin, 2020-04-27 08:06:00tr(word) if type(word) == 'table' then -- called directly from a template word = word.args[1] end -- Ё needs converting if is decomposed...
Click to read more »Module:Namespace detect/data
Jumat, 2022-01-28 01:50:10require('Module:Namespace detect/config') local function addKey(t, key, defaultKey) if key ~= defaultKey then t[#t + 1] = key end end -- Get a table of parameters...
Click to read more »Module:Template invocation
Selasa, 2019-12-17 11:15:14function p.name(title) if type(title) == 'string' then title = mw.title.new(title) if not title then error("invalid title in...
Click to read more »Module:Chm-translit
Senin, 2020-04-27 08:06:02tr(word) if type(word) == 'table' then -- called directly from a template word = word.args[1] end -- Ё needs converting if is decomposed...
Click to read more »Module:IsValidPageName
Rabu, 2017-04-19 07:19:39isValidPageName(frame) local success, res = pcall(mw.title.new, frame.args[1]) if success and res then return "valid" else return "" end end return export...
Click to read more »Module:DemoTemplate
Minggu, 2022-10-23 22:23:48if string.find(v, '=', 1, true) then break end ipairsArgs[k] = true printf('|%s', v) end for k,v in pairs(frame.args) do if not...
Click to read more »Module:Fro-utilities
Senin, 2020-04-27 08:06:35more plurals by changing FROM to TO1, TO2, TO3, etc.; -- return true if plurals were added local function addpl(from, to1, to2, to3, to4, to5...
Click to read more »Module:Pi-Latn-translit
Senin, 2020-04-27 08:11:01options) if type(text) == "table" then options = {} options.impl = text.args["impl"] text, script = text.args[1], text.args[2] end if script ==...
Click to read more »Module:Wd/i18n
Rabu, 2020-07-08 09:42:08function(num) if tostring(num):sub(-2,-2) == '1' then return "th" -- 10th, 11th, 12th, 13th, ... 19th end num = tostring(num):sub(-1) if num == '1'...
Click to read more »Module:TreeChart
Minggu, 2022-10-23 22:24:11local trimmedVal = val:match('^%s*(.-)%s*$') if trimmedVal == '' then trimmedVal = '$' end if cells[trimmedVal] then table.insert(cell_args...
Click to read more »Module:La-adj/data
Senin, 2020-04-27 08:06:52for good measure. -- In most other cases we need to remove only the -s. if plural:find("xes$") or plural:find("[cs]hes$") then return plural:gsub("es$"...
Click to read more »Module:London ward populations
Selasa, 2017-06-20 06:22:04[[Template:London ward populations]]. local p = {} function p._main(args, frame) if not args[1] then return nil elseif args[1] == 'year' then return 2011...
Click to read more »Module:Hu-pron
Sabtu, 2023-04-01 22:57:56)', function(penul, prev, succ) if prev == '' and penul ~= '' then prev, penul = penul, '' end if succ == '' or match(succ, '[bcdfghjklmnprstvwxyz]')...
Click to read more »Module:Su
Minggu, 2018-06-03 13:58:22frame:getParent().args local args = {} for k, v in pairs(origArgs) do if v ~= '' then args[k] = v end end -- Define the variables to pass to...
Click to read more »Module:Form of/functions
Senin, 2020-04-27 08:06:30either return the formatted display text or nil to check the next handler. If no handlers apply, there is a default handler that appropriately formats most...
Click to read more »Module:Large category TOC
Minggu, 2016-05-22 02:45:22body_wrapper local body = toc_frame:tag('div') :css('text-align', 'center') if toc_type == 'collapsible' then toc_frame:addClass('NavFrame') header:addClass('NavHead')...
Click to read more »Module:Citation/CS1/Arguments
Kamis, 2013-08-22 10:23:50Configuration/sandbox" ); for k, v in pairs( cfg.aliases ) do if type( v ) == 'table' then for k2, v2 in pairs( v ) do ...
Click to read more »Module:Taxonbar/exists
Selasa, 2019-07-09 03:32:05match(content, '%{%{ *[Tt]axon?[ -]?[bB]ar') or string.match(content, '%{%{ *[Tt]axonIds') if found then return true end return false end return p...
Click to read more »Module:Link language
Sabtu, 2019-12-21 00:54:59lang_render(frame) local lang = frame.args[1] lang = lang and mw.text.trim(lang) if lang and lang ~= '' then return mw.message.newRawMessage(cfg.messages['leid']...
Click to read more »Module:In5
Jumat, 2022-01-28 01:50:09frame.args[1] -- Trim whitespace and convert to number. Default to 5 if not present, -- as per the template title. indent = tonumber( mw.text...
Click to read more »Module:Geobox coor
Jumat, 2015-08-07 05:45:38or '' local innersuffix = args['innersuffix'] or '' local cstr = '' if( isnotempty(args[3]) ) then cstr = coord_wrapper(frame, {args[1], args[2]...
Click to read more »Module:Etymology languages
Senin, 2020-04-27 08:06:21return self._rawData.parent end function EtymologyLanguage:getAncestors() if not self._ancestorObjects then self._ancestorObjects = {} for _, ancestor...
Click to read more »Module:Category handler/config
Jumat, 2022-01-28 01:49:58parameter. This skips the -- blacklist if set to the cfg.category2Yes value, and suppresses -- categorisation if present but equal to anything other than...
Click to read more »Module:Pages with authority control identifiers
Minggu, 2022-10-23 22:21:23frame ) --local pageCount = mw.site.stats.pagesInCategory(title, 'pages') --if pageCount > 1200 then -- return frame:expandTemplate{ title = 'Large category...
Click to read more »Module:Fr-pron
Senin, 2020-04-27 08:06:33= rsub(term, foo, bar) if new_term == term then return term end term = new_term end end local function ine(x) if x == "" then return nil else...
Click to read more »Module:Tone superscript
Selasa, 2019-12-17 10:57:20"<sup>%1</sup>") root:tag('span'):wikitext(x) local tracking = '' if string.match(arg, "</?sup>") then tracking = '[[Category:Pages uisin Tone...
Click to read more »Module:Userbox
Sabtu, 2017-03-11 05:25:02greater than or equal to zero. If so, -- returns it as a number. If not, returns a default value. val = tonumber(val) if val and val >= 0 then return...
Click to read more »Module:Unicode data/datasets
Rabu, 2025-07-23 03:03:06export.dataset(dataset_name) local dataset = mw.ext.data.get(dataset_name) if not dataset then return nil end local data = dataset.data local result...
Click to read more »Module:Protection banner/config
Kamis, 2022-12-29 06:19:20the masterBanner table, which holds data for protection -- templates to use if no data has been found in the previous two tables. -- -- The values in the...
Click to read more »Module:Uses Wikidata
Kamis, 2020-10-15 01:13:07function p.usesProperty(frame) local args = frame.getParent(frame).args or nil if mw.text.trim(args[1] or '') == '' then args = frame.args end local result...
Click to read more »Module:NUMBEROF/other
Sabtu, 2020-06-13 03:44:17local iSite, iArticles for i, v in ipairs(statistics.schema.fields) do if v.name == 'site' then iSite = i elseif v.name == 'articles' then iArticles...
Click to read more »Module:NUMBEROF/rank
Sabtu, 2020-06-13 03:44:31local iSite, iArticles for i, v in ipairs(statistics.schema.fields) do if v.name == 'site' then iSite = i elseif v.name == 'articles' then iArticles...
Click to read more »Module:Goth-translit
Senin, 2020-04-27 08:05:47"𐍉", ["ū"] = "𐌿", ["y"] = "𐍅", } for g, l in pairs(Goth_Latn) do if l ~= "?" then Latn_Goth[l] = g end end function export.tr(text, lang,...
Click to read more »Module:Cyrs-Glag-translit
Senin, 2020-04-27 08:05:47{ ["Ⱏ[ⰉⰊⰹⰺ]"]="Y", ["ⱏ[ⰹⰺ]"]="y", } function export.tr(text, lang, sc) if not sc then sc = require("Module:scripts").findBestScript(text, require("Module:languages")...
Click to read more »Module:Unicode data/blocks
Selasa, 2025-07-29 01:22:55result={} local write_index=1 for index, cols in ipairs(data.data) do if cols[1] and cols[2] and cols[3] then result[write_index]={tonumber(cols[1]...
Click to read more »Module:Runr-translit
Senin, 2020-04-27 08:05:55["ᛚ"]="l", ["ᛦ"]="ʀ", ["ᛧ"]="ʀ", } function export.tr(text, lang, sc) if letters[lang] then return (mw.ustring.gsub(text, ".", letters[lang])) end...
Click to read more »Module:Convert/text
Senin, 2018-04-16 06:39:44for use on another wiki. -- See [[:en:Template:Convert/Transwiki guide]] if copying to another wiki. -- Some units accept an SI prefix before the unit...
Click to read more »Module:Labelled list hatnote
Selasa, 2019-12-17 11:25:05pairs(args) do if type(k) == 'number' then local display for i = 1, #prefixes do display = args[prefixes[i] .. k] if display then break...
Click to read more »Module:Databox
Minggu, 2022-07-03 15:20:00databox(frame) local args = frame:getParent().args local itemId = nil if args.item then itemId = args.item end local lang = mw.language...
Click to read more »Module:Pt-conj/table
Senin, 2020-04-27 08:11:05function verbDescription() local description = "This is " if verb_data.irregular then description = description .. "an irregular...
Click to read more »Module:Hyphenation
Senin, 2020-04-27 08:06:45= table.concat(args[1 + offset], "‧"), tr = "-"}) local category = "" if categorise_syllables[lang:getCode()] then category = require("Module:utilities")...
Click to read more »Module:Cv-translit
Senin, 2020-04-27 08:06:05["Я"]="Ja", ['я']='ja' }; function M.tr(text)--translit any words or phrases if type(text) == "table" then text = text.args[1] end return (mw.ustring...
Click to read more »Module:Ga-mutation
Senin, 2020-04-27 08:06:36getByCode("ga") local export = {} local function repl(forms, param) if param ~= "normal" and forms[param] == forms["normal"] then return "''not...
Click to read more »Module:Image array
Jumat, 2018-05-18 13:44:48= isnotempty(b) and '|border' or '' local cell = mw.html.create('') if( img ) then cell:tag('div') :css('display', 'table-cell') :css('vertical-align'...
Click to read more »Module:Form of/data
Senin, 2020-04-27 08:06:29inflection tag. May be missing. If glossary_type is unspecified or is "app", this is an anchor in [[Appendix:Glossary]]. If glossary_type is "wikt", ...
Click to read more »Module:R:LSJ
Senin, 2020-04-27 08:05:51local beta = '' local title = args['w'] or mw.title.getCurrentTitle().text if args[1] then beta = args[1] else local length = mw.ustring.len(title)...
Click to read more »Module:Category handler/blacklist
Jumat, 2022-01-28 01:49:58Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected...
Click to read more »Module:Mn-translit
Senin, 2020-04-27 08:08:25["Ө"]="Ö",['ө']='ö' }; function M.tr(text)--translit any words or phrases if type(text) == "table" then text = text.args[1] end text = mw.ustring...
Click to read more »Module:Navbar/configuration
Jumat, 2022-01-28 01:50:14['invalid_title'] = 'Invalid title ', ['classes'] = { -- set a line to nil if you don't want it ['navbar'] = 'navbar', ['plainlinks'] = 'plainlinks'...
Click to read more »Module:Distinguish
Jumat, 2017-03-17 10:57:42function p._distinguish(args) checkType("_distinguish", 1, args, 'table') if #args == 0 then return '' end local text = string.format( 'Nae tae be confused...
Click to read more »Module:Country extract/RO
Sabtu, 2018-02-17 03:16:46"RO-HR", ["Harghita Coonty"] = "RO-HR", ["Ilfov"] = "RO-IF", ["Ilfov Coonty"] = "RO-IF", ["Ialomița"] = "RO-IL", ["Ialomița Coonty"] = "RO-IL",...
Click to read more »Module:Hatnote inline
Rabu, 2017-05-03 12:07:22args = mArguments.getArgs(frame) local hatnote = mHatnote.hatnote(frame) if args.inline == nil or yesno(args.inline, true) then local subs = { ['^<div']...
Click to read more »Module:Ky-translit
Senin, 2020-04-27 08:06:51["ң"]="ñ",['Ң']='Ñ' }; function M.tr(text)--translit any words or phrases if type(text) == "table" then text = text.args[1] end text = mw.ustring...
Click to read more »Module:Sa-translit
Senin, 2020-04-27 08:11:13'([कखगघङचछजझञटठडढणतथदधनपफबभमयरलळवशषसह])'.. '([ािीुूृॄॢॣेैोौ्]?)', function(c, d) if d == "" then return consonants[c] .. 'a' else return consonants[c]...
Click to read more »Module:Pt-adjectives
Senin, 2020-04-27 08:11:05== "Template" and "o") or ""; if infl_type == "" then error("Parameter 2 (inflection type) may not be empty.") end if not inflections[infl_type] then...
Click to read more »Module:Coxeter–Dynkin diagram
Selasa, 2019-12-17 11:29:38do -- process params, ignoring any names if (x ~= '') then -- check for null/empty names body = body .....
Click to read more »Module:Succession table monarch
Jumat, 2018-08-03 12:31:07for _,eachElement in ipairs(argElements) do if eachElement.name then local namePlainList = '' if eachElement.nickname or eachElement.native then...
Click to read more »Module:Further
Kamis, 2016-11-10 02:49:41{parentOnly = true}) local pages = mTableTools.compressSparseArray(args) if #pages < 1 then return mHatnote.makeWikitextError( 'no page names specified'...
Click to read more »Module:Transclusion count/data/I
Kamis, 2020-10-15 01:13:07["If"] = 119000, ["If_between"] = 3500, ["If_both"] = 45000, ["If_either"] = 4700, ["If_empty"] = 2290000, ["If_first_display_both"] = 56000, ["If_in_page"]...
Click to read more »Module:Geor-translit
Sabtu, 2017-03-11 01:21:55["ჶ"]="?", ["ჷ"]="?", ["?"]="ʾ" }; function p.tr(frame) text = frame.args[1] if text == nil or text == "" or mw.ustring.find(text, "[Ⴀ-ჼ]") == nil then ...
Click to read more »