Module:FreeBSD: Difference between revisions

From Nasqueron Agora
(Created page with "local p = {} -- Formats a FreeBSD port link function p.PrintsFreeBSDPort(frame) if frame.args[2] == nil then link = "http://www.freshports.org/" .. frame.args[1] ...")
 
(freshports.org now has HTTPS support)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}


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


return p
return p

Latest revision as of 15:13, 13 February 2017

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 = "https://www.freshports.org/" .. frame.args.port
    else 
        link = frame.args.url
    end
    
    return '[' .. link .. ' ' .. frame.args.port .. ']'
end

return p