Template:Fgaddon url: Difference between revisions
(Bugman moved page Template:Fgaddon url to Template:Fgaddon file: Consistency with all the other repository file templates.) |
(Support for the tag parameter.) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
# | {{repo link | ||
| site = {{project infrastructure/code}} | |||
| cmd{{#if:{{{cmd|}}}||NULL}} = {{{cmd}}} | |||
| opt{{#if:{{{opt|}}}||NULL}} = {{{opt}}} | |||
| protocol{{#if:{{{protocol|}}}||NULL}} = {{{protocol}}} | |||
| login{{#if:{{{login|}}}||NULL}} = {{{login}}} | |||
| type = {{{type|svn web}}} | |||
| proj = flightgear | |||
| repo = fgaddon | |||
| branch{{#if:{{{branch|{{{b|}}}}}}||NULL}} = {{{branch|{{{b}}}}}} | |||
| tag{{#if:{{{tag|}}}||NULL}} = {{{tag}}} | |||
| path{{#if:{{{path|{{{f|{{{1|}}}}}}}}}||NULL}} = {{{path|{{{f|{{{1}}}}}}}}} | |||
| commit{{#if:{{{commit|{{{c|}}}}}}||NULL}} = {{{commit|{{{c}}}}}} | |||
| line{{#if:{{{line|{{{l|}}}}}}||NULL}} = {{{line|{{{l}}}}}} | |||
| view{{#if:{{{view|{{{v|}}}}}}||NULL}} = {{{view|{{{v}}}}}} | |||
| post{{#if:{{{post|}}}||NULL}} = {{{post}}} | |||
| full = 1 | |||
}}<noinclude> | |||
{{repo link/doc svn url | |||
| label = FGAddon | |||
| repo = fgaddon | |||
| alt = fgaddon aircraft url | |||
| examples = | |||
=== No parameters === | |||
{{obr}}fgaddon url{{cbr}} | |||
{{fgaddon url}} | |||
=== File === | |||
{{obr}}fgaddon url | |||
{{!}} path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
{{cbr}} | |||
{{fgaddon url | |||
| path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
}} | |||
=== File and a branch === | |||
{{obr}}fgaddon url | |||
{{!}} path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
{{!}} branch = branches/release-2016.1 | |||
{{cbr}} | |||
{{fgaddon url | |||
| path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
| branch = branches/release-2016.1 | |||
}} | |||
=== File and a commit === | |||
{{obr}}fgaddon url | |||
{{!}} path = Aircraft/787-8/Nasal/systems.nas | |||
{{!}} commit = 1333 | |||
{{cbr}} | |||
{{fgaddon url | |||
| path = Aircraft/787-8/Nasal/systems.nas | |||
| commit = 1333 | |||
}} | |||
=== Commit === | |||
{{obr}}fgaddon url | |||
{{!}} commit = 1552 | |||
{{!}} view = commit | |||
{{cbr}} | |||
{{fgaddon url | |||
| commit = 1552 | |||
| view = commit | |||
}} | |||
=== File and line number === | |||
{{obr}}fgaddon url | |||
{{!}} path = Aircraft/ornithopter/ornithopter-set.xml | |||
{{!}} line = 13 | |||
{{cbr}} | |||
{{fgaddon url | |||
| path = Aircraft/ornithopter/ornithopter-set.xml | |||
| line = 13 | |||
}} | |||
=== File, line number, and commit === | |||
{{obr}}fgaddon url | |||
{{!}} path = Aircraft/ornithopter/ornithopter-set.xml | |||
{{!}} commit = 3 | |||
{{!}} line = 10 | |||
{{cbr}} | |||
{{fgaddon url | |||
| path = Aircraft/ornithopter/ornithopter-set.xml | |||
| commit = 3 | |||
| line = 10 | |||
}} | |||
=== svn import === | |||
This should give: | |||
<syntaxhighlight lang="bash"> | |||
svn import DaSH/ svn+ssh://<username>@svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/ -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ." | |||
</syntaxhighlight> | |||
{{obr}}#tag:syntaxhighlight{{!}} | |||
{{obr}}fgaddon url | |||
{{!}} cmd = svn import DaSH/ | |||
{{!}} protocol = svn+ssh | |||
{{!}} login = <username> | |||
{{!}} type = svn | |||
{{!}} path = Aircraft/ | |||
{{!}} post = -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at <nowiki>http://forum.flightgear.org/viewtopic.php?f=4&t=24495</nowiki> ." | |||
{{cbr}} | |||
{{!}} lang = "sh" | |||
{{cbr}} | |||
{{#tag:syntaxhighlight| | |||
{{fgaddon url | |||
| cmd = svn import DaSH/ | |||
| protocol = svn+ssh | |||
| login = <username> | |||
| type = svn | |||
| path = Aircraft/ | |||
| post = -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ." | |||
}} | |||
| lang = "sh" | |||
}} | |||
=== Aliased parameters === | |||
This is for https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/branches/release-2016.1/Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml. | |||
{{obr}}fgaddon url | |||
{{!}} f = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
{{!}} b = branches/release-2016.1 | |||
{{cbr}}. | |||
{{fgaddon url | |||
| f = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | |||
| b = branches/release-2016.1 | |||
}}. | |||
=== Numbered parameters === | |||
This is for https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/branches/release-2016.1/Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml. | |||
{{obr}}fgaddon url {{!}} Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml {{!}} b = branches/release-2016.1 {{cbr}}. | |||
{{fgaddon url | Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | b = branches/release-2016.1 }}. | |||
}}</noinclude> |
Revision as of 15:37, 20 May 2016
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
Goal
This template is for creating direct URLs for the FGAddon svn version control repository. This is equivalent to the {{fgaddon source}} template with the full parameter set to 1. It is a subtemplate of the master {{repo link}} template designed to be specific for the FGAddon repository.
For an alternative interface, please see the {{fgaddon aircraft url}} template.
Usage
{{fgaddon url | cmd = | opt = | protocol = | login = | type = | branch = | commit = | path = | line = | post = | view = }}
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 svn co. | optional | ||
opt | Any additional options to show after cmd, but before the URL.
|
optional | ||
protocol | The URL protocol, for example https, http, ssh, svn. 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 svn, svn web. The default is svn web. | optional | ||
branch | The branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. This defaults to trunk. | b | optional | |
commit | The commit identifier (svn revision number). 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.
|
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:
|
v | 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 svn, a login is allowed:
<protocol>://[<login>@]<DOMAIN>/p/<proj>/<repo>/
SourceForge <URL> for 'type=svn'
For this parameter value, the <URL>
value will instead be:
<protocol>://[<login>@]svn.code.sf.net/p/<proj>/<repo>/<branch>[/<path>][@<commit>]
SourceForge <URL> for 'type=svn web'
For this parameter value, the <URL>
value will be:
<protocol>://sourceforge.net/p/<proj>/<repo>/<commit|HEAD>/<VIEW>/<branch>[/<path>][#l<line>]
The <VIEW>
value for different values of view is:
- tree
tree/
.- log
log/?path=
.
If the parameter setting view=commit is used, a truncated <URL> value is produced:
<protocol>://sourceforge.net/p/<proj>/<repo>/<commit|HEAD>/
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=svn' and 'type=svn web'
The link text <TEXT>
, if the full parameter is not set, will be:
<proj>/<repo>/<branch>[/<path>][#l<line>][@r<commit>] <DESC>
If the simplepath parameter is set, this changes to:
[/<path>][#l<line>][@r<commit>] <DESC>
If the pre parameter is supplied, this changes to:
<pre>[/<path>][#l<line>][@r<commit>] <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
{{fgaddon url}}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
File
{{fgaddon url | path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
File and a branch
{{fgaddon url | path = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | branch = branches/release-2016.1 }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
File and a commit
{{fgaddon url | path = Aircraft/787-8/Nasal/systems.nas | commit = 1333 }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
Commit
{{fgaddon url | commit = 1552 | view = commit }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
File and line number
{{fgaddon url | path = Aircraft/ornithopter/ornithopter-set.xml | line = 13 }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
File, line number, and commit
{{fgaddon url | path = Aircraft/ornithopter/ornithopter-set.xml | commit = 3 | line = 10 }}
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}
svn import
This should give:
svn import DaSH/ svn+ssh://<username>@svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/ -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ."
{{#tag:syntaxhighlight| {{fgaddon url | cmd = svn import DaSH/ | protocol = svn+ssh | login = <username> | type = svn | path = Aircraft/ | post = -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ." }} | lang = "sh" }}
svn import DaSH/ svn+ssh://<username>@[[:Template:Project infrastructure/code]]/flightgear/fgaddon/trunk/Aircraft/ -m "Initial import of the DaSH human powered aircraft.\n\nFor details see the forum thread at http://forum.flightgear.org/viewtopic.php?f=4&t=24495 ."
Aliased parameters
{{fgaddon url | f = Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | b = branches/release-2016.1 }}.
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}.
Numbered parameters
{{fgaddon url | Aircraft/wrightFlyer1903/wrightFlyer1903-set.xml | b = branches/release-2016.1 }}.
https://Template:Project infrastructure/code/flightgear/fgaddonGeneric svn web interface is not implemented for {{repo link}}.
Related templates
|