Movatterモバイル変換


[0]ホーム

URL:


Jump to content
विकिपीडिया
खोज

Module:Parameter names example

विकिपीडिया से
Module documentation[create] [purge]
You might want tocreate a documentation page for thisScribunto module.
Editors can experiment in this module's sandbox(create |mirror) and testcases(create) pages.
Add categories to the/doc subpage.Subpages of this module.
-- This module implements {{parameter names example}}.localp={}localfunctionmakeParam(s)locallb='{'localrb='}'returnlb:rep(3)..s..rb:rep(3)endlocalfunctionitalicize(s)return"''"..s.."''"endlocalfunctionplain(s)returnsendfunctionp._main(args,frame)-- Find how we want to format the arguments to the template.localformatFuncifargs._display=='italics'orargs._display=='italic'thenformatFunc=italicizeelseifargs._display=='plain'thenformatFunc=plainelseformatFunc=makeParamend-- Build the table of template arguments.localtargs={}fork,vinpairs(args)doiftype(k)=='number'thentargs[v]=formatFunc(v)elseifnotk:find('^_')thentargs[k]=vendend-- Find the template name.localtemplateifargs._templatethentemplate=args._templateelselocalcurrentTitle=mw.title.getCurrentTitle()ifcurrentTitle.prefixedText:find('/sandbox$')thentemplate=currentTitle.prefixedTextelsetemplate=currentTitle.basePageTitle.prefixedTextendend-- Call the template with the arguments.frame=frameormw.getCurrentFrame()localsuccess,result=pcall(frame.expandTemplate,frame,{title=template,args=targs})ifsuccessthenreturnresultelsereturn''endendfunctionp.main(frame)localargs=require('Module:Arguments').getArgs(frame,{wrappers='टेम्पलेट:Parameter names example'})returnp._main(args,frame)endreturnp
"https://bh.wikipedia.org/w/index.php?title=Module:Parameter_names_example&oldid=652410" से लिहल गइल

[8]ページ先頭

©2009-2025 Movatter.jp