Template:Fgaddon aircraft source: Difference between revisions
Jump to navigation
Jump to search
m (+-cat) |
Red Leader (talk | contribs) (Add path, branch, and line params, expand example, add related templates) |
||
Line 1: | Line 1: | ||
http://sourceforge.net/p/flightgear/fgaddon/{{{ | http://sourceforge.net/p/flightgear/fgaddon/{{{r|HEAD}}}/tree/{{{b|trunk}}}/Aircraft/<!-- | ||
-->{{#if: {{{1|}}} <!-- Is an aircraft defined? --> | -->{{#if: {{{1|}}} <!-- Is an aircraft defined? --> | ||
| <!-- Yes, go to file path --><!-- | | <!-- Yes, go to file path --><!-- | ||
-->{{{1}}}/ | -->{{{1}}}/<!-- | ||
| <!-- No, go to the | -->{{#if: {{{2|}}} <!-- Is a path given? --><!-- | ||
-->| {{{2}}}{{#if: {{{l|}}} | #l{{{l}}} }} <!-- Yes, add it to the URL --><!-- | |||
-->}} | |||
| <!-- No, go to the default --><!-- | |||
-->}}<noinclude> | -->}}<noinclude> | ||
{{Informative template|1= | {{Informative template|1= | ||
__NOTOC__ | __NOTOC__ | ||
== Goal == | == Goal == | ||
This template will return the URL of an FGAddon aircraft if given the name of the aircraft directory in the repository. | This template will return the URL of an [[FGAddon]] aircraft if given the name of the aircraft directory in the repository, and optionally a file in that aircraft's directory. | ||
== Usage == | == Usage == | ||
{{obr}}'''fgaddon url'''{{!}}''aircraft''{{!}}'' | {{obr}}'''fgaddon url'''{{!}}''aircraft''{{!}}''path''{{!}}''r=''{{!}}''b=''{{!}}''l=''{{cbr}} | ||
All parameters are optional. | All parameters are optional. | ||
Line 17: | Line 20: | ||
; aircraft: Aircraft directory name. If empty the URL of <code>trunk/Aircraft/</code> will be returned. | ; aircraft: Aircraft directory name. If empty the URL of <code>trunk/Aircraft/</code> will be returned. | ||
; | ; path: What follows after the aircraft's repository name in the URL. Can be the path to a file or a directory. | ||
; r: Optional revision number to use instead of <code>HEAD</code>. | |||
; b: Optional branch name to use instead of <code>trunk</code>. | |||
; l: Used with the '''path''' parameter to link to a given line in a file. | |||
: {{inote|This parameter will not work if the linked file is of a certain file type, such as <code>.nas</code>. However, this is to do with SourceForge, not the template.}} | |||
== Examples == | == Examples == | ||
=== No parameters given === | |||
<nowiki>{{fgaddon url}}</nowiki> | <nowiki>{{fgaddon url}}</nowiki> | ||
{{fgaddon url}} | {{fgaddon url}} | ||
=== Aircraft given === | |||
<nowiki>{{fgaddon url|737-200}}</nowiki> | <nowiki>{{fgaddon url|737-200}}</nowiki> | ||
{{fgaddon url|737-200}} | {{fgaddon url|737-200}} | ||
<nowiki>{{fgaddon url|ec135|560}}</nowiki> | === Revision number given === | ||
{{fgaddon url|ec135|560}} | <nowiki>{{fgaddon url|ec135|r=560}}</nowiki> | ||
{{fgaddon url|ec135|r=560}} | |||
=== Branch name given === | |||
<nowiki>{{fgaddon url|B-1B|b=branches/release-3.6.0}}</nowiki> | |||
{{fgaddon url|B-1B|b=branches/release-3.6.0}} | |||
=== Path and line number given === | |||
<nowiki>{{fgaddon url|F-15|Nasal/fox2.nas}}</nowiki> | |||
{{fgaddon url|F-15|Nasal/fox2.nas}} | |||
<nowiki>{{fgaddon url|F-15|f15c-set.xml|l=8}}</nowiki> | |||
{{fgaddon url|F-15|f15c-set.xml|l=8}} | |||
=== Usage in a wiki URL === | |||
<nowiki>[{{fgaddon url|F-15|Nasal/fox2.nas}} The F-15's missile system]</nowiki> | |||
[{{fgaddon url|F-15|Nasal/fox2.nas}} The F-15's missile system] | |||
== Related templates == | |||
* {{tl|repo link}} | |||
* {{tl|fgdata file}} | |||
* {{tl|flightgear file}} | |||
* {{tl|simgear file}} | |||
}} | }} |
Revision as of 09:49, 4 October 2015
http://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Aircraft/
The following template description is not displayed when the template is inserted in an article.
Goal
This template will return the URL of an FGAddon aircraft if given the name of the aircraft directory in the repository, and optionally a file in that aircraft's directory.
Usage
{{fgaddon url|aircraft|path|r=|b=|l=}}
All parameters are optional.
- aircraft
- Aircraft directory name. If empty the URL of
trunk/Aircraft/
will be returned.
- path
- What follows after the aircraft's repository name in the URL. Can be the path to a file or a directory.
- r
- Optional revision number to use instead of
HEAD
.
- b
- Optional branch name to use instead of
trunk
.
- l
- Used with the path parameter to link to a given line in a file.
- 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.
Examples
No parameters given
{{fgaddon url}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk
Aircraft given
{{fgaddon url|737-200}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/737-200
Revision number given
{{fgaddon url|ec135|r=560}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/ec135
Branch name given
{{fgaddon url|B-1B|b=branches/release-3.6.0}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/branches/release-3.6.0/B-1B
Path and line number given
{{fgaddon url|F-15|Nasal/fox2.nas}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/F-15
{{fgaddon url|F-15|f15c-set.xml|l=8}}
https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/F-15#l8
Usage in a wiki URL
[{{fgaddon url|F-15|Nasal/fox2.nas}} The F-15's missile system]
Related templates
- {{repo link}}
- {{fgdata file}}
- {{flightgear file}}
- {{simgear file}}