Template:Simgear 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)
(Added a depreciation note about using the {{simgear source}} template instead.)
 
(2 intermediate revisions by 2 users not shown)
Line 17: Line 17:
}}<noinclude>
}}<noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__ {{depreciated|The newer {{tl|simgear source}} template provides far greater functionality and should be used instead.  This is not a subtemplate of the master {{tl|repo link}} template.}}
== Goal ==
== Goal ==
This template can be used when linking to source files or directories in the [[SimGear]] repository.
This template can be used when linking to source files or directories in the [[SimGear]] repository.
Line 73: Line 73:


== Related templates ==
== Related templates ==
* {{tl|repo link}}
{{repo link/doc related}}
* {{tl|flightgear file}}
* {{tl|fgdata file}}
* {{tl|fgaddon url}}


}}
}}

Latest revision as of 17:20, 23 May 2016

simgear/

The following template description is not displayed when the template is inserted in an article.
Deprecated  The newer {{simgear source}} template provides far greater functionality and should be used instead. This is not a subtemplate of the master {{repo link}} template.

Goal

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

Usage

{{simgear 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 SimGear 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

{{simgear file}}

simgear/

Path given

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

simgear/simgear/canvas/Canvas.cxx

Path and a commit reference given

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

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

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

simgear/simgear/canvas/Canvas.cxx (4f94c2)

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

simgear/simgear/canvas/Canvas.cxx (4f94c22241e5ef90026fd087168b24a13ee5ef9b)

Line parameter given

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

simgear/simgear/canvas/Canvas.cxx (line 5)

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

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

Custom label given

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

Canvas.cxx

Nopath parameter given

{{simgear file|simgear/canvas/Canvas.cxx|nopath=1}}

simgear/canvas/Canvas.cxx

Related templates