Difference between revisions of "Module:URL"

From blackwiki
Jump to navigation Jump to search
blackwiki>Pigsonthewing
(ce)
blackwiki>Renamed user mou89p43twvqcvm8ut9w3
(TFD closed as no consensus to merge (using TFDcloser))
Line 1: Line 1:
<noinclude>{{Tfm/dated|page=URL|otherpage=Official URL|link=Wikipedia:Templates for discussion/Log/2016 October 8#Template:URL|type=tiny}}</noinclude><includeonly>{{#invoke:URL|url|1={{{1|}}}|2={{{2|}}}}}</includeonly><noinclude>{{documentation}}</noinclude>
+
<includeonly>{{#invoke:URL|url|1={{{1|}}}|2={{{2|}}}}}</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 22:00, 28 October 2016

50px Module documentation[view] [edit] [history] [purge]

This module implements {{URL}} and {{URL2}}. Please see the template page for documentation.

Lua interface

The p._url(url, text, msg) function may be used by other Lua modules. It returns a formatted Wikitext for the given URL, made suitable for line wrapping using . It takes the following parameters:

url 
REQUIRED. The URL to format.
text 
OPTIONAL. Display text to put in the Wikitext link. Defaults to a pretty version of the URL.
msg 
OPTIONAL. String. If content is false, n or N, do not emit a help message (using {{tlx}}) when URL is not given.

Example

The following module emits a prettified link to log the user out. It will warp correctly to most widths.

local url = require('Module:URL')._url
local p = {}

p.main = function(frame)
    return url("https://en.wikipedia.org/wiki/Special:UserLogout")
end

return p

See also