Template:Simgear file

From FlightGear wiki
Revision as of 10:47, 25 September 2015 by Red Leader (talk | contribs) (Add line parameter; fix "simgear/simgear/..." > "simgear.." abbreviation bug; slightly shorten abbreviated commit IDs to match the SF abbreviation; add link to {{fgaddon url}})
Jump to navigation Jump to search

simgear/

The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used when linking to source files or directories in the SimGear repository.

Usage

{{simgear file|path|reference|line}}

Both parameters are optional.

path
What follows after /tree/ in the URL. Can be the path to a file or a directory. If empty, the link will point to the root of the SimGear repository.
reference
A commit reference. Usually the SHA-1 commit ID (which can be abbreviated), but it can also be a tag or a branch name. If empty, the link will point to the next branch.
line
A line number. This should just be a single number, as SourceForge does not support multiple line numbers.
Note This parameter will not work if the linked file is of a certain file type, such as .nas. However, this is to do with SourceForge, not the template.

Examples

No parameters given

{{simgear file}}

simgear/

Path given

{{simgear file|simgear/canvas/Canvas.cxx}}

simgear/canvas/Canvas.cxx

Path and a commit reference given

{{simgear file|simgear/canvas/Canvas.cxx|release/2.12.0}}

simgear/canvas/Canvas.cxx (release/2.12.0)

{{simgear file|simgear/canvas/Canvas.cxx|4f94c2}}

simgear/canvas/Canvas.cxx (4f94c2)

{{simgear file|simgear/canvas/Canvas.cxx|4f94c22241e5ef90026fd087168b24a13ee5ef9b}}

simgear/canvas/Canvas.cxx (4f94c22241e5ef90026fd087168b24a13ee5ef9b)

Files not in simgear/

{{simgear file|version}}

simgear/version

Line parameter given

{{simgear file|simgear/canvas/Canvas.cxx||5}}

simgear/canvas/Canvas.cxx (line 5)

{{simgear file|simgear/canvas/Canvas.cxx|4f94c2|5}}

simgear/canvas/Canvas.cxx (4f94c2, line 5)

Related templates