Module:FreeBSD: Difference between revisions

From Nasqueron Agora
No edit summary
No edit summary
Line 6: Line 6:
         link = "http://www.freshports.org/" .. frame.args.port
         link = "http://www.freshports.org/" .. frame.args.port
     elseif frame.args.url == '' then
     elseif frame.args.url == '' then
        link = "http://www.freshports.org/" .. frame.args.port
    else
         link = frame.args.url
         link = frame.args.url
     end
     end

Revision as of 23:39, 21 January 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 then
        link = "http://www.freshports.org/" .. frame.args.port
    elseif 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