Template:Openradar source: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Passing of the 'login' parameter into {{repo link}}.)
m (Switch from the temporary {{project infrastructure/code}} template to {{project infrastructure}} template with the mode set to 'abbrev'.)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{repo link
{{repo link
| site                                     = {{project infrastructure|abbrev}}
| site                                         = {{project infrastructure|abbrev}}
| cmd{{#if:{{{cmd|}}}||NULL}}               = {{{cmd}}}
| cmd{{#if:{{{cmd|}}}||NULL}}                   = {{{cmd}}}
| protocol{{#if:{{{protocol|}}}||NULL}}     = {{{protocol}}}
| opt{{#if:{{{opt|}}}||NULL}}                  = {{{opt}}}
| login{{#if:{{{login|}}}||NULL}}           = {{{login}}}
| protocol{{#if:{{{protocol|}}}||NULL}}         = {{{protocol}}}
| type{{#if:{{{type|}}}||NULL}}             = {{{type}}}
| login{{#if:{{{login|}}}||NULL}}               = {{{login}}}
| proj                                     = flightgear
| type{{#if:{{{type|}}}||NULL}}                 = {{{type}}}
| repo                                     = openradar
| proj                                         = flightgear
| user{{#if:{{{user|}}}||NULL}}             = {{{user}}}
| repo                                         = openradar
| branch                                    = {{{branch|master}}}
| branch                                        = {{{branch|{{{b|master}}}}}}
| path{{#if:{{{path|}}}||NULL}}             = {{{path}}}
| tag{{#if:{{{tag|}}}||NULL}}                  = {{{tag}}}
| commit{{#if:{{{commit|}}}||NULL}}         = {{{commit}}}
| path{{#if:{{{path|{{{f|{{{1|}}}}}}}}}||NULL}} = {{{path|{{{f|{{{1}}}}}}}}}
| lines{{#if:{{{line|}}}||NULL}}           = {{{line}}}
| commit{{#if:{{{commit|{{{c|}}}}}}||NULL}}     = {{{commit|{{{c}}}}}}
| view{{#if:{{{view|}}}||NULL}}             = {{{view}}}
| line{{#if:{{{line|{{{l|}}}}}}||NULL}}         = {{{line|{{{l}}}}}}
| text{{#if:{{{text|}}}||NULL}}             = {{{text}}}
| view{{#if:{{{view|{{{v|}}}}}}||NULL}}         = {{{view|{{{v}}}}}}
| pre{{#if:{{{pre|}}}||NULL}}               = {{{pre}}}
| text{{#if:{{{text|{{{t|}}}}}}||NULL}}         = {{{text|{{{t}}}}}}
| post{{#if:{{{post|}}}||NULL}}             = {{{post}}}
| pre{{#if:{{{pre|}}}||NULL}}                   = {{{pre}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}}
| post{{#if:{{{post|}}}||NULL}}                 = {{{post}}}
| full{{#if:{{{full|}}}||NULL}}             = {{{full}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}}     = {{{simplepath}}}
| full{{#if:{{{full|}}}||NULL}}                 = {{{full}}}
}}<noinclude>
}}<noinclude>


{{repo link/doc specific file git
{{repo link/doc git source
| label    = OpenRadar
| label    = OpenRadar
| repo    = openradar
| repo    = openradar
Line 26: Line 27:
| examples =
| examples =
=== No parameters ===
=== No parameters ===
  {{obr}}openradar file{{cbr}}
  {{obr}}openradar source{{cbr}}
{{openradar file}}
{{openradar source}}


=== File ===
=== File ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} path = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path = src/org/flightgear/fgfsclient/FGFSConnection.java
| path = src/org/flightgear/fgfsclient/FGFSConnection.java
}}
}}


=== File and a tag ===
=== File and a branch ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} branch = 150331_AFTER_PROJECT_CLEANUP
  {{!}} branch = Combobox
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| branch = 150331_AFTER_PROJECT_CLEANUP
| branch = Combobox
}}
 
=== File and a tag ===
{{obr}}openradar source
{{!}} path = src/org/flightgear/fgfsclient/FGFSConnection.java
{{!}} tag  = 150331_AFTER_PROJECT_CLEANUP
{{cbr}}
 
{{openradar source
| path = src/org/flightgear/fgfsclient/FGFSConnection.java
| tag  = 150331_AFTER_PROJECT_CLEANUP
}}
}}


=== File and a commit ===
=== File and a commit ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} commit = 9ffbfb
  {{!}} commit = 9ffbfb
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfb
| commit = 9ffbfb
}}
}}


  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
  {{!}} commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
Line 71: Line 83:


=== File and line number ===
=== File and line number ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path = data/aircraftCodes.txt
  {{!}} path = data/aircraftCodes.txt
  {{!}} line = 41
  {{!}} line = 41
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path = data/aircraftCodes.txt
| path = data/aircraftCodes.txt
| line = 41
| line = 41
}}
}}


  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path  = de.knewcleus.openradar/data/aircraftCodes.txt
  {{!}} path  = de.knewcleus.openradar/data/aircraftCodes.txt
  {{!}} commit = 8d24b6
  {{!}} commit = 8d24b6
Line 87: Line 99:
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path  = de.knewcleus.openradar/data/aircraftCodes.txt
| path  = de.knewcleus.openradar/data/aircraftCodes.txt
| commit = 8d24b6
| commit = 8d24b6
| line = 5
| line   = 5
}}
}}


=== Custom label given ===
=== Custom label given ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path   = data/aircraftCodes.txt
  {{!}} path = data/aircraftCodes.txt
  {{!}} text   = The newest aircraft codes
  {{!}} text = The newest aircraft codes
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path = data/aircraftCodes.txt
| path = data/aircraftCodes.txt
| text = The newest aircraft codes
| text = The newest aircraft codes
Line 105: Line 117:


=== Full path ===
=== Full path ===
  {{obr}}openradar file
  {{obr}}openradar source
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} path  = src/org/flightgear/fgfsclient/FGFSConnection.java
  {{!}} commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
  {{!}} commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
  {{!}} full = 1
  {{!}} full   = 1
  {{cbr}}
  {{cbr}}


{{openradar file
{{openradar source
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| path  = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
| full  = 1
}}
=== Aliased parameters ===
This is for https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.
{{obr}}openradar source
{{!}} f    = src/org/flightgear/fgfsclient/FGFSConnection.java
{{!}} b    = 150331_AFTER_PROJECT_CLEANUP
{{!}} full = 1
{{cbr}}.
{{openradar source
| f    = src/org/flightgear/fgfsclient/FGFSConnection.java
| b    = 150331_AFTER_PROJECT_CLEANUP
| full = 1
| full = 1
}}
}}.
 
=== Numbered parameters ===
This is for https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.
 
{{obr}}openradar source {{!}} src/org/flightgear/fgfsclient/FGFSConnection.java {{!}} b = 150331_AFTER_PROJECT_CLEANUP {{!}} full = 1 {{cbr}}.
 
{{openradar source | src/org/flightgear/fgfsclient/FGFSConnection.java | b = 150331_AFTER_PROJECT_CLEANUP | full = 1 }}.


}}</noinclude>
}}</noinclude>

Latest revision as of 16:08, 20 June 2019

flightgear/openradar/master


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

Goal

This template is for creating links or URLs for the OpenRadar git version control repository. It is a subtemplate of the master {{repo link}} template designed to be specific for the OpenRadar repository.

Usage

{{openradar source
| cmd        =
| opt        =
| protocol   =
| login      =
| type       =
| branch     =
| tag        =
| commit     =
| path       =
| line       =
| post       =

| view       =
| text       =
| pre        =
| simplepath =
| full       =
}}

All parameters are optional.

Parameter Description Abbreviated
parameter
Numbered
parameter
Status
cmd An optional command line tool name + options to prepend to the URL. For example git clone. optional
opt Any additional options to show after cmd, but before the URL.
Note The separation of cmd and opt is for future non-CLI handling of a standardised set of cmd parameter values
optional
protocol The URL protocol, for example https, http, ssh, git. 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 git, git web. The default is git web. optional
branch The branch name. This defaults to master. For SourceForge git repositories, if the character / is present in the branch name, the text /~ must be appended to the branch. b optional
tag The repository tag name. For SourceForge git repositories, if the character / is present in the tag name, the text /~ must be appended to the tag. optional
commit The commit identifier (git hash). This defaults to HEAD. c optional
path The file or directory path. f 1 optional
line The line number(s) of the file to display.
  • For SourceForge: Use a single line number.
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:
  • For SourceForge use one of tree, log, commit, or rss. If a commit is specified (the commit parameter is set and path is not), the default is commit. Otherwise the default is tree.
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.
Note The text parameter will override this.
optional
full If set to 1, the full URL will be shown rather than any text label. optional

Design

In this section, the following notation will be used:

Angular brackets + lower case text <xyz>
Template parameters.
Angular brackets + upper case text <XYZ>
Template constructed text.
Square brackets [xyz]
Optional text, only added if the parameter is set.
Or symbol |
The value on the left, if present, otherwise the value on the right of the symbol.

Overview

The general design is:

<cmd> <opt> [<URL> <TEXT>] <post>

Here the square brackets do not denote optional text, but will instead produce a Mediawiki link. This can be modified by setting full = 1 to produce:

<cmd> <opt> <URL> <post>

Site: SourceForge

Project page

For a normal SourceForge project page, the base URL is respectively constructed as:

<protocol>://<DOMAIN>/p/<proj>/<repo>/

For the type parameter value of git, a login is allowed:

<protocol>://[<login>@]<DOMAIN>/p/<proj>/<repo>/

SourceForge <URL> for 'type=git'

For this parameter value, the complete <URL> value will be:

<protocol>://[<login>@]git.code.sf.net/p/<proj>/<repo>/

SourceForge <URL> for 'type=git web'

For this parameter value, the <URL> value will be:

<protocol>://sourceforge.net/p/<proj>/<repo>/ci/<commit|branch>/<VIEW>/<path>[#l<line>]

The <VIEW> value for different values of view is:

tree
tree/.
log
log/?path=.
commit
nothing.

If the parameter setting view=rss is used, a different <URL> value is produced:

<protocol>://sourceforge.net/p/<proj>/<repo>/feed/

SourceForge URL <TEXT> for 'type=git' and 'type=git web'

The link text <TEXT>, if the full parameter is not set, will be:

<proj>/<repo>/<commit|branch>[/<path>][#l<line>] <DESC>

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>] <DESC>

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>] <DESC>

The RSS feed is a special case in that <TEXT> will be one of:

<proj>/<repo> <DESC>
<pre> <DESC>

The description <DESC> is dependent on the view parameter:

tree
Nothing.
log
log view.
commit
commit view.
rss
RSS feed.

The text parameter trumps all, and <TEXT> is simply:

<text>

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

{{openradar source}}

flightgear/openradar/master

File

{{openradar source
| path = src/org/flightgear/fgfsclient/FGFSConnection.java
}}

flightgear/openradar/master/src/org/flightgear/fgfsclient/FGFSConnection.java

File and a branch

{{openradar source
| path   = src/org/flightgear/fgfsclient/FGFSConnection.java
| branch = Combobox
}}

flightgear/openradar/Combobox/src/org/flightgear/fgfsclient/FGFSConnection.java

File and a tag

{{openradar source
| path = src/org/flightgear/fgfsclient/FGFSConnection.java
| tag  = 150331_AFTER_PROJECT_CLEANUP
}}

flightgear/openradar/150331_AFTER_PROJECT_CLEANUP/src/org/flightgear/fgfsclient/FGFSConnection.java

File and a commit

{{openradar source
| path   = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfb
}}

flightgear/openradar/9ffbfb/src/org/flightgear/fgfsclient/FGFSConnection.java

{{openradar source
| path   = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
}}

flightgear/openradar/9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a/src/org/flightgear/fgfsclient/FGFSConnection.java

File and line number

{{openradar source
| path = data/aircraftCodes.txt
| line = 41
}}

flightgear/openradar/master/data/aircraftCodes.txt#l41

{{openradar source
| path   = de.knewcleus.openradar/data/aircraftCodes.txt
| commit = 8d24b6
| line   = 5
}}

flightgear/openradar/8d24b6/de.knewcleus.openradar/data/aircraftCodes.txt#l5

Custom label given

{{openradar source
| path = data/aircraftCodes.txt
| text = The newest aircraft codes
}}

The newest aircraft codes

Full path

{{openradar source
| path   = src/org/flightgear/fgfsclient/FGFSConnection.java
| commit = 9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a
| full   = 1
}}

https://sourceforge.net/p/flightgear/openradar/ci/9ffbfbd629f51aa4800d9d7d0f0c8a1d11c8a79a/tree/src/org/flightgear/fgfsclient/FGFSConnection.java

Aliased parameters

This is for https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.

{{openradar source
| f    = src/org/flightgear/fgfsclient/FGFSConnection.java
| b    = 150331_AFTER_PROJECT_CLEANUP
| full = 1
}}.

https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.

Numbered parameters

This is for https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.

{{openradar source | src/org/flightgear/fgfsclient/FGFSConnection.java | b = 150331_AFTER_PROJECT_CLEANUP | full = 1 }}.

https://sourceforge.net/p/flightgear/openradar/ci/150331_AFTER_PROJECT_CLEANUP/tree/src/org/flightgear/fgfsclient/FGFSConnection.java.

Related templates