Documentation
This module generates an external link to the GitHub repository at the (hopefully) current commit hash of the main branch. It is used for pointing somewhere specific in the codebase.
Usage
{{SourceLink|Resources/Prototypes/Entities/Objects/Tools/lantern.yml#L1}}
... which generates the following link: s/lantern.yml#L1
local SourceLink = {}
function SourceLink.main(frame)
local args = frame:getParent().args
local argPath = args[1]
local lastSlashIndex = argPath:reverse():find("/")
local displayText = argPath:sub(#argPath - lastSlashIndex)
return string.format( "[https://github.com/teamstarcup/starcup/blob/master/%s %s]", argPath, displayText )
end
return SourceLink