Creates links and changes wikitext when it detects external links.
Syntax[]
Creating a simple link[]
{{#invoke:links|main|<page>|<label>|type = <ext>}}
Creating a batch of links[]
{{links|<batch>|<page/url label type>|<page1 label1 type1>|<page2 label2 type2>|separator = <separatortext>|delimiter = <delimitertext>}}
Parameter description[]
- Page (mandatory) = url, e.g. http://google.com or Lua .
- label (optional)= label for the link
- type (optional)= "ext" for external links
Examples[]
{{#invoke:links|main|fandom.com|Fandom|type=ext}}Fandom |
{{#invoke:links|main|w:Help:Lua}}w:Help:Lua |
{{#invoke:links|main|http://wikipedia.org}}[1] |
{{#invoke:links|batch|http://wikipedia.org > Wikipedia|luamods > List of Lua Modules|delimiter=>}}Wikipedia • List of Lua Modules • |
Module information
Functions
p.link
This function generates a wiki link.
Parameters
| Name | Type | purpose |
|---|---|---|
| url | string | The url to convert to wikitext. |
| desc | string | The caption or description of the url. |
| typ | string | The type of link, (local or ext). |
| Return type | Return purpose |
|---|---|
| string | A formated wikilink. |
p.main
Entry point for function that generates a wiki link.
Parameters
| Name | Type | purpose |
|---|---|---|
| frame | table | Contains frame from invoked module. |
| Return type | Return purpose |
|---|---|
| string | A formated wikilink. |
p.batch
Entry point for function that generates several wiki links.
Parameters
| Name | Type | purpose |
|---|---|---|
| frame | table | Contains frame from invoked module. |
| Return type | Return purpose |
|---|---|
| string | A formated string containing one or more wikilinks. |
p.createLinkBatch
This creates and formats many links.
Parameters
| Name | Type | purpose |
|---|---|---|
| links | table | a table containing links, e.g. {'Lua label1 type', 'www.google.com google ext'}. |
| separator | string | a separator between each link. |
| delimiter | string | an optional delimiter that will separate the label, link & type. |
| Return type | Return purpose |
|---|---|
| string | A formated string containing one or more wikilinks. |