13,208
edits
Red Leader (talk | contribs) (Add path, branch, and line params, expand example, add related templates) |
(+-More comments and indentation; + So far commented beginnings of adding snapshot download link. Need to figure out how to throw error without code duplication) |
||
Line 1: | Line 1: | ||
http://sourceforge.net/p/flightgear/fgaddon/{{{r|HEAD}}}/tree/{{{b|trunk | http://sourceforge.net/p/flightgear/fgaddon/{{{r|HEAD}}}<!-- tarball?path=/*no "/tree/"* --><!-- | ||
-->/tree/<!-- | |||
-->{{#if: {{{b|}}} <!-- Is a branch defined? --> | |||
| <!-- Yes, add the branch to the URL --><!-- | |||
-->branches/{{{b}}} | |||
| <!-- No, default to "trunk" --><!-- | |||
-->trunk | |||
}}/Aircraft/<!-- | |||
-->{{#if: {{{1|}}} <!-- Is an aircraft defined? --> | -->{{#if: {{{1|}}} <!-- Is an aircraft defined? --> | ||
| <!-- Yes, go to the aircraft directory --><!-- | |||
-->{{{1}}}/<!-- | |||
-->{{#if: {{{2|}}} <!-- Is a file path defined? --> | |||
| <!-- Yes, got to the file --><!-- | |||
-->{{{2}}}<!-- | |||
-->{{#if: {{{l|}}} <!-- Is a line number defined --> | |||
| <!-- Yes, go to the line number --><!-- | |||
-->#l{{{l}}} | |||
}} | |||
}} | |||
| <!-- No, go to the default --> | |||
}}<noinclude> | |||
{{Informative template|1= | {{Informative template|1= | ||
__NOTOC__ | __NOTOC__ | ||
Line 14: | Line 26: | ||
== Usage == | == Usage == | ||
{{obr}}'''fgaddon url'''{{!}}''aircraft''{{!}}''path''{{!}}''r=''{{!}}''b=''{{!}}''l=''{{cbr}} | {{obr}}'''fgaddon url'''{{!}}''aircraft''{{!}}''path''{{!}}''r=''{{!}}''b=''{{!}}''l=''{{!}}''tarball=''{{cbr}} | ||
All parameters are optional. | All parameters are optional. | ||
Line 22: | Line 34: | ||
; path: What follows after the aircraft's repository name in the URL. Can be the path to a file or a directory. | ; path: What follows after the aircraft's repository name in the URL. Can be the path to a file or a directory. | ||
; r: | ; r: Revision number to use instead of <code>HEAD</code>. | ||
; b: | ; b: Branch name to use instead of <code>trunk</code>. | ||
; l: Used with the '''path''' parameter to link to a given line in a file. | ; l: Used with the '''path''' parameter to link to a given line in a file. | ||
: {{inote| | : {{inote|Due to SourceForge limitations this parameter does not fork for some file types, in particular <code>.nas</code> (Nasal) files.}} | ||
<!-- | |||
; tarball: If not empty, the link will create and link to a <code>.tar.gz</code> (tarball) snapshot of a an aircraft directory. | |||
: {{inote|See also the section "Technical details" below.}} --> | |||
== Examples == | == Examples == | ||
Line 43: | Line 58: | ||
=== Branch name given === | === Branch name given === | ||
<nowiki>{{fgaddon url|B-1B|b= | <nowiki>{{fgaddon url|B-1B|b=release-3.6.0}}</nowiki> | ||
{{fgaddon url|B-1B|b= | {{fgaddon url|B-1B|b=release-3.6.0}} | ||
=== Path and line number given === | === Path and line number given === | ||
Line 56: | Line 71: | ||
<nowiki>[{{fgaddon url|F-15|Nasal/fox2.nas}} The F-15's missile system]</nowiki> | <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] | [{{fgaddon url|F-15|Nasal/fox2.nas}} The F-15's missile system] | ||
<!-- | |||
== Technical details == | |||
=== The tarball parameter === | |||
When used with the '''tarball=''' parameter, the template will link to a SourceForge page that will create a <code>.tar.gz</code> (tarball) compressed archive snapshot of a directory. Currently the template is set up to only allow this for aircraft directories, in essence when no '''path''' or '''l''' (line) parameter is given. | |||
{{inote|Creating the tarball can take some time.}} --> | |||
== Related templates == | == Related templates == |