विकिसूक्ति hiwikiquote https://hi.wikiquote.org/wiki/%E0%A4%AE%E0%A5%81%E0%A4%96%E0%A4%AA%E0%A5%83%E0%A4%B7%E0%A5%8D%E0%A4%A0 MediaWiki 1.47.0-wmf.11 first-letter मीडिया विशेष वार्ता सदस्य सदस्य वार्ता विकिसूक्ति विकिसूक्ति वार्ता चित्र चित्र वार्ता मीडियाविकि मीडियाविकि वार्ता साँचा साँचा वार्ता सहायता सहायता वार्ता श्रेणी श्रेणी वार्ता TimedText TimedText talk मॉड्यूल मॉड्यूल वार्ता Event Event talk विकिसूक्ति:चौपाल 4 3256 33029 32933 2026-07-16T19:15:06Z SM7 1879 पुरानी चर्चाएँ [[/पुरालेख 2]] पर पुरालेखित 33029 wikitext text/x-wiki <!-- आवश्यक निर्देश -->{{/शीर्षक}}<!-- कृपया इस लाइन को न बदलें --> <!--  चर्चाएँ एवं संदेश पृष्ठ पर क्रम में सबसे नीचे जोड़ें  --> 4kpb71is3qkk42jj4hxwq3zub2bzsb4 मॉड्यूल:Namespace detect/config 828 3665 33038 14426 2026-07-16T19:47:45Z SM7 1879 लोकलाइजेशन 33038 Scribunto text/plain -------------------------------------------------------------------------------- -- Namespace detect configuration data -- -- -- -- This module stores configuration data for Module:Namespace detect. Here -- -- you can localise the module to your wiki's language. -- -- -- -- To activate a configuration item, you need to uncomment it. This means -- -- that you need to remove the text "-- " at the start of the line. -- -------------------------------------------------------------------------------- local cfg = {} -- Don't edit this line. -------------------------------------------------------------------------------- -- Parameter names -- -- These configuration items specify custom parameter names. Values added -- -- here will work in addition to the default English parameter names. -- -- To add one extra name, you can use this format: -- -- -- -- cfg.foo = 'parameter name' -- -- -- -- To add multiple names, you can use this format: -- -- -- -- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} -- -------------------------------------------------------------------------------- ---- This parameter displays content for the main namespace: -- cfg.main = 'मुख्य' ---- This parameter displays in talk namespaces: -- cfg.talk = 'वार्ता' ---- This parameter displays content for "other" namespaces (namespaces for which ---- parameters have not been specified): -- cfg.other = 'अन्य' ---- This parameter makes talk pages behave as though they are the corresponding ---- subject namespace. Note that this parameter is used with [[Module:Yesno]]. ---- Edit that module to change the default values of "yes", "no", etc. -- cfg.subjectns = 'subjectns' ---- This parameter sets a demonstration namespace: -- cfg.demospace = 'demospace' ---- This parameter sets a specific page to compare: cfg.demopage = 'पृष्ठ' -------------------------------------------------------------------------------- -- Table configuration -- -- These configuration items allow customisation of the "table" function, -- -- used to generate a table of possible parameters in the module -- -- documentation. -- -------------------------------------------------------------------------------- ---- The header for the namespace column in the wikitable containing the list of ---- possible subject-space parameters. -- cfg.wikitableNamespaceHeader = 'Namespace' ---- The header for the wikitable containing the list of possible subject-space ---- parameters. -- cfg.wikitableAliasesHeader = 'Aliases' -------------------------------------------------------------------------------- -- End of configuration data -- -------------------------------------------------------------------------------- return cfg -- Don't edit this line. fkqsfm8zamc3ax7s540ay75tz4lp580 मॉड्यूल:Namespace detect/data 828 3667 33037 14457 2026-07-16T19:46:53Z SM7 1879 लोकलाइजेशन 33037 Scribunto text/plain -------------------------------------------------------------------------------- -- Namespace detect data -- -- This module holds data for [[Module:Namespace detect]] to be loaded per -- -- page, rather than per #invoke, for performance reasons. -- -------------------------------------------------------------------------------- local cfg = require('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 to query for each default parameter name. -- This allows wikis to customise parameter names in the cfg table while -- ensuring that default parameter names will always work. The cfg table -- values can be added as a string, or as an array of strings. local defaultKeys = { 'मुख्य', 'वार्ता', 'अन्य', 'subjectns', 'demospace', 'demopage' } local argKeys = {} for i, defaultKey in ipairs(defaultKeys) do argKeys[defaultKey] = {defaultKey} end for defaultKey, t in pairs(argKeys) do local cfgValue = cfg[defaultKey] local cfgValueType = type(cfgValue) if cfgValueType == 'string' then addKey(t, cfgValue, defaultKey) elseif cfgValueType == 'table' then for i, key in ipairs(cfgValue) do addKey(t, key, defaultKey) end end cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more. end local function getParamMappings() --[[ -- Returns a table of how parameter names map to namespace names. The keys -- are the actual namespace names, in lower case, and the values are the -- possible parameter names for that namespace, also in lower case. The -- table entries are structured like this: -- { -- [''] = {'main'}, -- ['विकिसूक्ति'] = {'विकिसूक्ति', 'project', 'wp'}, -- ... -- } --]] local mappings = {} local mainNsName = mw.site.subjectNamespaces[0].name mainNsName = mw.ustring.lower(mainNsName) mappings[mainNsName] = mw.clone(argKeys.main) mappings['वार्ता'] = mw.clone(argKeys.talk) for nsid, ns in pairs(mw.site.subjectNamespaces) do if nsid ~= 0 then -- Exclude main namespace. local nsname = mw.ustring.lower(ns.name) local canonicalName = mw.ustring.lower(ns.canonicalName) mappings[nsname] = {nsname} if canonicalName ~= nsname then table.insert(mappings[nsname], canonicalName) end for _, alias in ipairs(ns.aliases) do table.insert(mappings[nsname], mw.ustring.lower(alias)) end end end return mappings end return { argKeys = argKeys, cfg = cfg, mappings = getParamMappings() } q6iwf7hur61tbvu9m1n7tppagb7fu6g विकिसूक्ति:चौपाल/पुरालेख 2 4 9272 33027 2026-07-16T19:13:37Z SM7 1879 वर्ष 2026 से शुरू होने वाला नया पुरालेख पन्ना 33027 wikitext text/x-wiki {{Archive}} rzh0eq4u5qq9tl9dk2ht86m4wc67fa4 33028 33027 2026-07-16T19:14:48Z SM7 1879 मूल पृष्ठ [[विकिसूक्ति:चौपाल|चौपाल]] से लाकर पुरालेखित 33028 wikitext text/x-wiki {{Archive}} == मातृभाषा संपादनोत्सव में भाग लें == हिंदी विकिमीडियन्स यूजर ग्रूप द्वारा अंतर्राष्ट्रीय मातृभाषा दिवस के अवसर पर दो संपादनोत्सव का आयोजन किया जा रहा है। # [[w:hi:विकिपीडिया:मातृभाषा संवर्धन संपादनोत्सव/2026|विकिपीडिया:मातृभाषा संवर्धन संपादनोत्सव/2026]]- 15 फरवरी 2026 से 21 फरवरी 2026 तक हिंदी विकिपीडिया पर आयोजित ऑन लाइन संपादनोत्सव। # [[S:hi:विकिस्रोत:मातृभाषा संवर्धन संपादनोत्सव/2026|विकिस्रोत:मातृभाषा संवर्धन संपादनोत्सव/2026]]- 21 फरवरी 2026 से 28फरवरी 2026 तक हिंदी विकिस्रोत पर आयोजित ऑन लाइन संपादनोत्सव। :इनमें भाग लेकर मुक्त हिंदी ई-सामग्री के विकास के अभियान में सहायक होने के लिए आपका स्वागत है। --[[सदस्य:अनिरुद्ध कुमार|अनिरुद्ध कुमार]] ([[सदस्य वार्ता:अनिरुद्ध कुमार|वार्ता]]) १०:५३, १४ फ़रवरी २०२६ (IST) == आगामी कार्यक्रम == :हिंदी विकिमीडियन्स यूजर ग्रूप द्वारा आयोजित होने वाले कार्यक्रमों की सूची: # जून- विकिपीडिया सामग्री संवर्द्धन संपादनोत्सव (१ जून से 30 जून) # जुलाई- विकिस्रोत सामग्री संवर्द्धन संपादनोत्सव (१ से 15 जुलाई) # अगस्त- हिंदी विकि सम्मेलन (7-9 अगस्त) -संपर्क सूत्र--[[सदस्य:अनिरुद्ध कुमार|अनिरुद्ध कुमार]] ([[सदस्य वार्ता:अनिरुद्ध कुमार|वार्ता]]) ००:०२, २५ अप्रैल २०२६ (IST) == हिंदी विकिपीडिया सम्मेलन 2026 == :मुझे यह बताते हुए प्रसन्नता हो रही है कि हिंदी विकिमीडियन्स यूजर ग्रूप के द्वारा प्रस्तावित [[w:hi:विकिपीडिया:हिंदी विकिपीडिया सम्मेलन 2026|हिंदी विकिपीडिया सम्मेलन 2026]] को विकिमीडिया के कॉन्फ्रेंस ग्रांट कमिटी द्वारा मंजूरी मिल गई है। 7-9 अगस्त 2026 को होने वाली हिंदी विकि समुदाय की यह बैठक 2020 के बाद पहली बार हो रही है। नई दिल्ली में आयोजित इस बैठक में शामिल होने के लिए सहायता वृत्ति (स्कॉलरशिप) का आवेदन पत्र 1 मई से 20 मई 2026 तक उपलब्ध रहेगा। आयोजन संबंधी सूचनाएं सम्मेलन के लिए निर्मित विकिपीडिया पृष्ठ पर उपलब्ध होगी तथा संक्षिप्त सूचना चौपाल पर भी उपलब्ध होगी। 6 वर्ष बाद हो रहे सामुदायिक मिलन के इस प्रयास में सभी हिंदी विकि संपादकों के सहयोग की अपेक्षा है।- संपर्क सूत्र --[[सदस्य:अनिरुद्ध कुमार|अनिरुद्ध कुमार]] ([[सदस्य वार्ता:अनिरुद्ध कुमार|वार्ता]]) ००:०३, २५ अप्रैल २०२६ (IST) == हिंदी विकिपीडिया सम्मेलन २०२६ छात्रवृत्ति सूचना == हिंदी विकिमीडियन्स यूजर ग्रूप द्वारा 8-9 अगस्त 2026 को आयोजित [[w:hi:विकिपीडिया:हिंदी विकिपीडिया सम्मेलन 2026|हिंदी विकिपीडिया सम्मेलन 2026]] में शामिल होने के लिए 10 राष्टरीय तथा 10 स्थानीय स्तर की छात्रवृत्ती प्रदान की जाएगी। इसे प्राप्त करने के लिए हिंदी विकि संपादक सदस्य [https://docs.google.com/forms/d/e/1FAIpQLSfLBdfmW4zvXCRbz-qjzQrxT2cX2pCilcnOvK73Dhu0wc7gow/viewform?usp=header हिंदी विकिपीडिया सम्मेलन 2026 प्रतिभागिता वृत्ति प्रपत्र] 20 मई तक जरूर भरें। --[[सदस्य:अनिरुद्ध कुमार|अनिरुद्ध कुमार]] ([[सदस्य वार्ता:अनिरुद्ध कुमार|वार्ता]]) २३:५५, १ मई २०२६ (IST) ==जून के हिंदी विकिपीडिया संपादनोत्सव में शामिल होकर पुरस्कार जीतें == '''[[w:hi:विकिपीडिया:सामग्री संवर्द्धन संपादनोत्सव/जून 2026|विकिपीडिया सामग्री संवर्द्धन संपादनोत्सव जून 2026]]''' 1 जून से शुरु होकर 30 जून तक चलने वाला लेख निर्माण संपादनोत्सव है। इसमें इस बार आप सुझाए लेखों के अलावा अपनी पसंद के लेखों का निर्माण भी कर सकते हैं। इसमें शामिल होकर एआई के दौर में मानव निर्मित ज्ञान को संरक्षित रखने के अभियान में सहायक होने के लिए आप सबका स्वागत है। लेख निर्माण प्रतियोगिता है। इसका लक्ष्य 1 जून 2026 से 30 जून 2026 तक नए लेखों का निर्माण करना है। --[[सदस्य:अनिरुद्ध कुमार|अनिरुद्ध कुमार]] ([[सदस्य वार्ता:अनिरुद्ध कुमार|वार्ता]]) १७:२४, ३१ मई २०२६ (IST) tmh50xd3j7j6cqe9nnl782yqq02oml2 मॉड्यूल:Archive 828 9273 33030 2026-07-16T19:23:50Z SM7 1879 From [[w:en:Module:Archive]] 33030 Scribunto text/plain ------------------------------------------------------------------------------- -- Automatic archive navigator -- -- This module produces a talk archive banner, together with an automatically- -- generated list of navigation links to other archives of the talk page in -- question. It implements {{Archive}}. ------------------------------------------------------------------------------- local yesno = require('Module:Yesno') ------------------------------------------------------------------------------- -- Helper functions ------------------------------------------------------------------------------- local function makeWikilink(page, display) if display then return string.format('[[%s|%s]]', page, display) else return string.format('[[%s]]', page) end end local function escapePattern(s) -- Escape punctuation in a string so it can be used in a Lua pattern. s = s:gsub('%p', '%%%0') return s end local function makeTable(width) local archiveTable = mw.html.create('table') archiveTable :css({ ['max-width'] = width, ['margin'] = '0 auto 0.5em', ['text-align'] = 'center' }) -- Set width so that the table doesn't spill out on narrower skins -- or when zooming in. It has to be defined multiple times because -- "stretch" is experimental. :cssText('width:100%;width:-moz-available;width:-webkit-fill-available;width:stretch') return archiveTable end -- Check to see if the page is likely an annual archive. No talk pages exist -- before 2001. Some pages have the next year created in advance. local function isYearlyArchive(num) local currentYear = tonumber(os.date("%Y")) return num and num >= 2001 and num <= currentYear + 1 -- possible years end local function detectArchiveFormat(title, args) -- Check if next/previous are set. Some archives swap between annual and -- sequential archives at some point and will need to accept whatever an -- editor says the next/previous link should be for these kind of weird -- or unsual orders. if args and (args.prev or args.next) then return nil, nil, nil end -- Check if "/Archive 2" exists to prevent false positives on noticeboards local archiveBase = title.baseText local archive2Title = mw.title.new(archiveBase .. "/पुरालेख 2") if archive2Title and archive2Title.exists then return nil, nil, nil -- Exit early for sequential archives end -- How is the year formatted? local patterns = { {pattern = "^(.-)/पुरालेख (%d+)$", prefix = nil}, -- "Talk:Base page/Archive YYYY" -- "nil" triggers the default. There is some kind of quirk with how -- the module give spaces that Template:Yearly archive list cannot -- read with either a space or the HTML space entity {pattern = "^(.-)/पुरालेख(%d+)$", prefix = "/पुरालेख"}, -- "Talk:Base page/ArchiveYYYY" {pattern = "^(.-)/पुरालेख/(%d+)$", prefix = "/पुरालेख/"}, -- "Talk:Base page/Archive/YYYY" {pattern = "^(.-)/पुरालेख/(%d+)$", prefix = "/पुरालेख/"}, -- "Talk:Base page/Archives/YYYY" {pattern = "^(.-)/(%d+)$", prefix = "/"} -- "Talk:Base page/YYYY" } for _, p in ipairs(patterns) do local basePage, archiveNum = title.prefixedText:match(p.pattern) archiveNum = tonumber(archiveNum) if basePage and isYearlyArchive(archiveNum) then return basePage, true, p.prefix end end return nil, nil, nil end ------------------------------------------------------------------------------- -- Navigator class ------------------------------------------------------------------------------- local Navigator = {} Navigator.__index = Navigator function Navigator.new(args, cfg, currentTitle) local obj = setmetatable({}, Navigator) -- Set inputs obj.args = args obj.cfg = cfg obj.currentTitle = currentTitle -- Archive prefix -- Decode HTML entities so users can enter things like "Archive&#32;" from -- wikitext. obj.archivePrefix = obj.args.prefix or obj:message('archive-prefix') obj.archivePrefix = mw.text.decode(obj.archivePrefix) -- Current archive number do local pattern = string.format( '^%s([1-9][0-9]*)$', escapePattern(obj.archivePrefix) ) obj.currentArchiveNum = obj.currentTitle.subpageText:match(pattern) obj.currentArchiveNum = tonumber(obj.currentArchiveNum) end -- Highest archive number obj.highestArchiveNum = require('Module:Highest archive number')._main( obj.currentTitle.nsText .. ':' .. obj.currentTitle.baseText .. '/' .. obj.archivePrefix, obj.currentArchiveNum ) return obj end function Navigator:message(key, ...) local msg = self.cfg[key] if select('#', ...) > 0 then return mw.message.newRawMessage(msg, ...):plain() else return msg end end function Navigator:getNamespacePreposition() -- Most talk archives are about a subject. Some will be "with" an editor -- or "on" a noticeboard. -- Function to get the namespace preposition -- Namespace number where transcluded local namespaceNumber = mw.title.getCurrentTitle().namespace -- Preposition from table to make it easy for wikis to translate or ignore local namespacePrepositionTable = self.cfg['namespace-prepositions'] -- Default preposition if not exception from above return namespacePrepositionTable[namespaceNumber] or self.cfg["preposition-default"] end function Navigator:makeBlurb() local args = self.args local current = self.currentTitle local ret -- Skip if user provides their own blurb. if args.text then ret = args.text else -- Set parent talk page. local parentTalkPage = current.basePageTitle local talkPageTitle local pageUnderDiscussion -- If the parent talk page exists (and it's not the root talk page) -- we should link to it in both the "main talk page" and -- "discussions about" parts of the blurb. if args.prefix or (parentTalkPage.exists and parentTalkPage.isRedirect == false and current.baseText ~= current.rootText) then talkPageTitle = parentTalkPage.fullText pageUnderDiscussion = talkPageTitle -- If it doesn't, set "main talk page" to the root talk page -- and "discussions about" to the root subject. else talkPageTitle = current.nsText .. ':' .. parentTalkPage.rootText -- Set page under discussion. pageUnderDiscussion = current.subjectNsText .. ':' .. current.rootText -- Prepend colon for non-mainspace pages. if current.subjectNsText ~= '' then pageUnderDiscussion = ':' .. pageUnderDiscussion end end -- Check current namespace for blurb. local namespace = 'main' if current.isTalkPage == true then namespace = 'talk' end -- What kind of blurb to use in the message box? local function getBlurbKey(args) if args.type == 'index' then -- For manually-indexed archives only return 'blurb-index', args.type elseif args.type == 'annual' then -- Grab the year of the current archive. return 'blurb-annual', mw.getCurrentFrame():expandTemplate { title = 'Title year', args = { page = current.fullText } } elseif args.period then return 'blurb-period', args.period else return 'blurb-noperiod', '' end end -- Generate a blurb from Module:Archive/config local blurbKey, argValue = getBlurbKey(args) local namespacePreposition = self:getNamespacePreposition() ret = self:message(blurbKey, talkPageTitle, pageUnderDiscussion, argValue, namespace, namespacePreposition) end return ret end function Navigator:makeMessageBox() local args = self.args local image if args.image then image = args.image else local icon = args.icon or self:message('default-icon') image = string.format( '[[File:%s|%s|alt=|link=]]', icon, self:message('image-size') ) end -- Hardcode tmbox style on the template's page. -- PS: Needs to be changed if the template is renamed! local mainTemplatePage = '' if self.currentTitle.fullText == 'साँचा:Archive' then mainTemplatePage = 'वार्ता' end local mbox = require('Module:Message box').main('mbox', { demospace = args.demospace or mainTemplatePage, image = image, imageright = args.imageright, style = args.style or '', textstyle = args.textstyle or 'text-align:center', text = self:makeBlurb(), }) return mbox end function Navigator:getArchiveNums() -- Returns an array of the archive numbers to format. local noLinks = tonumber(self.args.links) or self:message('default-link-count') noLinks = math.floor(noLinks) -- If |noredlinks is "yes", true or absent, don't allow red links. If it is -- 'no' or false, allow red links. local allowRedLinks = yesno(self.args.noredlinks) == false local current = self.currentArchiveNum local highest = self.highestArchiveNum if not current or not highest or noLinks < 1 then return {} elseif noLinks == 1 then return {current} end local function getNum(i, current) -- Gets an archive number given i, the position in the array away from -- the current archive, and the current archive number. The first two -- offsets are consecutive; the third offset is rounded up to the -- nearest 5; and the fourth and subsequent offsets are rounded up to -- the nearest 10. The offsets are calculated in such a way that archive -- numbers will not be duplicated. if -2 <= i and i <= 2 then return current + i elseif -3 <= i and i <= 3 then return current + 2 - (current + 2) % 5 + (i / 3) * 5 elseif 4 <= i then return current + 7 - (current + 7) % 10 + (i - 3) * 10 else return current + 2 - (current + 2) % 10 + (i + 3) * 10 end end local nums = {} -- Archive nums lower than the current page. for i = -1, -math.floor((noLinks - 1) / 2), -1 do local num = getNum(i, current) if num <= 1 then table.insert(nums, 1, 1) break else table.insert(nums, 1, num) end end -- Current page. if nums[#nums] < current then table.insert(nums, current) end -- Higher archive nums. for i = 1, math.ceil((noLinks - 1) / 2) do local num = getNum(i, current) if num <= highest then table.insert(nums, num) elseif allowRedLinks and (i <= 2 or i <= 3 and num == nums[#nums] + 1) then -- Only insert one red link, and only if it is consecutive. table.insert(nums, highest + 1) break elseif nums[#nums] < highest then -- Insert the highest archive number if it isn't already there. table.insert(nums, highest) break else break end end return nums end function Navigator:makeArchiveLinksWikitable() local args = self.args local lang = mw.language.getContentLanguage() local nums = self:getArchiveNums() local noLinks = #nums -- Skip number processing if |prev and |next are defined. if args.prev or args.next then local archives = {} if args.prev then archives[#archives + 1] = mw.title.new(args.prev) end archives[#archives + 1] = self.currentTitle if args.next then archives[#archives + 1] = mw.title.new(args.next) end local table = makeTable('30em') for _, title in ipairs(archives) do if tostring(title) == self.currentTitle.prefixedText then table:tag("td"):wikitext(string.format( '<span style="font-size:115%%;">%s</span>', makeWikilink(title.fullText, title.subpageText) )) else table:tag("td"):wikitext( makeWikilink(title.fullText, title.subpageText) ) end end return tostring(table) end if noLinks < 1 then return '' end -- Make the table of links. local links = {} local isCompact = noLinks > 7 local currentIndex for i, num in ipairs(nums) do local subpage = self.archivePrefix .. tostring(num) local display if isCompact then display = tostring(num) else display = self:message('archive-link-display', num) end local link = makeWikilink('../' .. subpage, display) if num == self.currentArchiveNum then link = string.format('<span style="font-size:115%%;">%s</span>', link) currentIndex = i end table.insert(links, link) end -- Add the arrows. -- We must do the forwards arrow first as we are adding elements to the -- links table. If we did the backwards arrow first the index for the -- current archive would be wrong. currentIndex = currentIndex or math.ceil(#links / 2) for i = currentIndex + 1, #links do if nums[i] - nums[i - 1] > 1 then table.insert(links, i, lang:getArrow('forwards')) break end end for i = currentIndex - 1, 1, -1 do if nums[i + 1] - nums[i] > 1 then table.insert(links, i + 1, lang:getArrow('backwards')) break end end -- Output the wikitable. local width if noLinks <= 3 then width = string.format('%dem', noLinks * 10) elseif noLinks <= 7 then width = string.format('%dem', (noLinks + 3) * 5) else width = '37em' end local table = makeTable(width) for _, s in ipairs(links) do table:tag("td"):wikitext(s) end return tostring(table) end function Navigator:__tostring() local args = self.args local boxComponents -- Is |omit filled? If not, make the whole box. if args.omit == nil then -- Check for annual archives local currentTitle = self.currentTitle local yearlyBase, isYearly, yearlyPattern = detectArchiveFormat(currentTitle, args) if isYearly then -- Use a yearly archive format local linksYearlyListSeparator = "&#32;" -- Space separator local linksYearlyList = mw.getCurrentFrame():expandTemplate { title = 'वर्षवार पुरालेख सूची', args = { root = yearlyBase, sep = linksYearlyListSeparator, prefix = yearlyPattern } } boxComponents = self:makeMessageBox() .. '\n' .. '<div style="font-size:115%; width:100%; word-spacing:1em; text-align:center;">' .. linksYearlyList .. '</div>' else -- Default numbered archive format boxComponents = self:makeMessageBox() .. '\n' .. self:makeArchiveLinksWikitable() end -- We're omitting the banner, so we should only make the links table. elseif args.omit == 'banner' then boxComponents = self:makeArchiveLinksWikitable() -- We're omitting the archives, so we should only make the banner. elseif args.omit == 'archives' then boxComponents = self:makeMessageBox() end -- Allow for demo pages to be edited freely. if not args.demospace then boxComponents = boxComponents .. ' __NONEWSECTIONLINK__ __NOEDITSECTION__ __ARCHIVEDTALK__' end return boxComponents end ------------------------------------------------------------------------------- -- Exports ------------------------------------------------------------------------------- local p = {} function p._exportClasses() return { Navigator = Navigator } end function p._aan(args, cfg, currentTitle) cfg = cfg or mw.loadData('Module:Archive/config') currentTitle = currentTitle or mw.title.getCurrentTitle() local aan = Navigator.new(args, cfg, currentTitle) return tostring(aan) end function p.aan(frame) local args = require('Module:Arguments').getArgs(frame, { wrappers = 'साँचा:Archive', }) return p._aan(args) end return p rin7nha22vjtba6lsd0mtxyieeu9nr8 33041 33030 2026-07-16T19:52:48Z SM7 1879 सुधार 33041 Scribunto text/plain ------------------------------------------------------------------------------- -- Automatic archive navigator -- -- This module produces a talk archive banner, together with an automatically- -- generated list of navigation links to other archives of the talk page in -- question. It implements {{Archive}}. ------------------------------------------------------------------------------- local yesno = require('Module:Yesno') ------------------------------------------------------------------------------- -- Helper functions ------------------------------------------------------------------------------- local function makeWikilink(page, display) if display then return string.format('[[%s|%s]]', page, display) else return string.format('[[%s]]', page) end end local function escapePattern(s) -- Escape punctuation in a string so it can be used in a Lua pattern. s = s:gsub('%p', '%%%0') return s end local function makeTable(width) local archiveTable = mw.html.create('table') archiveTable :css({ ['max-width'] = width, ['margin'] = '0 auto 0.5em', ['text-align'] = 'center' }) -- Set width so that the table doesn't spill out on narrower skins -- or when zooming in. It has to be defined multiple times because -- "stretch" is experimental. :cssText('width:100%;width:-moz-available;width:-webkit-fill-available;width:stretch') return archiveTable end -- Check to see if the page is likely an annual archive. No talk pages exist -- before 2001. Some pages have the next year created in advance. local function isYearlyArchive(num) local currentYear = tonumber(os.date("%Y")) return num and num >= 2001 and num <= currentYear + 1 -- possible years end local function detectArchiveFormat(title, args) -- Check if next/previous are set. Some archives swap between annual and -- sequential archives at some point and will need to accept whatever an -- editor says the next/previous link should be for these kind of weird -- or unsual orders. if args and (args.prev or args.next) then return nil, nil, nil end -- Check if "/Archive 2" exists to prevent false positives on noticeboards local archiveBase = title.baseText local archive2Title = mw.title.new(archiveBase .. "/पुरालेख 2") if archive2Title and archive2Title.exists then return nil, nil, nil -- Exit early for sequential archives end -- How is the year formatted? local patterns = { {pattern = "^(.-)/पुरालेख (%d+)$", prefix = nil}, -- "Talk:Base page/Archive YYYY" -- "nil" triggers the default. There is some kind of quirk with how -- the module give spaces that Template:Yearly archive list cannot -- read with either a space or the HTML space entity {pattern = "^(.-)/पुरालेख(%d+)$", prefix = "/पुरालेख"}, -- "Talk:Base page/ArchiveYYYY" {pattern = "^(.-)/पुरालेख/(%d+)$", prefix = "/पुरालेख/"}, -- "Talk:Base page/Archive/YYYY" {pattern = "^(.-)/Archive/(%d+)$", prefix = "/Archive/"}, -- "Talk:Base page/Archives/YYYY" {pattern = "^(.-)/(%d+)$", prefix = "/"} -- "Talk:Base page/YYYY" } for _, p in ipairs(patterns) do local basePage, archiveNum = title.prefixedText:match(p.pattern) archiveNum = tonumber(archiveNum) if basePage and isYearlyArchive(archiveNum) then return basePage, true, p.prefix end end return nil, nil, nil end ------------------------------------------------------------------------------- -- Navigator class ------------------------------------------------------------------------------- local Navigator = {} Navigator.__index = Navigator function Navigator.new(args, cfg, currentTitle) local obj = setmetatable({}, Navigator) -- Set inputs obj.args = args obj.cfg = cfg obj.currentTitle = currentTitle -- Archive prefix -- Decode HTML entities so users can enter things like "Archive&#32;" from -- wikitext. obj.archivePrefix = obj.args.prefix or obj:message('archive-prefix') obj.archivePrefix = mw.text.decode(obj.archivePrefix) -- Current archive number do local pattern = string.format( '^%s([1-9][0-9]*)$', escapePattern(obj.archivePrefix) ) obj.currentArchiveNum = obj.currentTitle.subpageText:match(pattern) obj.currentArchiveNum = tonumber(obj.currentArchiveNum) end -- Highest archive number obj.highestArchiveNum = require('Module:Highest archive number')._main( obj.currentTitle.nsText .. ':' .. obj.currentTitle.baseText .. '/' .. obj.archivePrefix, obj.currentArchiveNum ) return obj end function Navigator:message(key, ...) local msg = self.cfg[key] if select('#', ...) > 0 then return mw.message.newRawMessage(msg, ...):plain() else return msg end end function Navigator:getNamespacePreposition() -- Most talk archives are about a subject. Some will be "with" an editor -- or "on" a noticeboard. -- Function to get the namespace preposition -- Namespace number where transcluded local namespaceNumber = mw.title.getCurrentTitle().namespace -- Preposition from table to make it easy for wikis to translate or ignore local namespacePrepositionTable = self.cfg['namespace-prepositions'] -- Default preposition if not exception from above return namespacePrepositionTable[namespaceNumber] or self.cfg["preposition-default"] end function Navigator:makeBlurb() local args = self.args local current = self.currentTitle local ret -- Skip if user provides their own blurb. if args.text then ret = args.text else -- Set parent talk page. local parentTalkPage = current.basePageTitle local talkPageTitle local pageUnderDiscussion -- If the parent talk page exists (and it's not the root talk page) -- we should link to it in both the "main talk page" and -- "discussions about" parts of the blurb. if args.prefix or (parentTalkPage.exists and parentTalkPage.isRedirect == false and current.baseText ~= current.rootText) then talkPageTitle = parentTalkPage.fullText pageUnderDiscussion = talkPageTitle -- If it doesn't, set "main talk page" to the root talk page -- and "discussions about" to the root subject. else talkPageTitle = current.nsText .. ':' .. parentTalkPage.rootText -- Set page under discussion. pageUnderDiscussion = current.subjectNsText .. ':' .. current.rootText -- Prepend colon for non-mainspace pages. if current.subjectNsText ~= '' then pageUnderDiscussion = ':' .. pageUnderDiscussion end end -- Check current namespace for blurb. local namespace = 'main' if current.isTalkPage == true then namespace = 'talk' end -- What kind of blurb to use in the message box? local function getBlurbKey(args) if args.type == 'index' then -- For manually-indexed archives only return 'blurb-index', args.type elseif args.type == 'annual' then -- Grab the year of the current archive. return 'blurb-annual', mw.getCurrentFrame():expandTemplate { title = 'Title year', args = { page = current.fullText } } elseif args.period then return 'blurb-period', args.period else return 'blurb-noperiod', '' end end -- Generate a blurb from Module:Archive/config local blurbKey, argValue = getBlurbKey(args) local namespacePreposition = self:getNamespacePreposition() ret = self:message(blurbKey, talkPageTitle, pageUnderDiscussion, argValue, namespace, namespacePreposition) end return ret end function Navigator:makeMessageBox() local args = self.args local image if args.image then image = args.image else local icon = args.icon or self:message('default-icon') image = string.format( '[[File:%s|%s|alt=|link=]]', icon, self:message('image-size') ) end -- Hardcode tmbox style on the template's page. -- PS: Needs to be changed if the template is renamed! local mainTemplatePage = '' if self.currentTitle.fullText == 'साँचा:Archive' then mainTemplatePage = 'वार्ता' end local mbox = require('Module:Message box').main('mbox', { demospace = args.demospace or mainTemplatePage, image = image, imageright = args.imageright, style = args.style or '', textstyle = args.textstyle or 'text-align:center', text = self:makeBlurb(), }) return mbox end function Navigator:getArchiveNums() -- Returns an array of the archive numbers to format. local noLinks = tonumber(self.args.links) or self:message('default-link-count') noLinks = math.floor(noLinks) -- If |noredlinks is "yes", true or absent, don't allow red links. If it is -- 'no' or false, allow red links. local allowRedLinks = yesno(self.args.noredlinks) == false local current = self.currentArchiveNum local highest = self.highestArchiveNum if not current or not highest or noLinks < 1 then return {} elseif noLinks == 1 then return {current} end local function getNum(i, current) -- Gets an archive number given i, the position in the array away from -- the current archive, and the current archive number. The first two -- offsets are consecutive; the third offset is rounded up to the -- nearest 5; and the fourth and subsequent offsets are rounded up to -- the nearest 10. The offsets are calculated in such a way that archive -- numbers will not be duplicated. if -2 <= i and i <= 2 then return current + i elseif -3 <= i and i <= 3 then return current + 2 - (current + 2) % 5 + (i / 3) * 5 elseif 4 <= i then return current + 7 - (current + 7) % 10 + (i - 3) * 10 else return current + 2 - (current + 2) % 10 + (i + 3) * 10 end end local nums = {} -- Archive nums lower than the current page. for i = -1, -math.floor((noLinks - 1) / 2), -1 do local num = getNum(i, current) if num <= 1 then table.insert(nums, 1, 1) break else table.insert(nums, 1, num) end end -- Current page. if nums[#nums] < current then table.insert(nums, current) end -- Higher archive nums. for i = 1, math.ceil((noLinks - 1) / 2) do local num = getNum(i, current) if num <= highest then table.insert(nums, num) elseif allowRedLinks and (i <= 2 or i <= 3 and num == nums[#nums] + 1) then -- Only insert one red link, and only if it is consecutive. table.insert(nums, highest + 1) break elseif nums[#nums] < highest then -- Insert the highest archive number if it isn't already there. table.insert(nums, highest) break else break end end return nums end function Navigator:makeArchiveLinksWikitable() local args = self.args local lang = mw.language.getContentLanguage() local nums = self:getArchiveNums() local noLinks = #nums -- Skip number processing if |prev and |next are defined. if args.prev or args.next then local archives = {} if args.prev then archives[#archives + 1] = mw.title.new(args.prev) end archives[#archives + 1] = self.currentTitle if args.next then archives[#archives + 1] = mw.title.new(args.next) end local table = makeTable('30em') for _, title in ipairs(archives) do if tostring(title) == self.currentTitle.prefixedText then table:tag("td"):wikitext(string.format( '<span style="font-size:115%%;">%s</span>', makeWikilink(title.fullText, title.subpageText) )) else table:tag("td"):wikitext( makeWikilink(title.fullText, title.subpageText) ) end end return tostring(table) end if noLinks < 1 then return '' end -- Make the table of links. local links = {} local isCompact = noLinks > 7 local currentIndex for i, num in ipairs(nums) do local subpage = self.archivePrefix .. tostring(num) local display if isCompact then display = tostring(num) else display = self:message('archive-link-display', num) end local link = makeWikilink('../' .. subpage, display) if num == self.currentArchiveNum then link = string.format('<span style="font-size:115%%;">%s</span>', link) currentIndex = i end table.insert(links, link) end -- Add the arrows. -- We must do the forwards arrow first as we are adding elements to the -- links table. If we did the backwards arrow first the index for the -- current archive would be wrong. currentIndex = currentIndex or math.ceil(#links / 2) for i = currentIndex + 1, #links do if nums[i] - nums[i - 1] > 1 then table.insert(links, i, lang:getArrow('forwards')) break end end for i = currentIndex - 1, 1, -1 do if nums[i + 1] - nums[i] > 1 then table.insert(links, i + 1, lang:getArrow('backwards')) break end end -- Output the wikitable. local width if noLinks <= 3 then width = string.format('%dem', noLinks * 10) elseif noLinks <= 7 then width = string.format('%dem', (noLinks + 3) * 5) else width = '37em' end local table = makeTable(width) for _, s in ipairs(links) do table:tag("td"):wikitext(s) end return tostring(table) end function Navigator:__tostring() local args = self.args local boxComponents -- Is |omit filled? If not, make the whole box. if args.omit == nil then -- Check for annual archives local currentTitle = self.currentTitle local yearlyBase, isYearly, yearlyPattern = detectArchiveFormat(currentTitle, args) if isYearly then -- Use a yearly archive format local linksYearlyListSeparator = "&#32;" -- Space separator local linksYearlyList = mw.getCurrentFrame():expandTemplate { title = 'वर्षवार पुरालेख सूची', args = { root = yearlyBase, sep = linksYearlyListSeparator, prefix = yearlyPattern } } boxComponents = self:makeMessageBox() .. '\n' .. '<div style="font-size:115%; width:100%; word-spacing:1em; text-align:center;">' .. linksYearlyList .. '</div>' else -- Default numbered archive format boxComponents = self:makeMessageBox() .. '\n' .. self:makeArchiveLinksWikitable() end -- We're omitting the banner, so we should only make the links table. elseif args.omit == 'banner' then boxComponents = self:makeArchiveLinksWikitable() -- We're omitting the archives, so we should only make the banner. elseif args.omit == 'archives' then boxComponents = self:makeMessageBox() end -- Allow for demo pages to be edited freely. if not args.demospace then boxComponents = boxComponents .. ' __NONEWSECTIONLINK__ __NOEDITSECTION__ __ARCHIVEDTALK__' end return boxComponents end ------------------------------------------------------------------------------- -- Exports ------------------------------------------------------------------------------- local p = {} function p._exportClasses() return { Navigator = Navigator } end function p._aan(args, cfg, currentTitle) cfg = cfg or mw.loadData('Module:Archive/config') currentTitle = currentTitle or mw.title.getCurrentTitle() local aan = Navigator.new(args, cfg, currentTitle) return tostring(aan) end function p.aan(frame) local args = require('Module:Arguments').getArgs(frame, { wrappers = 'साँचा:Archive', }) return p._aan(args) end return p 6hm9wgppqytc9h17gb74gwyojr0kbzg मॉड्यूल:Highest archive number 828 9274 33031 2026-07-16T19:25:55Z SM7 1879 From [[w:en:Module:Highest archive number]] 33031 Scribunto text/plain -- This module finds the highest existing archive number for a set of talk -- archive pages. local expSearch = require('Module:Exponential search') local p = {} local function raiseStartNumberError(start) error(string.format( 'Invalid start number "%s" supplied to [[Module:Highest archive number]] (must be an integer)', tostring(start) ), 3) end local function pageExists(page) local success, exists = pcall(function() return mw.title.new(page).exists end) return success and exists end function p._main(prefix, start) -- Check our inputs if type(prefix) ~= 'string' or not prefix:find('%S') then error('No prefix supplied to [[Module:Highest archive number]]', 2) end if start ~= nil and (type(start) ~= "number" or math.floor(start) ~= start) then raiseStartNumberError(start) end start = start or 1 -- Do an exponential search for the highest archive number local result = expSearch(function (i) local archiveNumber = i + start - 1 local page = prefix .. tostring(archiveNumber) return pageExists(page) end, 10) if result == nil then -- We didn't find any archives for our prefix + start number return nil else -- We found the highest archive, but the number is always 1-based, so -- adjust it for our start number return result + start - 1 end end function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { trim = false, removeBlanks = false, wrappers = 'साँचा:Highest archive number' }) local prefix = args[1] -- Get the start archive number, if specified. local start = args.start if start == "" then start = nil elseif start then start = tonumber(start) if not start then raiseStartNumberError(args.start) end end return p._main(prefix, start) end return p 4y1cmaitkf2aqnrwd9ft8u1skhxf19s मॉड्यूल:Archive/config 828 9275 33032 2026-07-16T19:29:14Z SM7 1879 From [[w:en:Module:Archive/config]] 33032 Scribunto text/plain -------------------------------------------------------------------------------- -- Configuration for Module:Automatic archive navigator -- -- This module contains configuration data for -- [[Module:Automatic archive navigator]]. It can be used to easily translate the -- module for use on other wikis, as well as changing settings like the default -- archive prefix and the default link count. -------------------------------------------------------------------------------- return { -------------------------------------------------------------------------------- -- Blurb -------------------------------------------------------------------------------- -- The blurbs to use for the archive banner. If the "period" argument is -- specified, the "blurb-period" message is used; otherwise the "blurb-noperiod" -- message is used. -- $1 - the full page name of the current talk page (assumed to be the base -- page of the archive pages. -- $2 - the page under discussion (i.e. "Space" for "Talk:Space/Archive 1") -- $3 - the value of the "period" argument. -- $4 - the namespace of the current page. -- $5 - this preposition changes depending on the namespace "about" by default -- or "with" for user talk pages ['blurb-period'] = "This is an '''[[w:en:Help:Archiving a talk page|archive]]''' " .. "of past discussions $5 [[$2]], '''for the period $3'''.<br />'''Do not edit the " .. "contents of this page.''' If you wish to start a new discussion or " .. "revive an old one, please do so on the [[$1|current $4 page]].", ['blurb-index'] = "This is an index of '''[[w:en:Help:Archiving a talk page|archived]]''' " .. "past discussions $5 [[$2]]. '''Do not edit the contents of this page.''' If " .. "you wish to start a new discussion or revive an old one, please do so " .. "on the [[$1|current $4 page]].", ['blurb-annual'] = "'''Do not edit this page.''' This is the " .. "[[w:en:Help:Archiving_a_talk_page|archive]] of past discussions $5 [[$2]], " .. "for the year $3. (Please direct any additional comments to the " .. "[[$1|current $4 page]]) See the annual archives listed below:", ['blurb-noperiod'] = "This is an '''[[w:en:Help:Archiving a talk page|archive]]''' " .. "of past discussions $5 [[$2]]. '''Do not edit the contents of this page.''' If " .. "you wish to start a new discussion or revive an old one, please do so " .. "on the [[$1|current $4 page]].", -------------------------------------------------------------------------------- -- Prepositions -------------------------------------------------------------------------------- -- Used in blurbs above. These change depending on namespace. -- Depending on the blurb format in other languages, these can be translated -- or ignored. ['namespace-prepositions'] = { [2] = "with", -- User [3] = "with", -- User talk [4] = "on", -- Wikipedia [12] = "on", -- Help }, ['preposition-default'] = "about", -------------------------------------------------------------------------------- -- Image -------------------------------------------------------------------------------- -- The default icon for the archive banner. ['default-icon'] = 'Replacement filing cabinet.svg', -- The image size, unless a custom image is specified with the "image" -- parameter. ['image-size'] = '40x40px', -------------------------------------------------------------------------------- -- Archive links -------------------------------------------------------------------------------- -- The default prefix for archive pages on this wiki. This is the subpage text -- minus the archive number itself. So if the full page name of a typical -- archive was "Talk:France/Archive 12", the prefix would be "Archive ". This -- message is used to detect whether the current page is an archive page. ['archive-prefix'] = 'Archive ', -- The display value to use for long archive links. These are used if seven or -- less links are output. -- $1 - The archive number. ['archive-link-display'] = 'पुरालेख&nbsp;$1', -- The default number of archive links to output. ['default-link-count'] = 7 } nwvag5tsrn9bop582pbwwhztum4wa7z 33035 33032 2026-07-16T19:33:16Z SM7 1879 लोकलाइजेशन 33035 Scribunto text/plain -------------------------------------------------------------------------------- -- Configuration for Module:Automatic archive navigator -- -- This module contains configuration data for -- [[Module:Automatic archive navigator]]. It can be used to easily translate the -- module for use on other wikis, as well as changing settings like the default -- archive prefix and the default link count. -------------------------------------------------------------------------------- return { -------------------------------------------------------------------------------- -- Blurb -------------------------------------------------------------------------------- -- The blurbs to use for the archive banner. If the "period" argument is -- specified, the "blurb-period" message is used; otherwise the "blurb-noperiod" -- message is used. -- $1 - the full page name of the current talk page (assumed to be the base -- page of the archive pages. -- $2 - the page under discussion (i.e. "Space" for "Talk:Space/Archive 1") -- $3 - the value of the "period" argument. -- $4 - the namespace of the current page. -- $5 - this preposition changes depending on the namespace "about" by default -- or "with" for user talk pages ['blurb-period'] = "This is an '''[[w:en:Help:Archiving a talk page|archive]]''' " .. "of past discussions $5 [[$2]], '''for the period $3'''.<br />'''Do not edit the " .. "contents of this page.''' If you wish to start a new discussion or " .. "revive an old one, please do so on the [[$1|current $4 page]].", ['blurb-index'] = "This is an index of '''[[w:en:Help:Archiving a talk page|archived]]''' " .. "past discussions $5 [[$2]]. '''Do not edit the contents of this page.''' If " .. "you wish to start a new discussion or revive an old one, please do so " .. "on the [[$1|current $4 page]].", ['blurb-annual'] = "'''Do not edit this page.''' This is the " .. "[[w:en:Help:Archiving_a_talk_page|archive]] of past discussions $5 [[$2]], " .. "for the year $3. (Please direct any additional comments to the " .. "[[$1|current $4 page]]) See the annual archives listed below:", ['blurb-noperiod'] = "This is an '''[[w:en:Help:Archiving a talk page|archive]]''' " .. "of past discussions $5 [[$2]]. '''Do not edit the contents of this page.''' If " .. "you wish to start a new discussion or revive an old one, please do so " .. "on the [[$1|current $4 page]].", -------------------------------------------------------------------------------- -- Prepositions -------------------------------------------------------------------------------- -- Used in blurbs above. These change depending on namespace. -- Depending on the blurb format in other languages, these can be translated -- or ignored. ['namespace-prepositions'] = { [2] = "with", -- User [3] = "with", -- User talk [4] = "on", -- Wikipedia [12] = "on", -- Help }, ['preposition-default'] = "about", -------------------------------------------------------------------------------- -- Image -------------------------------------------------------------------------------- -- The default icon for the archive banner. ['default-icon'] = 'Replacement filing cabinet.svg', -- The image size, unless a custom image is specified with the "image" -- parameter. ['image-size'] = '40x40px', -------------------------------------------------------------------------------- -- Archive links -------------------------------------------------------------------------------- -- The default prefix for archive pages on this wiki. This is the subpage text -- minus the archive number itself. So if the full page name of a typical -- archive was "Talk:France/Archive 12", the prefix would be "Archive ". This -- message is used to detect whether the current page is an archive page. ['archive-prefix'] = 'पुरालेख ', -- The display value to use for long archive links. These are used if seven or -- less links are output. -- $1 - The archive number. ['archive-link-display'] = 'पुरालेख&nbsp;$1', -- The default number of archive links to output. ['default-link-count'] = 7 } 0fg0sqyebfbjw4imeobxf7g65xs5imq 33039 33035 2026-07-16T19:48:57Z SM7 1879 लोकलाइजेशन 33039 Scribunto text/plain -------------------------------------------------------------------------------- -- Configuration for Module:Automatic archive navigator -- -- This module contains configuration data for -- [[Module:Automatic archive navigator]]. It can be used to easily translate the -- module for use on other wikis, as well as changing settings like the default -- archive prefix and the default link count. -------------------------------------------------------------------------------- return { -------------------------------------------------------------------------------- -- Blurb -------------------------------------------------------------------------------- -- The blurbs to use for the archive banner. If the "period" argument is -- specified, the "blurb-period" message is used; otherwise the "blurb-noperiod" -- message is used. -- $1 - the full page name of the current talk page (assumed to be the base -- page of the archive pages. -- $2 - the page under discussion (i.e. "Space" for "Talk:Space/Archive 1") -- $3 - the value of the "period" argument. -- $4 - the namespace of the current page. -- $5 - this preposition changes depending on the namespace "about" by default -- or "with" for user talk pages ['blurb-period'] = "This is an '''[[w:en:Help:Archiving a talk page|archive]]''' " .. "of past discussions $5 [[$2]], '''for the period $3'''.<br />'''Do not edit the " .. "contents of this page.''' If you wish to start a new discussion or " .. "revive an old one, please do so on the [[$1|current $4 page]].", ['blurb-index'] = "This is an index of '''[[w:en:Help:Archiving a talk page|archived]]''' " .. "past discussions $5 [[$2]]. '''Do not edit the contents of this page.''' If " .. "you wish to start a new discussion or revive an old one, please do so " .. "on the [[$1|current $4 page]].", ['blurb-annual'] = "'''Do not edit this page.''' This is the " .. "[[w:en:Help:Archiving_a_talk_page|archive]] of past discussions $5 [[$2]], " .. "for the year $3. (Please direct any additional comments to the " .. "[[$1|current $4 page]]) See the annual archives listed below:", ['blurb-noperiod'] = "यह [[$2]] $5 हुई पुरानी चर्चाओं का " .. "'''[[w:en:Help:Archiving a talk page|पुरालेख]]''' है। '''इस पृष्ठ की सामग्री को संपादित न करें''' यदि " .. "आप नई चर्चा शुरू करना चाह रहे या किसी पुरानी चर्चा को दुबारा आगे बढ़ाना चाह रहे, " .. "कृपया यह कार्य [[$1|वर्तमान $4 पृष्ठ]] पर जाकर करें।", -------------------------------------------------------------------------------- -- Prepositions -------------------------------------------------------------------------------- -- Used in blurbs above. These change depending on namespace. -- Depending on the blurb format in other languages, these can be translated -- or ignored. ['namespace-prepositions'] = { [2] = "के साथ", -- User [3] = "के साथ", -- User talk [4] = "पर", -- Wikipedia [12] = "पर", -- Help }, ['preposition-default'] = "about", -------------------------------------------------------------------------------- -- Image -------------------------------------------------------------------------------- -- The default icon for the archive banner. ['default-icon'] = 'Replacement filing cabinet.svg', -- The image size, unless a custom image is specified with the "image" -- parameter. ['image-size'] = '40x40px', -------------------------------------------------------------------------------- -- Archive links -------------------------------------------------------------------------------- -- The default prefix for archive pages on this wiki. This is the subpage text -- minus the archive number itself. So if the full page name of a typical -- archive was "Talk:France/Archive 12", the prefix would be "Archive ". This -- message is used to detect whether the current page is an archive page. ['archive-prefix'] = 'पुरालेख ', -- The display value to use for long archive links. These are used if seven or -- less links are output. -- $1 - The archive number. ['archive-link-display'] = 'पुरालेख&nbsp;$1', -- The default number of archive links to output. ['default-link-count'] = 7 } s8ykvh77gu33ujx52i2dlfw3a2f2xnz मॉड्यूल:Exponential search 828 9276 33033 2026-07-16T19:30:15Z SM7 1879 From [[w:en:Module:Exponential search]] 33033 Scribunto text/plain -- This module provides a generic exponential search algorithm. require[[strict]] local checkType = require('libraryUtil').checkType local floor = math.floor local function midPoint(lower, upper) return floor(lower + (upper - lower) / 2) end local function search(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) else i = i * 2 end return search(testFunc, i, lower, upper) else upper = i i = midPoint(lower, upper) return search(testFunc, i, lower, upper) end end return function (testFunc, init) checkType('Exponential search', 1, testFunc, 'function') checkType('Exponential search', 2, init, 'number', true) if init and (init < 1 or init ~= floor(init) or init == math.huge) then error(string.format( "invalid init value '%s' detected in argument #2 to " .. "'Exponential search' (init value must be a positive integer)", tostring(init) ), 2) end init = init or 2 if not testFunc(1) then return nil end return search(testFunc, init, 1, nil) end jqqi8l27tb73lglksbukg2g3bzt3fmv साँचा:Archive 10 9277 33034 2026-07-16T19:31:06Z SM7 1879 From [[w:en:Template:Archive]] 33034 wikitext text/x-wiki {{#invoke:Archive|aan|start={{{start|}}}}}<includeonly>{{#ifeq:{{{Redirect category|}}}|no||{{#if:{{is redirect|{{FULLBASEPAGENAME}}|talk=yes}}{{is redirect|{{#invoke:String|replace|{{FULLPAGENAME}}|/पुरालेख.*||plain=false}}|talk=yes}} |[[श्रेणी:Archive pages whose parent page is a redirect]] |}}}}{{editnotice EXPECTUNUSEDTEMPLATE}}</includeonly><noinclude> {{documentation}} <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude> 8wi3ayuxp6fkhtg38cf889hcjhvd7zl 33036 33034 2026-07-16T19:34:34Z SM7 1879 hide "editnotice EXPECTUNUSEDTEMPLATE" 33036 wikitext text/x-wiki {{#invoke:Archive|aan|start={{{start|}}}}}<includeonly>{{#ifeq:{{{Redirect category|}}}|no||{{#if:{{is redirect|{{FULLBASEPAGENAME}}|talk=yes}}{{is redirect|{{#invoke:String|replace|{{FULLPAGENAME}}|/पुरालेख.*||plain=false}}|talk=yes}} |[[श्रेणी:Archive pages whose parent page is a redirect]] |}}}}<!--{{editnotice EXPECTUNUSEDTEMPLATE}}--></includeonly><noinclude> {{documentation}} <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude> ffdcp1m6kw4gbrkrtgbxrvdz8utlu20 साँचा:Is redirect 10 9278 33040 2026-07-16T19:51:58Z SM7 1879 From [[w:en:Template:Is redirect]] 33040 wikitext text/x-wiki </noinclude>{{{{{|safesubst:}}}#switch:{{{{{|safesubst:}}}#invoke:Pagetype|main|page={{{1|}}}|talk={{{{{|safesubst:}}}yesno|1={{{talk|}}}|yes=yes|no=}}}} |redirect=yes ||#default=}}<noinclude>{{documentation}}</noinclude> tavqsilwad31mrqi6dz1stprdunpjck मॉड्यूल:Pagetype 828 9279 33042 2026-07-16T19:56:28Z SM7 1879 From [[w:en:Module:Pagetype]] 33042 Scribunto text/plain -------------------------------------------------------------------------------- -- -- -- This meta-module which automatically detects namespaces, and allows -- -- for a great deal of customisation. It can easily be ported to other -- -- wikis by changing the values in the [[Module:Pagetype/config]]. -- -- -- -------------------------------------------------------------------------------- -- Load config. local cfg = mw.loadData('Module:Pagetype/config') -- Load required modules. local yesno = require('Module:Yesno') local p = {} -- Look up a namespace argument in the args table. local function lookUpNamespaceArg(args, key) local arg = args[key] -- Convert "yes", "1" etc. to true, "no", "0" etc. to false, and leave -- other values the same. return yesno(arg, arg) end -- Append multiple values to an array local function appendMultiple(target, source) for _, value in ipairs(source) do table.insert(target, value) end end -- Get argument keys for a title's namespace local function getNamespaceArgKeys(title) local nsInfo = mw.site.namespaces[title.namespace] local customAliases = cfg.customNamespaceAliases[title.namespace] or {} local keys = {} if nsInfo.name ~= '' then table.insert(keys, nsInfo.name) end if nsInfo.canonicalName ~= nsInfo.name and nsInfo.canonicalName ~= '' then table.insert(keys, nsInfo.canonicalName) end appendMultiple(keys, nsInfo.aliases) appendMultiple(keys, customAliases) return keys end -- Get the argument for a title's namespace, if it was specified in the args table. local function getNamespaceArg(title, args) if title.isTalkPage then return lookUpNamespaceArg(args, cfg.talk) end for _, key in ipairs(getNamespaceArgKeys(title)) do local arg = lookUpNamespaceArg(args, mw.ustring.lower(key)) if arg ~= nil then return arg end end return nil end -- Look up a page type specific to the title's namespace local function getExplicitPageType(title) if title.isTalkPage then return cfg.talkDefault else return cfg.pagetypes[title.namespace] end end -- Get a default page type that is not specific to the title's namespace local function getDefaultPageType(args) local other = lookUpNamespaceArg(args, cfg.other) if type(other) == 'string' then return other else return cfg.otherDefault end end local function detectRedirects(title, args) local redirect = lookUpNamespaceArg(args, cfg.redirect) if redirect == false then -- Don't detect redirects if they have been specifically disallowed. return nil end -- Allow custom values for redirects. if not title.isRedirect then return nil elseif type(redirect) == 'string' then return redirect else return cfg.redirectDefault end end local function capitalize(pageType) local first = mw.ustring.sub(pageType, 1, 1) local rest = mw.ustring.sub(pageType, 2) return mw.ustring.upper(first) .. rest end local function pluralize(pageType) if cfg.irregularPlurals[pageType] then return cfg.irregularPlurals[pageType] else return pageType .. cfg.plural -- often 's' end end local function parseContent(title, args, optionsList) if title.namespace==828 and title.subpageText~='doc' -- don't detect modules or not title.exists -- can't check unless page exists then return nil end local content = title:getContent() if content == nil then return nil end local templates -- lazily evaluated for _, options in next, optionsList do local list, parameter, default, articleOnly = unpack(options, 1, 4) if not articleOnly or title.namespace==0 then -- only check for templates if we should... local out = lookUpNamespaceArg(args, parameter) if type(out) == "string" or (out ~= false and default) then -- ...and if we actually have anything to say about them if not templates then templates = {} -- do our delayed evaluation now that we are required to content = require('Module:Wikitext Parsing').PrepareText(content) -- disregard templates which do not have any affect for template in string.gmatch(content, "{{%s*([^|}]-)%s*[|}]") do templates[#templates+1] = capitalize(template) end end local wantedTemplates = mw.loadData('Module:Pagetype/' .. list) local templateFound = false for _, template in next, templates do if wantedTemplates[template] then templateFound = true break end end if templateFound then if type(out)=='string' then return out elseif out ~= false and default then return default end end end end end end -- Find pages which do not exist local function nonExistent(title, args) local arg = lookUpNamespaceArg(args, cfg.ne) if arg == false then return nil end local exists = false if title.exists then -- not an article if it does not exist exists = true elseif title.namespace==8 and mw.message.new(title.text):exists() then exists = true elseif title.namespace==6 and title.fileExists then exists = true end if not exists then if type(arg) == 'string' then return arg else return cfg.naDefault end end end -- Get page types for mainspaces pages with an explicit class specified local function getMainNamespaceClassPageType(title, args) local class = args[1] if type(class) == 'string' then -- Put in lower case so e.g. "na" and "NA" will both match class = mw.ustring.lower(class) end local arg = lookUpNamespaceArg(args, cfg.na) if arg == false then -- don't check for this class if it is specifically disallowed return nil end if cfg.naAliases[class] then if type(arg) == 'string' then return arg else return cfg.naDefault end else return nil end end -- Get page type specified by an explicit namespace argument. local function getNamespaceArgPageType(title, args) local namespaceArg = getNamespaceArg(title, args) if namespaceArg == true then -- Namespace has been explicitly enabled, so return the default for -- this namespace return getExplicitPageType(title) elseif namespaceArg == false then -- Namespace has been explicitly disabled return getDefaultPageType(args) elseif namespaceArg then -- This namespaces uses custom text return namespaceArg else return nil end end -- Get page type not specified or detected by other means local function getOtherPageType(title, args) -- Whether the title is in the set of default active namespaces which are looked up in cfg.pagetypes. local isInDefaultActiveNamespace = false local defaultNamespacesKey = args[cfg.defaultns] if defaultNamespacesKey == cfg.defaultnsAll then isInDefaultActiveNamespace = true else local defaultNamespaces if defaultNamespacesKey == cfg.defaultnsExtended then defaultNamespaces = cfg.extendedNamespaces elseif defaultNamespacesKey == cfg.defaultnsNone then defaultNamespaces = {} else defaultNamespaces = cfg.defaultNamespaces end isInDefaultActiveNamespace = defaultNamespaces[title.namespace] end if isInDefaultActiveNamespace then return getExplicitPageType(title) else return getDefaultPageType(args) end end function p._main(args) local title if args.page then title = mw.title.new(args.page) else title = mw.title.getCurrentTitle() end if title and not yesno(args.talk, true) and args[cfg.defaultns] ~= cfg.defaultnsAll then title = title.subjectPageTitle end local pageType = detectRedirects(title, args) or nonExistent(title, args) or parseContent(title, args, { {'softredirect', cfg.softRedirect, cfg.softRedirectDefault}, {'setindex', cfg.sia, cfg.siaDefault, true}, {'disambiguation', cfg.dab, cfg.dabDefault, true}, {'rfd', cfg.rfd, cfg.rfdDefault}, }) or (title.namespace == 0 and getMainNamespaceClassPageType(title, args)) or getNamespaceArgPageType(title, args) or getOtherPageType(title, args) if yesno(args.plural, false) then pageType = pluralize(pageType) end if yesno(args.caps, false) then pageType = capitalize(pageType) end return pageType end function p.main(frame) local args = require('Module:Arguments').getArgs(frame) return p._main(args) end return p nqu0kvn2uc9jqptetkmoluzmahcxzzp मॉड्यूल:Pagetype/config 828 9280 33043 2026-07-16T19:59:21Z SM7 1879 From [[w:en:Module:Pagetype/config]] 33043 Scribunto text/plain -------------------------------------------------------------------------------- -- Module:Pagetype configuration data -- -- This page holds localisation and configuration data for Module:Pagetype. -- -------------------------------------------------------------------------------- local cfg = {} -- Don't edit this line. -------------------------------------------------------------------------------- -- Start configuration data -- -------------------------------------------------------------------------------- -- This table holds the default page types for each namespace. Keys to this -- table should be integers that can be used as keys to mw.site.namespaces. cfg.pagetypes = { [0] = 'article', -- Main namespace [2] = 'user page', [4] = 'project page', [6] = 'file', [8] = 'interface page', -- MediaWiki namespace [10] = 'template', [12] = 'help page', [14] = 'category', [100] = 'portal', [118] = 'draft', [126] = 'MOS page', [710] = 'Timed Text page', [828] = 'module', [1728] = 'event page', [2300] = 'gadget', [2302] = 'gadget definition', [-1] = 'special page', [-2] = 'file', -- Media namespace } -- This table holds the namespaces to be looked up from cfg.pagetypes by -- default. cfg.defaultNamespaces = { [0] = true, -- main [6] = true, -- file [10] = true, -- template [14] = true, -- category [828] = true, -- module } -- This table holds the namespaces to be looked up from cfg.pagetypes if -- cfg.defaultnsExtended is set. cfg.extendedNamespaces = { [0] = true, -- main [2] = true, -- user [4] = true, -- project [6] = true, -- file [8] = true, -- mediawiki [10] = true, -- template [12] = true, -- help [14] = true, -- category [100] = true, -- portal [118] = true, -- draft [828] = true, -- module } -- This table holds custom aliases for each namespace. cfg.customNamespaceAliases = { [0] = {'मुख्य'}, } -- The parameter name to set which default namespace values to be looked up from -- cfg.pagetypes. cfg.defaultns = 'defaultns' -- The value of cfg.defaultns to set all namespaces, including talk. cfg.defaultnsAll = 'all' -- The value of cfg.defaultns to set the namespaces listed in -- cfg.extendedNamespaces cfg.defaultnsExtended = 'extended' -- The value of cfg.defaultns to set no default namespaces. cfg.defaultnsNone = 'none' -- The parameter name to use for talk pages. cfg.talk = 'वार्ता' -- The default value for talk pages. cfg.talkDefault = 'वार्ता पृष्ठ' -- The parameter name to use for disambiguation pages page. cfg.dab = 'dab' -- The parameter name to use for non-existent pages. cfg.ne = 'nonexistent' cfg.neDefault = 'पृष्ठ' cfg.softRedirect = 'soft_redirect' cfg.softRedirectDefault = 'redirect' cfg.sia = 'sia' cfg.siaDefault = 'लेख' cfg.rfd = 'redirect' cfg.rfdDefault = 'redirect' -- This table holds the different possible aliases for disambiguation-class -- pages. These should be lower-case. cfg.dabAliases = { ['disambiguation'] = true, ['disambig'] = true, ['disamb'] = true, ['dab'] = true, } -- The default value for disambiguation pages. cfg.dabDefault = 'page' -- The parameter name to use for N/A-class page. cfg.na = 'na' -- This table holds the different possible aliases for N/A-class pages. These -- should be lower-case. cfg.naAliases = { ['na'] = true, ['n/a'] = true, } -- The default value for N/A-class pages. cfg.naDefault = 'page' -- The parameter name to use for redirects. cfg.redirect = 'redirect' -- The default value to use for redirects. cfg.redirectDefault = 'redirect' -- The parameter name for undefined namespaces. cfg.other = 'other' -- The value used if the module detects an undefined namespace. cfg.otherDefault = 'page' -- The usual suffix denoting a plural. cfg.plural = 's' -- This table holds plurals not formed by a simple suffix. cfg.irregularPlurals = { ["category"] = "categories" } -------------------------------------------------------------------------------- -- End configuration data -- -------------------------------------------------------------------------------- return cfg -- Don't edit this line 66gsnung1cnqxqx4tkvg5l0h42gg65s 33044 33043 2026-07-16T20:03:02Z SM7 1879 लोकलाइजेशन 33044 Scribunto text/plain -------------------------------------------------------------------------------- -- Module:Pagetype configuration data -- -- This page holds localisation and configuration data for Module:Pagetype. -- -------------------------------------------------------------------------------- local cfg = {} -- Don't edit this line. -------------------------------------------------------------------------------- -- Start configuration data -- -------------------------------------------------------------------------------- -- This table holds the default page types for each namespace. Keys to this -- table should be integers that can be used as keys to mw.site.namespaces. cfg.pagetypes = { [0] = 'लेख', -- Main namespace [2] = 'सदस्य पृष्ठ', [4] = 'परियोजना पृष्ठ', [6] = 'फ़ाइल', [8] = 'इंटरफेस पृष्ठ', -- MediaWiki namespace [10] = 'साँचा', [12] = 'सहायता पृष्ठ', [14] = 'श्रेणी', [100] = 'portal', [118] = 'draft', [126] = 'MOS page', [710] = 'Timed Text page', [828] = 'मॉड्यूल', [1728] = 'event page', [2300] = 'gadget', [2302] = 'gadget definition', [-1] = 'special page', [-2] = 'फ़ाइल', -- Media namespace } -- This table holds the namespaces to be looked up from cfg.pagetypes by -- default. cfg.defaultNamespaces = { [0] = true, -- main [6] = true, -- file [10] = true, -- template [14] = true, -- category [828] = true, -- module } -- This table holds the namespaces to be looked up from cfg.pagetypes if -- cfg.defaultnsExtended is set. cfg.extendedNamespaces = { [0] = true, -- main [2] = true, -- user [4] = true, -- project [6] = true, -- file [8] = true, -- mediawiki [10] = true, -- template [12] = true, -- help [14] = true, -- category [100] = true, -- portal [118] = true, -- draft [828] = true, -- module } -- This table holds custom aliases for each namespace. cfg.customNamespaceAliases = { [0] = {'मुख्य'}, } -- The parameter name to set which default namespace values to be looked up from -- cfg.pagetypes. cfg.defaultns = 'defaultns' -- The value of cfg.defaultns to set all namespaces, including talk. cfg.defaultnsAll = 'all' -- The value of cfg.defaultns to set the namespaces listed in -- cfg.extendedNamespaces cfg.defaultnsExtended = 'extended' -- The value of cfg.defaultns to set no default namespaces. cfg.defaultnsNone = 'none' -- The parameter name to use for talk pages. cfg.talk = 'वार्ता' -- The default value for talk pages. cfg.talkDefault = 'वार्ता पृष्ठ' -- The parameter name to use for disambiguation pages page. cfg.dab = 'dab' -- The parameter name to use for non-existent pages. cfg.ne = 'nonexistent' cfg.neDefault = 'पृष्ठ' cfg.softRedirect = 'soft_redirect' cfg.softRedirectDefault = 'redirect' cfg.sia = 'sia' cfg.siaDefault = 'लेख' cfg.rfd = 'redirect' cfg.rfdDefault = 'redirect' -- This table holds the different possible aliases for disambiguation-class -- pages. These should be lower-case. cfg.dabAliases = { ['disambiguation'] = true, ['disambig'] = true, ['disamb'] = true, ['dab'] = true, } -- The default value for disambiguation pages. cfg.dabDefault = 'page' -- The parameter name to use for N/A-class page. cfg.na = 'na' -- This table holds the different possible aliases for N/A-class pages. These -- should be lower-case. cfg.naAliases = { ['na'] = true, ['n/a'] = true, } -- The default value for N/A-class pages. cfg.naDefault = 'पृष्ठ' -- The parameter name to use for redirects. cfg.redirect = 'redirect' -- The default value to use for redirects. cfg.redirectDefault = 'redirect' -- The parameter name for undefined namespaces. cfg.other = 'other' -- The value used if the module detects an undefined namespace. cfg.otherDefault = 'पृष्ठ' -- The usual suffix denoting a plural. cfg.plural = 's' -- This table holds plurals not formed by a simple suffix. cfg.irregularPlurals = { ["category"] = "categories" } -------------------------------------------------------------------------------- -- End configuration data -- -------------------------------------------------------------------------------- return cfg -- Don't edit this line 7wo933dxmq11dg9bxj2pun1lefhmaxw साँचा:Yesno 10 9281 33045 2026-07-16T20:04:19Z SM7 1879 From [[w:en:Template:Yesno]] 33045 wikitext text/x-wiki {{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }} |no |n |f |false |off |0 = {{{no|}}} | = {{{blank|{{{no|}}}}}} |¬ = {{{¬|}}} |yes |y |t |true |on |1 = {{{yes|yes}}} |#default = {{{def|{{{yes|yes}}}}}} }}<noinclude> {{Documentation}} </noinclude> ap97tktff18ii0muqd5f4eezydumg5v मॉड्यूल:Wikitext Parsing 828 9282 33046 2026-07-16T20:05:24Z SM7 1879 From [[w:en:Module:Wikitext Parsing]] 33046 Scribunto text/plain require("strict") --Helper functions local function startswith(text, subtext) return string.sub(text, 1, #subtext) == subtext end local function endswith(text, subtext) return string.sub(text, -#subtext, -1) == subtext end local function allcases(s) return s:gsub("%a", function(c) return "["..c:upper()..c:lower().."]" end) end local trimcache = {} local whitespace = {[" "]=1, ["\n"]=1, ["\t"]=1, ["\r"]=1} local function cheaptrim(str) --mw.text.trim is surprisingly expensive, so here's an alternative approach local quick = trimcache[str] if quick then return quick else -- local out = string.gsub(str, "^%s*(.-)%s*$", "%1") local lowEnd local strlen = #str for i = 1,strlen do if not whitespace[string.sub(str, i, i)] then lowEnd = i break end end if not lowEnd then trimcache[str] = "" return "" end for i = strlen,1,-1 do if not whitespace[string.sub(str, i, i)] then local out = string.sub(str, lowEnd, i) trimcache[str] = out return out end end end end --[=[ Implementation notes ---- NORMAL HTML TAGS ---- Tags are very strict on how they want to start, but loose on how they end. The start must strictly follow <[tAgNaMe](%s|>) with no room for whitespace in the tag's name, but may then flow as they want afterwards, making <div\nclass\n=\n"\nerror\n"\n> valid There's no sense of escaping < or > E.g. <div class="error\>"> will end at \> despite it being inside a quote <div class="<span class="error">error</span>"> will not process the larger div If a tag has no end, it will consume all text instead of not processing ---- NOPROCESSING TAGS (nowiki, pre, syntaxhighlight, source, etc.) ---- (In most comments, <source> will not be mentioned. This is because it is the deprecated version of <syntaxhighlight>) No-Processing tags have some interesting differences to the above rules. For example, their syntax is a lot stricter. While an opening tag appears to follow the same set of rules, A closing tag can't have any sort of extra formatting period. While </div a/a> is valid, </nowiki a/a> isn't - only newlines and spaces/tabs are allowed in closing tags. Note that, even though <pre> tags cause a visual change when the ending tag has extra formatting, it won't cause the no-processing effects. For some reason, the format must be strict for that to apply. Both the content inside the tag pair and the content inside each side of the pair is not processed. E.g. <nowiki |}}>|}}</nowiki> would have both of the |}} escaped in practice. When something in the code is referenced to as a "Nowiki Tag", it means a tag which causes wiki text to not be processed, which includes <nowiki>, <pre>, and <syntaxhighlight> Since we only care about these tags, we can ignore the idea of an intercepting tag preventing processing, and just go straight for the first ending we can find If there is no ending to find, the tag will NOT consume the rest of the text in terms of processing behaviour (though <pre> will appear to have an effect). Even if there is no end of the tag, the content inside the opening half will still be unprocessed, meaning {{X20|<nowiki }}>}} wouldn't end at the first }} despite there being no ending to the tag. Note that there are some tags, like <math>, which also function like <nowiki> which are included in this aswell. Some other tags, like <ref>, have far too unpredictable behaviour to be handled currently (they'd have to be split and processed as something seperate - its complicated, but maybe not impossible.) I suspect that every tag listed in [[Special:Version]] may behave somewhat like this, but that's far too many cases worth checking for rarely used tags that may not even have a good reason to contain {{ or }} anyways, so we leave them alone. ---- HTML COMMENTS AND INCLUDEONLY ---- HTML Comments are about as basic as it could get for this Start at <!--, end at -->, no extra conditions. Simple enough If a comment has no end, it will eat all text instead of not being processed includeonly tags function mostly like a regular nowiki tag, with the exception that the tag will actually consume all future text if not given an ending as opposed to simply giving up and not changing anything. Due to complications and the fact that this is far less likely to be present on a page, aswell as being something that may not want to be escaped, includeonly tags are ignored during our processing --]=] local validtags = {nowiki=1, pre=1, syntaxhighlight=1, source=1, math=1} --This function expects the string to start with the tag local function TestForNowikiTag(text, scanPosition) local tagName = (string.match(text, "^<([^\n />]+)", scanPosition) or ""):lower() if not validtags[tagName] then return nil end local nextOpener = string.find(text, "<", scanPosition+1) or -1 local nextCloser = string.find(text, ">", scanPosition+1) or -1 if nextCloser > -1 and (nextOpener == -1 or nextCloser < nextOpener) then local startingTag = string.sub(text, scanPosition, nextCloser) --We have our starting tag (E.g. '<pre style="color:red">') --Now find our ending... if endswith(startingTag, "/>") then --self-closing tag (we are our own ending) return { Tag = tagName, Start = startingTag, Content = "", End = "", Length = #startingTag } else local endingTagStart, endingTagEnd = string.find(text, "</"..allcases(tagName).."[ \t\n]*>", scanPosition) if endingTagStart then --Regular tag formation local endingTag = string.sub(text, endingTagStart, endingTagEnd) local tagContent = string.sub(text, nextCloser+1, endingTagStart-1) return { Tag = tagName, Start = startingTag, Content = tagContent, End = endingTag, Length = #startingTag + #tagContent + #endingTag } else --Content inside still needs escaping (also linter error!) return { Tag = tagName, Start = startingTag, Content = "", End = "", Length = #startingTag } end end end return nil end local function TestForComment(text, scanPosition) --Like TestForNowikiTag but for <!-- --> if string.match(text, "^<!%-%-", scanPosition) then local commentEnd = string.find(text, "-->", scanPosition+4, true) if commentEnd then return { Start = "<!--", End = "-->", Content = string.sub(text, scanPosition+4, commentEnd-1), Length = commentEnd-scanPosition+3 } else --Consumes all text if not given an ending return { Start = "<!--", End = "", Content = string.sub(text, scanPosition+4), Length = #text-scanPosition+1 } end end return nil end --[[ Implementation notes The goal of this function is to escape all text that wouldn't be parsed if it was preprocessed (see above implementation notes). Using keepComments will keep all HTML comments instead of removing them. They will still be escaped regardless to avoid processing errors --]] local function PrepareText(text, keepComments) local newtext = {} local scanPosition = 1 while true do local NextCheck = string.find(text, "<[NnSsPpMm!]", scanPosition) --Advance to the next potential tag we care about if not NextCheck then --Done newtext[#newtext+1] = string.sub(text,scanPosition) break end newtext[#newtext+1] = string.sub(text,scanPosition,NextCheck-1) scanPosition = NextCheck local Comment = TestForComment(text, scanPosition) if Comment then if keepComments then newtext[#newtext+1] = Comment.Start .. mw.text.nowiki(Comment.Content) .. Comment.End end scanPosition = scanPosition + Comment.Length else local Tag = TestForNowikiTag(text, scanPosition) if Tag then local newTagStart = "<" .. mw.text.nowiki(string.sub(Tag.Start,2,-2)) .. ">" local newTagEnd = Tag.End == "" and "" or --Respect no tag ending "</" .. mw.text.nowiki(string.sub(Tag.End,3,-2)) .. ">" local newContent = mw.text.nowiki(Tag.Content) newtext[#newtext+1] = newTagStart .. newContent .. newTagEnd scanPosition = scanPosition + Tag.Length else --Nothing special, move on... newtext[#newtext+1] = string.sub(text, scanPosition, scanPosition) scanPosition = scanPosition + 1 end end end return table.concat(newtext, "") end --[=[ Implementation notes This function is an alternative to Transcluder's getParameters which considers the potential for a singular { or } or other odd syntax that %b doesn't like to be in a parameter's value. When handling the difference between {{ and {{{, mediawiki will attempt to match as many sequences of {{{ as possible before matching a {{ E.g. {{{{A}}}} -> { {{{A}}} } {{{{{{{{Text|A}}}}}}}} -> {{ {{{ {{{Text|A}}} }}} }} If there aren't enough triple braces on both sides, the parser will compromise for a template interpretation. E.g. {{{{A}} }} -> {{ {{ A }} }} While there are technically concerns about things such as wikilinks breaking template processing (E.g. {{[[}}]]}} doesn't stop at the first }}), it shouldn't be our job to process inputs perfectly when the input has garbage ({ / } isn't legal in titles anyways, so if something's unmatched in a wikilink, it's guaranteed GIGO) Setting dontEscape will prevent running the input text through EET. Avoid setting this to true if you don't have to set it. Returned values: A table of all templates. Template data goes as follows: Text: The raw text of the template Name: The name of the template Args: A list of arguments Children: A list of immediate template children --]=] --Helper functions local function boundlen(pair) return pair.End-pair.Start+1 end --Main function local function ParseTemplates(InputText, dontEscape) --Setup if not dontEscape then InputText = PrepareText(InputText) end local function finalise(text) if not dontEscape then return mw.text.decode(text) else return text end end local function CreateContainerObj(Container) Container.Text = {} Container.Args = {} Container.ArgOrder = {} Container.Children = {} -- Container.Name = nil -- Container.Value = nil -- Container.Key = nil Container.BeyondStart = false Container.LastIndex = 1 Container.finalise = finalise function Container:HandleArgInput(character, internalcall) if not internalcall then self.Text[#self.Text+1] = character end if character == "=" then if self.Key then self.Value[#self.Value+1] = character else self.Key = cheaptrim(self.Value and table.concat(self.Value, "") or "") self.Value = {} end else --"|" or "}" if not self.Name then self.Name = cheaptrim(self.Value and table.concat(self.Value, "") or "") self.Value = nil else self.Value = self.finalise(self.Value and table.concat(self.Value, "") or "") if self.Key then self.Key = self.finalise(self.Key) self.Args[self.Key] = cheaptrim(self.Value) self.ArgOrder[#self.ArgOrder+1] = self.Key else local Key = tostring(self.LastIndex) self.Args[Key] = self.Value self.ArgOrder[#self.ArgOrder+1] = Key self.LastIndex = self.LastIndex + 1 end self.Key = nil self.Value = nil end end end function Container:AppendText(text, ftext) self.Text[#self.Text+1] = (ftext or text) if not self.Value then self.Value = {} end self.BeyondStart = self.BeyondStart or (#table.concat(self.Text, "") > 2) if self.BeyondStart then self.Value[#self.Value+1] = text end end function Container:Clean(IsTemplate) self.Text = table.concat(self.Text, "") if self.Value and IsTemplate then self.Value = {string.sub(table.concat(self.Value, ""), 1, -3)} --Trim ending }} self:HandleArgInput("|", true) --Simulate ending end self.Value = nil self.Key = nil self.BeyondStart = nil self.LastIndex = nil self.finalise = nil self.HandleArgInput = nil self.AppendText = nil self.Clean = nil end return Container end --Step 1: Find and escape the content of all wikilinks on the page, which are stronger than templates (see implementation notes) local scannerPosition = 1 local wikilinks = {} local openWikilinks = {} while true do local Position, _, Character = string.find(InputText, "([%[%]])%1", scannerPosition) if not Position then --Done break end scannerPosition = Position+2 --+2 to pass the [[ / ]] if Character == "[" then --Add a [[ to the pending wikilink queue openWikilinks[#openWikilinks+1] = Position else --Pair up the ]] to any available [[ if #openWikilinks >= 1 then local start = table.remove(openWikilinks) --Pop the latest [[ wikilinks[start] = {Start=start, End=Position+1, Type="Wikilink"} --Note the pair end end end --Step 2: Find the bounds of every valid template and variable ({{ and {{{) local scannerPosition = 1 local templates = {} local variables = {} local openBrackets = {} while true do local Start, _, Character = string.find(InputText, "([{}])%1", scannerPosition) if not Start then --Done (both 9e9) break end local _, End = string.find(InputText, "^"..Character.."+", Start) scannerPosition = Start --Get to the {{ / }} set if Character == "{" then --Add the {{+ set to the queue openBrackets[#openBrackets+1] = {Start=Start, End=End} else --Pair up the }} to any available {{, accounting for {{{ / }}} local BracketCount = End-Start+1 while BracketCount >= 2 and #openBrackets >= 1 do local OpenSet = table.remove(openBrackets) if boundlen(OpenSet) >= 3 and BracketCount >= 3 then --We have a {{{variable}}} (both sides have 3 spare) variables[OpenSet.End-2] = {Start=OpenSet.End-2, End=scannerPosition+2, Type="Variable"} --Done like this to ensure chronological order BracketCount = BracketCount - 3 OpenSet.End = OpenSet.End - 3 scannerPosition = scannerPosition + 3 else --We have a {{template}} (both sides have 2 spare, but at least one side doesn't have 3 spare) templates[OpenSet.End-1] = {Start=OpenSet.End-1, End=scannerPosition+1, Type="Template"} --Done like this to ensure chronological order BracketCount = BracketCount - 2 OpenSet.End = OpenSet.End - 2 scannerPosition = scannerPosition + 2 end if boundlen(OpenSet) >= 2 then --Still has enough data left, leave it in openBrackets[#openBrackets+1] = OpenSet end end end scannerPosition = End --Now move past the bracket set end --Step 3: Re-trace every object using their known bounds, collecting our parameters with (slight) ease local scannerPosition = 1 local activeObjects = {} local finalObjects = {} while true do local LatestObject = activeObjects[#activeObjects] --Commonly needed object local NNC, _, Character --NNC = NextNotableCharacter if LatestObject then NNC, _, Character = string.find(InputText, "([{}%[%]|=])", scannerPosition) else NNC, _, Character = string.find(InputText, "([{}])", scannerPosition) --We are only after templates right now end if not NNC then break end if NNC > scannerPosition and LatestObject then local scannedContent = string.sub(InputText, scannerPosition, NNC-1) LatestObject:AppendText(scannedContent, finalise(scannedContent)) end scannerPosition = NNC+1 if Character == "{" or Character == "[" then local Container = templates[NNC] or variables[NNC] or wikilinks[NNC] if Container then CreateContainerObj(Container) if Container.Type == "Template" then Container:AppendText("{{") scannerPosition = NNC+2 elseif Container.Type == "Variable" then Container:AppendText("{{{") scannerPosition = NNC+3 else --Wikilink Container:AppendText("[[") scannerPosition = NNC+2 end if LatestObject and Container.Type == "Template" then --Only templates count as children LatestObject.Children[#LatestObject.Children+1] = Container end activeObjects[#activeObjects+1] = Container elseif LatestObject then LatestObject:AppendText(Character) end elseif Character == "}" or Character == "]" then if LatestObject then LatestObject:AppendText(Character) if LatestObject.End == NNC then if LatestObject.Type == "Template" then LatestObject:Clean(true) finalObjects[#finalObjects+1] = LatestObject else LatestObject:Clean(false) end activeObjects[#activeObjects] = nil local NewLatest = activeObjects[#activeObjects] if NewLatest then NewLatest:AppendText(LatestObject.Text) --Append to new latest end end end else --| or = if LatestObject then LatestObject:HandleArgInput(Character) end end end --Step 4: Fix the order local FixedOrder = {} local SortableReference = {} for _,Object in next,finalObjects do SortableReference[#SortableReference+1] = Object.Start end table.sort(SortableReference) for i = 1,#SortableReference do local start = SortableReference[i] for n,Object in next,finalObjects do if Object.Start == start then finalObjects[n] = nil Object.Start = nil --Final cleanup Object.End = nil Object.Type = nil FixedOrder[#FixedOrder+1] = Object break end end end --Finished, return return FixedOrder end local p = {} --Main entry points p.PrepareText = PrepareText p.ParseTemplates = ParseTemplates --Extra entry points, not really required p.TestForNowikiTag = TestForNowikiTag p.TestForComment = TestForComment return p --[==[ console tests local s = [=[Hey!{{Text|<nowiki | ||> Hey! }} A</nowiki>|<!--AAAAA|AAA-->Should see|Shouldn't see}}]=] local out = p.PrepareText(s) mw.logObject(out) local s = [=[B<!-- Hey! -->A]=] local out = p.TestForComment(s, 2) mw.logObject(out); mw.log(string.sub(s, 2, out.Length)) local a = p.ParseTemplates([=[ {{User:Aidan9382/templates/dummy |A|B|C {{{A|B}}} { } } { |<nowiki>D</nowiki> |<pre>E |F</pre> |G|=|a=|A = [[{{PAGENAME}}|A=B]]{{Text|1==<nowiki>}}</nowiki>}}|A B=Success}} ]=]) mw.logObject(a) ]==] 1pc5nwfjm9r5mkdrg3s2ci608uixfb7 साँचा:FULLBASEPAGENAME 10 9283 33047 2026-07-16T20:07:38Z SM7 1879 From [[w:en:Template:FULLBASEPAGENAME]] 33047 wikitext text/x-wiki {{#if: {{Ns has subpages | {{#if:{{{1|}}}|{{NAMESPACE:{{{1}}}}}|{{NAMESPACE}}}} }} | {{#if: {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#titleparts:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}|-1}} | {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}} }} | {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}} }}<noinclude> {{documentation}} </noinclude> ixr6ocr5zopgbfiuog5gfof9h5qt70j