![]() |
VOOZH | about |
This module converts a comma separated list of objects into a delimited list of links to said objects.
This module needs to be invoked with a prefix and a delimiter; the prefix is what each link will start with and the delimiter is what separates the objects in the list.
{{Difflink array}}{{Userlink array}}-- Example usage: -- user links: {{#invoke: LinkArray | main | user1, user2... | prefix = User: | delimiter = ,  }} -- diff links: {{#invoke: LinkArray | main | diff1, diff2... | prefix = Special:Diff/ | delimiter = • }} localp={} functionp.main(f) localtbl={} localarrayData=f.args[1] localprefix=f.args.prefix localdelimiter=f.args.delimiter fork,vinipairs(mw.text.split(arrayData,'%s*,%s*'))do tbl[k]='[['..prefix..mw.text.trim(v)..'|'..mw.text.trim(v)..']]' end returntable.concat(tbl,delimiter) end returnp