Difference between revisions of "Template:SVN link"

From FlightGear wiki
Jump to navigation Jump to search
m (Usage)
(Not showing error message as the template still would link to defaults; Changing the link label; Doc style; +-Issues: Template:Clarify)
Line 5: Line 5:
 
| flightgear/fgaddon = tree/trunk/Aircraft
 
| flightgear/fgaddon = tree/trunk/Aircraft
 
}}<!--
 
}}<!--
-->/{{{path|'''Path not set'''}}}<!-- Path to file/directory
+
-->/{{{path|}}}<!-- Path to file/directory
 
-->{{#if:{{{line|}}}|&#35;l{{{line}}}}}<!-- Specific lines
 
-->{{#if:{{{line|}}}|&#35;l{{{line}}}}}<!-- Specific lines
--> {{{text|{{{pre|{{{reponame|flightgear/fgaddon}}}}}}/{{{path|{{{rev|HEAD}}}}}}}}}]<!-- Link text
+
--> {{{text|{{{pre|{{{reponame|flightgear/fgaddon}}}}}}/{{{rev|HEAD}}}{{{path|/tree/trunk/Aircraft}}}}}}]<!-- Link text
 
 
 
--><noinclude>
 
--><noinclude>
 
{{Informative template|1=
 
{{Informative template|1=
Line 19: Line 18:
 
== Usage ==
 
== Usage ==
 
  <nowiki>{{</nowiki>'''SVN link'''
 
  <nowiki>{{</nowiki>'''SVN link'''
  <nowiki>|</nowiki> ''path''
+
  <nowiki>|</nowiki> path     =
  <nowiki>|</nowiki> ''reponame''
+
  <nowiki>|</nowiki> ''reponame'' =
  <nowiki>|</nowiki> ''rev''
+
  <nowiki>|</nowiki> ''rev''     =
  <nowiki>|</nowiki> ''line''
+
  <nowiki>|</nowiki> ''line''     =
  <nowiki>|</nowiki> ''text''
+
  <nowiki>|</nowiki> ''text''     =
  <nowiki>|</nowiki> ''pre''
+
  <nowiki>|</nowiki> ''pre''     =
 
  <nowiki>}}</nowiki>
 
  <nowiki>}}</nowiki>
 +
 +
All parameters are optional.  If no parameters are given, the template will link to the <code>Aircraft</code> folder in the official aircraft repository at SourceForge.
  
 
; path
 
; path
: Mandatory path to the file.
+
: Path to the file or directory.
  
 
; reponame
 
; reponame
: Optional path to the repository.  Defaults to '''flightgear/fgaddon'''.
+
: Path to the repository.  Defaults to '''flightgear/fgaddon'''.
  
 
; rev
 
; rev
: Optional revision number.  Defaults to '''HEAD'''.
+
: Revision number.  Defaults to '''HEAD'''.
  
 
; line
 
; line
: Optional line to go to on the page.
+
: Line to go to on the page.
  
 
; text
 
; text
: Optional alternative label for the link text.  Will override all other parameters.
+
: Alternative label for the link text.  Will override all other parameters.
  
 
; pre
 
; pre
: Optional prefix for the links label.  Defaults to '''flightgear/fgaddon'''.
+
: Prefix for the links label.  Defaults to '''flightgear/fgaddon'''.
  
 
== Examples ==
 
== Examples ==
Line 54: Line 55:
 
  <nowiki>{{SVN link|path=Mirage-2000/m2000-5-set.xml|line=7|text=Mirage 2000-5's set.xml file}}</nowiki>
 
  <nowiki>{{SVN link|path=Mirage-2000/m2000-5-set.xml|line=7|text=Mirage 2000-5's set.xml file}}</nowiki>
 
{{SVN link|path=Mirage-2000/m2000-5-set.xml|line=7|text=Line 7 of the Mirage 2000-5's set.xml file}}
 
{{SVN link|path=Mirage-2000/m2000-5-set.xml|line=7|text=Line 7 of the Mirage 2000-5's set.xml file}}
 
  
 
== Known issues ==
 
== Known issues ==
It appears that '''link''' does not work with files that are not XML.  This seems to be a Sourceforge problem though.
+
It appears that '''link''' does not work with files that are not XML.{{clarify|Link does not work|Nov 2014}} This seems to be a SourceForge specific problem though.
  
 
== Related templates ==
 
== Related templates ==

Revision as of 19:14, 14 November 2014

flightgear/fgaddon/HEAD/tree/trunk/Aircraft

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

Goal

This template allows easy links to SVN-managed files or projects located at SourceForge.

Caution Using this will add an external link; make sure to enter the appropriate security question after hitting "Save page", or your changes will be lost!

Usage

{{SVN link
| path      =
| reponame =
| rev      =
| line     =
| text     =
| pre      =
}}

All parameters are optional. If no parameters are given, the template will link to the Aircraft folder in the official aircraft repository at SourceForge.

path
Path to the file or directory.
reponame
Path to the repository. Defaults to flightgear/fgaddon.
rev
Revision number. Defaults to HEAD.
line
Line to go to on the page.
text
Alternative label for the link text. Will override all other parameters.
pre
Prefix for the links label. Defaults to flightgear/fgaddon.

Examples

{{SVN link}}

flightgear/fgaddon/HEAD/tree/trunk/Aircraft

{{SVN link|path=Mirage-2000/m2000-5-set.xml|pre=$FGDATA}}

$FGDATA/HEADMirage-2000/m2000-5-set.xml

{{SVN link|path=Mirage-2000/m2000-5-set.xml|line=7|text=Mirage 2000-5's set.xml file}}

Line 7 of the Mirage 2000-5's set.xml file

Known issues

It appears that link does not work with files that are not XML.[clarify] This seems to be a SourceForge specific problem though.

Related templates