Template:Fgdata file: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Add t[ext] and nopath parameters, and change others as per Johan's suggestions at FGW:VP#Repository link templates)
(+rel: Commit link templates)
Line 73: Line 73:


== Related templates ==
== Related templates ==
=== Source link templates ===
* {{tl|repo link}}
* {{tl|repo link}}
* {{tl|fgaddon url}}
* {{tl|flightgear file}}
* {{tl|flightgear file}}
* {{tl|simgear file}}
* {{tl|simgear file}}
* {{tl|fgaddon url}}
 
=== Commit link templates ===
* {{tl|fgaddon revision}}
* {{tl|fgdata commit}}
* {{tl|simgear commit}}
* {{tl|flightgear commit}}


}}
}}

Revision as of 08:12, 26 October 2015

fgdata/

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 fgdata repository.

Usage

{{fgdata file|path|l=|t=|r=|nopath=}}

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 fgdata repository.
l
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.
r
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.
t
Text to show as the URL's label instead of file path.
nopath
Strips off the fgdata/ part of the URL label, leaving just the contents of the path parameter.
Note The t parameter will override this parameter.

Examples

No parameters given

{{fgdata file}}

fgdata/

Path given

{{fgdata file|Nasal/geo.nas}}

fgdata/Nasal/geo.nas

Path and a commit reference given

{{fgdata file|Nasal/geo.nas|r=release/3.6.0}}

fgdata/Nasal/geo.nas (release/3.6.0)

{{fgdata file|Nasal/geo.nas|r=0d4a86}}

fgdata/Nasal/geo.nas (0d4a86)

{{fgdata file|Nasal/geo.nas|r=0d4a86e3d454a526d561be4354e0dd26bb5f6daf}}

fgdata/Nasal/geo.nas (0d4a86e3d454a526d561be4354e0dd26bb5f6daf)

Line parameter given

{{fgdata file|Huds/default.xml|l=4}}

fgdata/Huds/default.xml (line 4)

{{fgdata file|Huds/default.xml|r=5ae515|l=4}}

fgdata/Huds/default.xml (5ae515, line 4)

Custom label given

{{fgdata file|Nasal/geo.nas|t=geo.nas}}

geo.nas

Nopath parameter given

{{fgdata file|Huds/default.xml|nopath=1}}

Huds/default.xml

Related templates

Source link templates

Commit link templates