Template:Simgear commit: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Typo)
m (Switch from the temporary {{project infrastructure/code}} template to {{project infrastructure}} template with the mode set to 'abbrev'.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#if: {{{1|}}} <!-- Is the commit defined? -->
{{repo link
| <!-- Yes, the commit is defined
| site  = {{project infrastructure|abbrev}}
   -->[http://sourceforge.net/p/flightgear/simgear/ci/{{{1|}}} <!--
| repo   = simgear
   -->{{#if: {{{t|}}} <!-- Is a custom label defined? -->
| commit = {{{1|next}}}
  | <!-- Yes, a custom label is defined
| view   = commit
    -->{{{t}}}
| text  = {{#if: {{{1|}}}
  | <!-- No, a custom label is not defined
  | {{{text|{{{t|{{{2|SimGear commit {{{1}}} }}} }}} }}}
    -->SimGear commit {{{1}}}
  | {{error|Missing parameter '''commit'''|simgear commit}}
  }}]
  }}
| <!-- No, the commit is not defined.  Throw an error.
  --><big style="color:red;">{{tl|simgear commit}} Missing parameter '''commit'''</big>
}}<noinclude>
}}<noinclude>
{{Informative template|1=
__NOTOC__
== Goal ==
This template can be used when linking to summaries of commits to the FlightGear Git repository at SourceForge.
== Usage ==
{{obr}}'''simgear commit'''{{!}}commit {{!}}''t=''{{cbr}}
; commit:  The commit to link to. Mandatory
; t:      Optional custom link label
== Examples ==
<nowiki>{{simgear commit|c1b579ec}}</nowiki>
{{simgear commit|c1b579ec}}
<nowiki>The surface light restriction {{simgear commit|1a752d28 |t=has been lifted}}.</nowiki>
The surface light restriction {{simgear commit|1a752d28 |t=has been lifted}}.
== Related templates ==
=== Commit link templates ===
* {{tl|fgaddon revision}}
* {{tl|fgdata commit}}
* {{tl|flightgear commit}}
=== Source link templates ===
* {{tl|fgaddon url}}
* {{tl|fgdata file}}
* {{tl|simgear file}}
* {{tl|flightgear file}}


{{repo link/doc commit
| label    = SimGear
| repo      = simgear
| git      = 1
| svn      = 0
| eg1commit = c1b579ec
| eg2intro  = The surface light restriction
| eg2commit = 1a752d28
| eg2text  = has been lifted
}}
}}


[[Category:Repository link templates]]
</noinclude>
</noinclude>

Latest revision as of 16:20, 20 June 2019

{{simgear commit}}: Missing parameter commit


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

Goal

This template can be used when linking to summaries of commits for the SimGear git repository at SourceForge. It is a subtemplate of the master {{repo link}} template designed to link to specific version control commits.

Usage

{{simgear 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/flightgear/simgear/

SourceForge git <URL>

For the svn repository type, the <URL> value will be:

https://sourceforge.net/p/flightgear/simgear/ci/<commit>

SourceForge URL <TEXT>

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

SimGear 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

{{simgear commit | c1b579ec}}

SimGear commit c1b579ec

User supplied text

The surface light restriction {{simgear commit | 1a752d28 | text = has been lifted}}.

The surface light restriction has been lifted .

Parameter alias

The surface light restriction {{simgear commit | 1a752d28 | t = has been lifted}}.

The surface light restriction has been lifted .

Numbered parameters

The surface light restriction {{simgear commit | 1a752d28 | has been lifted}}.

The surface light restriction has been lifted .

Related templates