Template:Fg root file

From FlightGear wiki
Jump to navigation Jump to search


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


This template is for creating links prefixed with $FG_ROOT for files in the FGData git version control repository. It is a subtemplate of the master {{repo link}} template designed to be specific for creating FGData links prefixed with $FG_ROOT.


{{fg root file
| branch     =
| commit     =
| path       =
| line       =
| view       =

All parameters are optional.

Parameter Description Abbreviated
branch The branch name. This defaults to next. For SourceForge git repositories, if the character / is present in the branch name, the text /~ must be appended to the branch. b optional
commit The commit identifier (git hash). This defaults to HEAD. c optional
path The file or directory path. f 1 optional
line The line number(s) of the file to display.
  • For SourceForge: Use a single line number.
l optional
view View to display:
  • For SourceForge use one of tree, log, commit, or rss. If a commit is specified (the commit parameter is set and path is not), the default is commit. Otherwise the default is tree.
v optional


In this section, the following notation will be used:

Angular brackets + lower case text <xyz>
Template parameters.
Angular brackets + upper case text <XYZ>
Template constructed text.
Square brackets [xyz]
Optional text, only added if the parameter is set.
Or symbol |
The value on the left, if present, otherwise the value on the right of the symbol.


The general design is:

<cmd> <opt> [<URL> <TEXT>] <post>

Here the square brackets do not denote optional text, but will instead produce a Mediawiki link. This can be modified by setting full = 1 to produce:

<cmd> <opt> <URL> <post>

Site: SourceForge

Project page

For a normal SourceForge project page, the base URL is respectively constructed as:


For the type parameter value of git, a login is allowed:


SourceForge <URL> for 'type=git'

For this parameter value, the complete <URL> value will be:


SourceForge <URL> for 'type=git web'

For this parameter value, the <URL> value will be:


The <VIEW> value for different values of view is:


If the parameter setting view=rss is used, a different <URL> value is produced:


SourceForge URL <TEXT> for 'type=git' and 'type=git web'

The link text <TEXT>, if the full parameter is not set, will be:

<proj>/<repo>/<commit|branch>[/<path>][#l<line>] <DESC>

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>] <DESC>

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>] <DESC>

The RSS feed is a special case in that <TEXT> will be one of:

<proj>/<repo> <DESC>
<pre> <DESC>

The description <DESC> is dependent on the view parameter:

log view.
commit view.
RSS feed.

The text parameter trumps all, and <TEXT> is simply:


Plain text

To create a URL or link as plain text and avoid external links, simply use the {{#tag:tagname|content}} magic word construct:

  {{repo link
  | full = 1


To use the <code> tags:

  {{repo link
  | full = 1



No parameters

{{fg root file}}



{{fg root file
| path = Aircraft-uiuc/Cessna172/aircraft.dat


File and a tag

{{fg root file
| path   = Aircraft-uiuc/Cessna172/aircraft.dat
| branch = version/2016.1.1/~

$FG_ROOT/Aircraft-uiuc/Cessna172/aircraft.dat (branch version/2016.1.1/~)

File and a commit

{{fg root file
| path   = Translations/fr/options.xml
| commit = 7fc0e4

$FG_ROOT/Translations/fr/options.xml (commit 7fc0e4)

{{fg root file
| path   = Translations/fr/options.xml
| commit = 7fc0e42a8b9bc9394db001f7435907d0285e4a24

$FG_ROOT/Translations/fr/options.xml (commit 7fc0e42a8b9bc9394db001f7435907d0285e4a24)


{{fg root file
| commit = 0b69ee
| view   = commit

$FG_ROOT (commit 0b69ee) commit view

File and line number

{{fg root file
| path = AI/nimitz_demo.xml
| line = 4


File, line number, and commit

{{fg root file
| path   = AI/nimitz_demo.xml
| commit = 7b53516a9619f598721d7ee34d6a446367e9d9cd
| line   = 85

$FG_ROOT/AI/nimitz_demo.xml#l85 (commit 7b53516a9619f598721d7ee34d6a446367e9d9cd)

Aliased parameters

This is for https://sourceforge.net/p/flightgear/fgdata/ci/version/2016.1.1/~/tree/Aircraft-uiuc/Cessna172/aircraft.dat.

{{fg root file
| f = Aircraft-uiuc/Cessna172/aircraft.dat
| b = version/2016.1.1/~

$FG_ROOT/Aircraft-uiuc/Cessna172/aircraft.dat (branch version/2016.1.1/~).

Numbered parameters

This is for https://sourceforge.net/p/flightgear/fgdata/ci/version/2016.1.1/~/tree/Aircraft-uiuc/Cessna172/aircraft.dat.

{{fg root file | Aircraft-uiuc/Cessna172/aircraft.dat | b = version/2016.1.1/~ }}.

$FG_ROOT/Aircraft-uiuc/Cessna172/aircraft.dat (branch version/2016.1.1/~).

Related templates