Jump to content
Wikipedia The Free Encyclopedia

Module:R from fictional object multi/sandbox

From Wikipedia, the free encyclopedia
This is the module sandbox page for Module:R from fictional object multi (diff).
See also the companion subpage for test cases (run).
Module documentation[view] [edit] [history] [purge]
This module depends on the following other modules:

Module:R from fictional object multi is used by {{R from fictional character }}, {{R from fictional element }} and {{R from fictional location }} to handle multiple series tagged with the same redirect.

Usage

[edit ]

Parameter list

[edit ]
Parameter Explanation
1...8 Positional or numbered parameters for each series name.
category The redirect category scheme to be used.
sort An optional sort key for the category.
The above documentation is transcluded from Module:R from fictional object multi/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (edit | run) pages.
Add categories to the /doc subpage. Subpages of this module.
 require("strict")

 localp={}

 localresolveRedir=require("Module:Resolve category redirect").rtarget

 --[[
 Local function which creates the relevent category, either with or without a sort key.
 --]]
 localfunctioncreateCategory(categoryScheme,name,sortKey)
 localcategory=name.." "..categoryScheme
 category=resolveRedir(category)

 if(sortKey)then
 category=category.."|"..sortKey
 end

 return"[[Category:"..category.."]]"
 end

 --[[
 Local function which handles the main process.

 Parameters:
 	-- |1...8=		— required; Positional or numbered parameters for each series name.
 	-- |category=	— required; The redirect category scheme to be used.
 	-- |sort=		— optinal; A sort key for the category.
 --]]
 localfunction_main(args)
 -- If category wasn't set, return error.
 if(notargs.category)then
 returnerror
 end

 localcategories=""
 fori=1,10do
 if(args[i])then
 categories=categories..createCategory(args.category,args[i],args["sort"])
 end
 end

 returncategories
 end

 --[[
 Entry point.
 --]]
 functionp.main(frame)
 localgetArgs=require("Module:Arguments").getArgs
 localargs=getArgs(frame)
 return_main(args)
 end

 returnp

AltStyle によって変換されたページ (->オリジナル) /