Template:Repo link/doc commit: Difference between revisions
(Addition of the relevant {{repo link/doc design *}} templates and {{repo link/doc plain text}} for more extensive documentation, and introduction of the 'git' and 'svn' parameter for finer control.) |
(Switch to the {{repo link/doc design sourceforge commit}} documentation template.) |
||
Line 22: | Line 22: | ||
{{repo link/doc design intro}} | {{repo link/doc design intro}} | ||
{{repo link/doc design overview}} | {{repo link/doc design overview}} | ||
{{repo link/doc design sourceforge|user=0|git={{{git|1}}}|svn={{{svn|1}}}}} | {{repo link/doc design sourceforge commit | ||
| label{{#if:{{{label|}}}||NULL}} = {{{label}}} | |||
| proj = flightgear | |||
| repo{{#if:{{{repo|}}}||NULL}} = {{{repo}}} | |||
| user = 0 | |||
| git = {{{git|1}}} | |||
| svn = {{{svn|1}}}}} | |||
{{repo link/doc plain text}} | {{repo link/doc plain text}} | ||
Revision as of 19:37, 6 March 2016
Goal
This template can be used when linking to summaries of commits for the MISSING git repository at SourceForge. It is a subtemplate of the master {{repo link}} template designed to link to specific version control commits.
Usage
{{MISSING commit | commit | text = }}
The parameters are:
Parameter | Description | Abbreviated parameter |
Numbered parameter |
Status |
---|---|---|---|---|
commit | The commit identifier (git hash or svn revision number). This defaults to HEAD. | 1 | mandatory | |
text | Text to display as the link label. | t | 2 | 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:
https://sourceforge.net/p/flightgear/<repo>/
SourceForge git <URL>
For the svn repository type, the <URL>
value will be:
https://sourceforge.net/p/flightgear/<repo>/ci/<commit>
SourceForge svn <URL>
For the svn repository type, the <URL>
value will be:
https://sourceforge.net/p/flightgear/<repo>/<commit|HEAD>
SourceForge URL <TEXT>
The link text <TEXT>
, if the text parameter is not set, will simply be:
MISSING commit <commit>
Or if the text parameter is supplied, the <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
Auto-generated text
{{MISSING commit | MISSING}}
User supplied text
MISSING {{MISSING commit | MISSING | text = MISSING}}.
MISSING Template:MISSING commit .
Parameter alias
MISSING {{MISSING commit | MISSING | t = MISSING}}.
MISSING Template:MISSING commit .
Numbered parameters
MISSING {{MISSING commit | MISSING | MISSING}}.
MISSING Template:MISSING commit .
Related templates
|