Template:Fgaddon aircraft source: Difference between revisions
(Internal FGAddon links.) |
(Elimination of the 'file' parameter made redundant by {{fgaddon aircraft url}}. The template now defaults to producing Mediawiki links rather than text URLs, but the 'full' param has been added for the subtemplates.) |
||
Line 18: | Line 18: | ||
| line{{#if:{{{line|{{{l|}}}}}}||NULL}} = {{{line|{{{l}}}}}} | | line{{#if:{{{line|{{{l|}}}}}}||NULL}} = {{{line|{{{l}}}}}} | ||
| view{{#if:{{{view|{{{v|}}}}}}||NULL}} = {{{view|{{{v}}}}}} | | view{{#if:{{{view|{{{v|}}}}}}||NULL}} = {{{view|{{{v}}}}}} | ||
| text{{#if:{{{text|{{{t | | text{{#if:{{{text|{{{t}}}}}}||NULL}} = {{{text| | ||
{{{t| | |||
{{#ifeq: {{{full|}}} | 1 | |||
| | |||
| {{#if: {{{1|}}} | |||
|{{strip whitespace|{{{1}}}}}<!-- | |||
-->{{#if: {{{2|}}} |/{{strip whitespace|{{{2}}}}}}} | |||
| FGAddon aircraft | |||
}} | |||
}} | |||
}}} | |||
}}} | |||
| pre{{#if:{{{pre|}}}||NULL}} = {{{pre}}} | | pre{{#if:{{{pre|}}}||NULL}} = {{{pre}}} | ||
| post{{#if:{{{post|}}}||NULL}} = {{{post}}} | | post{{#if:{{{post|}}}||NULL}} = {{{post}}} | ||
| simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}} | | simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}} | ||
| full | | full{{#if:{{{full|}}}||NULL}} = {{{full}}} | ||
}}<noinclude> | }}<noinclude> | ||
Line 37: | Line 39: | ||
__NOTOC__ | __NOTOC__ | ||
== Goal == | == Goal == | ||
This template is for creating links or URLs for files in the [[FGAddon]] svn version control repository. It is a subtemplate of the master {{tl|repo link}} template designed to simplify the interface by being specific for the [[FGAddon]] repository and avoiding the need to supply the <code>Aircraft/</code> directory. | This template is for creating Mediawiki links or URLs for files in the [[FGAddon]] svn version control repository. It is a subtemplate of the master {{tl|repo link}} template designed to simplify the interface by being specific for the [[FGAddon]] repository and avoiding the need to supply the <code>Aircraft/</code> directory. | ||
{{repo link/doc usage | {{repo link/doc usage | ||
Line 43: | Line 45: | ||
| param1 = 1 | name1 = aircraft | type1 = num | pos1 = 1 | desc1 = The aircraft directory name. The path is constructed as <code><nowiki><branch>/Aircraft/<aircraft></nowiki></code>. If empty, the path of <code><branch>/Aircraft/</code> will be used. | | param1 = 1 | name1 = aircraft | type1 = num | pos1 = 1 | desc1 = The aircraft directory name. The path is constructed as <code><nowiki><branch>/Aircraft/<aircraft></nowiki></code>. If empty, the path of <code><branch>/Aircraft/</code> will be used. | ||
| param2 = 1 | name2 = path | type2 = num | pos2 = 2 | desc2 = The file path following from the aircraft directory name. The full file path will be constructed as <code><nowiki><branch>/Aircraft/<aircraft>/<path></nowiki></code>. | | param2 = 1 | name2 = path | type2 = num | pos2 = 2 | desc2 = The file path following from the aircraft directory name. The full file path will be constructed as <code><nowiki><branch>/Aircraft/<aircraft>/<path></nowiki></code>. | ||
| cmd = 1 | eg_cmd = svn co | | cmd = 1 | eg_cmd = svn co | ||
| opt = 1 | | opt = 1 | ||
Line 89: | Line 90: | ||
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}} | {{fgaddon aircraft source|F-15|f15c-set.xml|l=8}} | ||
=== | === Custom text === | ||
{{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}text=The F-15's missile system{{cbr}} | |||
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|text=The F-15's missile system}} | |||
=== | === URL === | ||
{{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}} | {{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}full=1{{cbr}} | ||
{{fgaddon aircraft source|F-15|Nasal/fox2.nas| | {{fgaddon aircraft source|F-15|Nasal/fox2.nas|full=1}} | ||
=== The repository === | === The repository === |
Revision as of 13:10, 10 March 2016
Goal
This template is for creating Mediawiki links or URLs for files in the FGAddon svn version control repository. It is a subtemplate of the master {{repo link}} template designed to simplify the interface by being specific for the FGAddon repository and avoiding the need to supply the Aircraft/
directory.
Usage
{{fgaddon aircraft source | aircraft | path | cmd = | opt = | protocol = | login = | type = | branch = | commit = | line = | post = | view = | text = | pre = | simplepath = | full = }}
The aircraft, path, and file parameters are unique to this template and are used to construct the parent {{repo link}} template path and text parameters. Note that the text parameter overrides file, if supplied.
Parameter | Description | Abbreviated parameter |
Numbered parameter |
Status |
---|---|---|---|---|
aircraft | The aircraft directory name. The path is constructed as <branch>/Aircraft/<aircraft> . If empty, the path of <branch>/Aircraft/ will be used.
|
1 | optional | |
path | The file path following from the aircraft directory name. The full file path will be constructed as <branch>/Aircraft/<aircraft>/<path> .
|
2 | optional | |
cmd | An optional command line tool name + options to prepend to the URL. For example svn co. | optional | ||
opt | Any additional options to show after cmd, but before the URL.
|
optional | ||
protocol | The URL protocol, for example https, http, ssh, svn. This defaults to https. | optional | ||
login | The optional user login. | optional | ||
type | Choose between the web interface or a direct repository link. This can be one of svn, svn web. The default is svn web. | optional | ||
branch | The branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. This defaults to trunk. | b | optional | |
commit | The commit identifier (svn revision number). This defaults to HEAD. | c | r | optional | |
line | The line number(s) of the file to display.
|
l | optional | |
post | Text to append. This is forms a set with the parameter cmd and opt. For example it can represent any command line options that come after the URL. | optional | ||
view | View to display:
|
v | optional | |
text | Text to display as the link label. Overrides pre. | t | optional | |
pre | Prefix to a link label. | optional | ||
simplepath | If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
|
optional | ||
full | If set to 1, the full URL will be shown rather than any text label. | optional |
Plain text
To create a URL or link as plain text and avoid external links, simply use the {{#tag:tagname|content}}
magic word construct:
{{#tag:nowiki| {{repo link | full = 1 }} }}
https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/
To use the <code> tags:
{{#tag:code|{{#tag:nowiki| {{repo link | full = 1 }} }}}}
https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/
Examples
No parameters
{{fgaddon aircraft source}}
Aircraft given
{{fgaddon aircraft source|737-200}}
Revision number given
{{fgaddon aircraft source|ec135|r=560}}
Branch name given
{{fgaddon aircraft source|B-1B|b=release-3.6.0}}
Path and line number given
{{fgaddon aircraft source|F-15|Nasal/fox2.nas}}
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}}
Custom text
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|text=The F-15's missile system}}
URL
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|full=1}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/F-15/Nasal/fox2.nas
The repository
{{fgaddon aircraft source | text = The official FGAddon aircraft repository }}
The official FGAddon aircraft repository
File
{{fgaddon aircraft source | wrightFlyer1903 | wrightFlyer1903-set.xml }}
wrightFlyer1903/wrightFlyer1903-set.xml
File and a branch
{{fgaddon aircraft source | wrightFlyer1903 | wrightFlyer1903-set.xml | branch = branches/release-2016.1 }}
wrightFlyer1903/wrightFlyer1903-set.xml
File and a commit
{{fgaddon aircraft source | 787-8 | Nasal/systems.nas | commit = 1333 }}
File and line number
{{fgaddon aircraft source | ornithopter | ornithopter-set.xml | line = 13 }}
ornithopter/ornithopter-set.xml
File, line number, and commit
{{fgaddon aircraft source | ornithopter | ornithopter-set.xml | commit = 3 | line = 10 }}
ornithopter/ornithopter-set.xml
Custom label given
{{fgaddon aircraft source | mirage2000 | mirage2000-set.xml | text = The Mirage 2000 *-set.xml file }}
The Mirage 2000 *-set.xml file
Prefix of $FG_AIRCRAFT
{{fgaddon aircraft source | SpaceShuttle | Sounds/SpaceShuttle-Sounds.xml | pre = $FG_AIRCRAFT }}
SpaceShuttle/Sounds/SpaceShuttle-Sounds.xml
Full path
{{fgaddon aircraft source | CRJ700-family | CRJ900-set.xml | commit = 1418 | line = 10 }}
Related templates
|