Difference between revisions of "Template:Relax commit"
(Creation of the {{relax commit}} template. This is adapted from the FlightGear page http://wiki.flightgear.org/index.php?title=Template:Flightgear_commit&oldid=95808.) |
m (Fixes for the examples to use real relax commits.) |
||
Line 17: | Line 17: | ||
| git = 1 | | git = 1 | ||
| svn = 0 | | svn = 0 | ||
− | | eg1commit = | + | | eg1commit = 512a20 |
− | | eg2intro = | + | | eg2intro = Releases such as |
− | | eg2commit = | + | | eg2commit = a4c4c3 |
− | | eg2text = | + | | eg2text = relax version 4.0.3 |
}} | }} | ||
</noinclude> | </noinclude> |
Latest revision as of 12:45, 25 October 2017
{{relax commit}}: Missing parameter commit
Template documentation
Contents
Goal
This template can be used when linking to summaries of commits for the relax git repository at SourceForge. It is a subtemplate of the master {{repo link}} template designed to link to specific version control commits.
Usage
{{relax commit | commit | text = }}
The parameters are:
Parameter | Description | Abbreviated parameter |
Numbered parameter |
Status |
---|---|---|---|---|
commit | The commit identifier (git hash). 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/nmr-relax/code/
SourceForge git <URL>
For the svn repository type, the <URL>
value will be:
https://sourceforge.net/p/nmr-relax/code/ci/<commit>
SourceForge URL <TEXT>
The link text <TEXT>
, if the text parameter is not set, will simply be:
relax 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/nmr-relax/code/ci/master/tree/
To use the <code> tags:
{{#tag:code|{{#tag:nowiki| {{repo link | full = 1 }} }}}}
https://sourceforge.net/p/nmr-relax/code/ci/master/tree/
Examples
Auto-generated text
{{relax commit | 512a20}}
User supplied text
Releases such as {{relax commit | a4c4c3 | text = relax version 4.0.3}}.
Releases such as relax version 4.0.3 .
Parameter alias
Releases such as {{relax commit | a4c4c3 | t = relax version 4.0.3}}.
Releases such as relax version 4.0.3 .
Numbered parameters
Releases such as {{relax commit | a4c4c3 | relax version 4.0.3}}.
Releases such as relax version 4.0.3 .
Related templates
|