Template:Fgaddon aircraft source: Difference between revisions
m (Bugman moved page Template:Fgaddon file to Template:Fgaddon aircraft source: See the talk page for discussions - this is for the expansion and better organisation of the {{repo link}} family of templates.) |
(Replacement of the template content with the {{fgaddon aircraft source/sandbox}} content. See the discussion page for full details. This mimics the original behaviour perfectly, while being based on the {{repo link}} master template.) |
||
Line 1: | Line 1: | ||
{{#if: {{{ | {{repo link | ||
| site = {{project infrastructure|abbrev}} | |||
| cmd{{#if:{{{cmd|}}}||NULL}} = {{{cmd}}} | |||
| opt{{#if:{{{opt|}}}||NULL}} = {{{opt}}} | |||
| protocol{{#if:{{{protocol|}}}||NULL}} = {{{protocol}}} | |||
| login{{#if:{{{login|}}}||NULL}} = {{{login}}} | |||
| type = {{{type|svn web}}} | |||
| proj = flightgear | |||
| repo = fgaddon | |||
| branch{{#if:{{{branch|{{{b|}}}}}}||NULL}} = {{{branch|{{{b}}}}}} | |||
| path = Aircraft{{#if: {{{1|}}} | |||
|/{{strip whitespace|{{{1}}}}}<!-- | |||
-->{{#if: {{{2|}}} | |||
|/{{strip whitespace|{{{2}}}}} | |||
}} | |||
| | }} | ||
| commit{{#if:{{{commit|{{{c|{{{r|}}}}}}}}}||NULL}} = {{{commit|{{{c|{{{r}}}}}}}}} | |||
| line{{#if:{{{line|{{{l|}}}}}}||NULL}} = {{{line|{{{l}}}}}} | |||
| view{{#if:{{{view|{{{v|}}}}}}||NULL}} = {{{view|{{{v}}}}}} | |||
| text{{#if:{{{text|{{{t|{{{file|}}}}}}}}}||NULL}} = {{{text|{{{t|{{#if: {{{file|}}} | {{{1}}}/{{{2}}} }} }}}}}} | |||
| pre{{#if:{{{pre|}}}||NULL}} = {{{pre}}} | |||
| post{{#if:{{{post|}}}||NULL}} = {{{post}}} | |||
| simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}} | |||
| full = {{#if: {{{file|}}} | |||
| 0 | |||
| {{#if: {{{text|{{{t|}}}}}} | |||
| 0 | |||
| {{#if: {{{pre|}}} | |||
| 0 | |||
| 1 | |||
}} | |||
}} | |||
}} | |||
}}<noinclude> | |||
{{Informative template|1= | {{Informative template|1= | ||
__NOTOC__ | __NOTOC__ | ||
== Goal == | == Goal == | ||
This template | 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. | ||
{{repo link/doc usage | |||
| template = fgaddon aircraft source | |||
| 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>. | |||
| param3 = 1 | name3 = file | type3 = named | desc3 = If set, then a link to the file rather than the full URL will be shown. | |||
| cmd = 1 | eg_cmd = svn co | |||
| opt = 1 | |||
| protocol = 1 | |||
| login = 1 | |||
| type = 1 | default_type = svn web | |||
| branch = 1 | short_branch = b | |||
| commit = 1 | short_commit = c {{!}} r | |||
| line = 1 | short_line = l | |||
| post = 1 | |||
| view = 1 | short_view = v | |||
| text = 1 | short_text = t | |||
| pre = 1 | |||
| simplepath = 1 | |||
| full = 1 | |||
| intro = The {{param|aircraft}}, {{param|path}}, and {{param|file}} parameters are unique to this template and are used to construct the parent {{tl|repo link}} template {{param|path}} and {{param|text}} parameters. Note that the {{param|text}} parameter overrides {{param|file}}, if supplied. | |||
| sf = 1 | |||
| svn = 1 | |||
}} | |||
{{repo link/doc plain text}} | |||
== Examples == | |||
=== No parameters === | |||
{{obr}}fgaddon aircraft source{{cbr}} | |||
{{fgaddon aircraft source}} | |||
=== Aircraft given === | |||
{{obr}}fgaddon aircraft source{{!}}737-200{{cbr}} | |||
{{fgaddon aircraft source|737-200}} | |||
=== Revision number given === | |||
{{obr}}fgaddon aircraft source{{!}}ec135{{!}}r=560{{cbr}} | |||
{{fgaddon aircraft source|ec135|r=560}} | |||
=== Branch name given === | |||
{{obr}}fgaddon aircraft source{{!}}B-1B{{!}}b=release-3.6.0{{cbr}} | |||
{{fgaddon aircraft source|B-1B|b=branches/release-3.6.0}} | |||
=== Path and line number given === | |||
{{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{cbr}} | |||
{{fgaddon aircraft source|F-15|Nasal/fox2.nas}} | |||
{{obr}}fgaddon aircraft source{{!}}F-15{{!}}f15c-set.xml{{!}}l=8{{cbr}} | |||
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}} | |||
=== Usage in a wiki URL === | |||
<nowiki>[</nowiki>{{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{cbr}} The F-15's missile system<nowiki>]</nowiki> | |||
[{{fgaddon aircraft source|F-15|Nasal/fox2.nas}} The F-15's missile system] | |||
== | === Pointer to a file === | ||
{{obr}} | {{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}file=yes{{cbr}} | ||
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|file=yes}} | |||
=== The repository === | |||
{{obr}}fgaddon aircraft source | |||
{{!}} text = The official FGAddon aircraft repository | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| text = The official FGAddon aircraft repository | |||
}} | |||
=== File === | |||
{{obr}}fgaddon aircraft source | |||
{{!}} wrightFlyer1903 | |||
{{!}} wrightFlyer1903-set.xml | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| wrightFlyer1903 | |||
| wrightFlyer1903-set.xml | |||
}} | |||
=== File and a branch === | |||
{{obr}}fgaddon aircraft source | |||
{{!}} wrightFlyer1903 | |||
{{!}} wrightFlyer1903-set.xml | |||
{{!}} branch = branches/release-2016.1 | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| wrightFlyer1903 | |||
| wrightFlyer1903-set.xml | |||
| branch = branches/release-2016.1 | |||
}} | |||
=== File and a commit === | |||
{{obr}}fgaddon aircraft source | |||
{{!}} 787-8 | |||
{{!}} Nasal/systems.nas | |||
{{!}} commit = 1333 | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| 787-8 | |||
| Nasal/systems.nas | |||
| commit = 1333 | |||
}} | |||
== | === File and line number === | ||
= | {{obr}}fgaddon aircraft source | ||
{{!}} ornithopter | |||
{{ | {{!}} ornithopter-set.xml | ||
{{!}} line = 13 | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| ornithopter | |||
| ornithopter-set.xml | |||
| line = 13 | |||
}} | |||
=== | === File, line number, and commit === | ||
{{obr}}fgaddon aircraft source | |||
{{ | {{!}} ornithopter | ||
{{!}} ornithopter-set.xml | |||
{{!}} commit = 3 | |||
{{!}} line = 10 | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| ornithopter | |||
| ornithopter-set.xml | |||
| commit = 3 | |||
| line = 10 | |||
}} | |||
=== | === Custom label given === | ||
{{obr}}fgaddon aircraft source | |||
{{ | {{!}} mirage2000 | ||
{{!}} mirage2000-set.xml | |||
{{!}} text = The Mirage 2000 *-set.xml file | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| mirage2000 | |||
| mirage2000-set.xml | |||
| text = The Mirage 2000 *-set.xml file | |||
}} | |||
=== | === Prefix of $FG_AIRCRAFT === | ||
{{obr}}fgaddon aircraft source | |||
{{!}} SpaceShuttle | |||
{{!}} Sounds/SpaceShuttle-Sounds.xml | |||
{{!}} pre = $FG_AIRCRAFT | |||
{{cbr}} | |||
{{fgaddon aircraft source | |||
| SpaceShuttle | |||
| Sounds/SpaceShuttle-Sounds.xml | |||
| pre = $FG_AIRCRAFT | |||
}} | |||
=== Full path === | |||
== | {{obr}}fgaddon aircraft source | ||
=== | {{!}} CRJ700-family | ||
{{!}} CRJ900-set.xml | |||
{{!}} commit = 1418 | |||
{{!}} line = 10 | |||
{{cbr}} | |||
{{ | {{fgaddon aircraft source | ||
| CRJ700-family | |||
| CRJ900-set.xml | |||
| commit = 1418 | |||
| line = 10 | |||
}} | |||
== Related templates == | == Related templates == | ||
Line 92: | Line 217: | ||
}} | }} | ||
[[Category:Repository link | [[Category:Repository link templates]] | ||
</noinclude> | </noinclude> |
Revision as of 08:20, 10 March 2016
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft
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 {{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 | file = | 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 | |
file | If set, then a link to the file rather than the full URL will be shown. | 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}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft
Aircraft given
{{fgaddon aircraft source|737-200}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/737-200
Revision number given
{{fgaddon aircraft source|ec135|r=560}}
https://sourceforge.net/p/flightgear/fgaddon/560/tree/trunk/Aircraft/ec135
Branch name given
{{fgaddon aircraft source|B-1B|b=release-3.6.0}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/branches/release-3.6.0/Aircraft/B-1B
Path and line number given
{{fgaddon aircraft source|F-15|Nasal/fox2.nas}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/F-15/Nasal/fox2.nas
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/F-15/f15c-set.xml#l8
Usage in a wiki URL
[{{fgaddon aircraft source|F-15|Nasal/fox2.nas}} The F-15's missile system]
Pointer to a file
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|file=yes}}
The repository
{{fgaddon aircraft source | text = The official FGAddon aircraft repository }}
The official FGAddon aircraft repository
File
{{fgaddon aircraft source | wrightFlyer1903 | wrightFlyer1903-set.xml }}
File and a branch
{{fgaddon aircraft source | wrightFlyer1903 | wrightFlyer1903-set.xml | branch = branches/release-2016.1 }}
File and a commit
{{fgaddon aircraft source | 787-8 | Nasal/systems.nas | commit = 1333 }}
https://sourceforge.net/p/flightgear/fgaddon/1333/tree/trunk/Aircraft/787-8/Nasal/systems.nas
File and line number
{{fgaddon aircraft source | ornithopter | ornithopter-set.xml | line = 13 }}
File, line number, and commit
{{fgaddon aircraft source | ornithopter | ornithopter-set.xml | commit = 3 | line = 10 }}
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 }}
$FG_AIRCRAFT/Aircraft/SpaceShuttle/Sounds/SpaceShuttle-Sounds.xml
Full path
{{fgaddon aircraft source | CRJ700-family | CRJ900-set.xml | commit = 1418 | line = 10 }}
Related templates
|