Template:Sourceforge clone: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Creation of the {{sourceforge clone}} template.)
 
(Full support for aliased and numbered parameters, with examples to demonstrate the capabilities.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#tag:nowiki|{{repo link
{{#tag:nowiki|{{repo link
| site                         = sf
| site                                         = sf
| cmd                           = git clone
| cmd                                           = git clone
| opt{{#if:{{{opt|}}}||NULL}}   = {{{opt}}}
| opt{{#if:{{{opt|}}}||NULL}}                   = {{{opt}}}
| protocol                     = git
| protocol                                     = git
| type                         = git
| type                                         = git
| user{{#if:{{{user|}}}||NULL}} = {{{user}}}
| user{{#if:{{{user|{{{u|}}}}}}||NULL}}         = {{{user|{{{u}}}}}}
| proj{{#if:{{{proj|}}}||NULL}} = {{{proj}}}
| proj{{#if:{{{proj|{{{p|{{{1|}}}}}}}}}||NULL}} = {{{proj|{{{p|{{{1}}}}}}}}}
| repo{{#if:{{{repo|}}}||NULL}} = {{{repo}}}
| repo{{#if:{{{repo|{{{r|{{{2|}}}}}}}}}||NULL}} = {{{repo|{{{r|{{{2}}}}}}}}}
| post{{#if:{{{post|}}}||NULL}} = {{{post}}}
| post{{#if:{{{post|}}}||NULL}}                 = {{{post}}}
| full                         = 1
| full                                         = 1
}}}}<noinclude>
}}}}<noinclude>


{{repo link/doc 3rd party infrastructure clone
{{repo link/doc infrastructure clone
| label    = SourceForge
| label    = SourceForge
| site    = sourceforge
| site    = sourceforge
Line 32: Line 32:
}}}}.
}}}}.


}}
===== Aliased parameters =====
This is for <code><nowiki>git clone git://git.code.sf.net/p/flightgear/simgear</nowiki></code>.


</noinclude>
{{obr}}#tag:code{{!}}{{obr}}sourceforge clone
  {{!}} p = flightgear
  {{!}} r = simgear
{{cbr}}{{cbr}}.
 
{{#tag:code|{{sourceforge clone
  | p = flightgear
  | r = simgear
}}}}.
 
===== Numbered parameters =====
This is for <code><nowiki>git clone git://git.code.sf.net/p/flightgear/simgear</nowiki></code>.
 
{{obr}}#tag:code{{!}}{{obr}}sourceforge clone {{!}} flightgear {{!}} simgear {{cbr}}{{cbr}}.
 
{{#tag:code|{{sourceforge clone | flightgear | simgear }}}}.
 
}}</noinclude>

Latest revision as of 15:28, 7 March 2016

git clone git://git.code.sf.net/p/flightgear/flightgear/


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

Goal

To provide a consistent representation of the command to clone git repositories from the SourceForge open source infrastructure. This is a subtemplate of the master {{repo link}} template designed to be specific for the git clone command and the SourceForge infrastructure.

Usage

{{sourceforge clone
| opt        =
| user       =
| proj       =
| repo       =
| post       =
}}

The parameters are:

Parameter Description Abbreviated
parameter
Numbered
parameter
Status
opt Any additional options to show after the command git clone, but before the URL. optional
user The name of the user page for the open source infrastructure. This is notably different to the login parameter. This will have precedence over the proj parameter. The user page is treated in the same way as a project name. u 1 mandatory
proj The name of the project, consisting of a grouping of repositories on the open source infrastructure. p 1 mandatory
repo The name of the repository. A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name. r 2 mandatory
post Text to append. This is forms a set with the parameter opt. For example it can represent any command line options that come after the URL. 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

Git clone

This is for the main FlightGear source code repository: git clone git://git.code.sf.net/p/flightgear/flightgear flightgear-flightgear. Though in this case, the simpler {{flightgear clone}} should be used.

{{#tag:code|{{sourceforge clone
  | proj     = flightgear
  | repo     = flightgear
  | post     = flightgear-flightgear
}}}}.

git clone git://git.code.sf.net/p/flightgear/flightgear/ flightgear-flightgear.

Aliased parameters

This is for git clone git://git.code.sf.net/p/flightgear/simgear.

{{#tag:code|{{sourceforge clone
  | p = flightgear
  | r = simgear
}}}}.

git clone git://git.code.sf.net/p/flightgear/simgear/.

Numbered parameters

This is for git clone git://git.code.sf.net/p/flightgear/simgear.

{{#tag:code|{{sourceforge clone | flightgear | simgear }}}}.

git clone git://git.code.sf.net/p/flightgear/simgear/.

Related templates