Module:FreeBSD: Difference between revisions

From Nasqueron Agora
m (Indent)
m (One condition)
Line 3: Line 3:
-- Gets a formatted FreeBSD port link
-- Gets a formatted FreeBSD port link
function p.GetsPortLink(frame)
function p.GetsPortLink(frame)
     if frame.args.url == nil then
     if (frame.args.url == nil or frame.args.url == '') then
        link = "http://www.freshports.org/" .. frame.args.port
    elseif frame.args.url == '' then
         link = "http://www.freshports.org/" .. frame.args.port
         link = "http://www.freshports.org/" .. frame.args.port
     else  
     else  

Revision as of 17:10, 29 October 2013

Documentation for this module may be created at Module:FreeBSD/doc

local p = {}

-- Gets a formatted FreeBSD port link
function p.GetsPortLink(frame)
    if (frame.args.url == nil or frame.args.url == '') then
        link = "http://www.freshports.org/" .. frame.args.port
    else 
        link = frame.args.url
    end
    
    return '[' .. link .. ' ' .. frame.args.port .. ']'
end

return p