Documentation for this module may be created at Module:Purge/doc
-- This module implements [[Template:Purge]].localp={}localfunctionmakeUrlLink(url,display)returnstring.format('[%s %s]',url,display)endfunctionp._main(args)-- Make the URLlocalurldolocaltitleifargs.pagethentitle=mw.title.new(args.page)ifnottitlethenerror(string.format("'%s' is not a valid page name",args.page),2)endelsetitle=mw.title.getCurrentTitle()endifargs.anchorthentitle.fragment=args.anchorendurl=title:fullUrl{action='purge'}end-- Make the displaylocaldisplayifargs.pagethendisplay=args[1]or'Purge'elsedisplay=mw.html.create('span')display:attr('title','Purge this page'):wikitext(args[1]or'Purge')display=tostring(display)end-- Output the HTMLlocalroot=mw.html.create('span')root:addClass('noprint'):addClass('plainlinks'):addClass('purgelink'):wikitext(makeUrlLink(url,display))returntostring(root)endfunctionp.main(frame)localargs=frame:getParent().argsreturnp._main(args)endreturnp
Cookies help us deliver our services. By using our services, you agree to our use of cookies.