Difference between revisions of "Template:Repo link/doc commit"

From relax wiki
Jump to navigation Jump to search
(Creation of the {{repo link/doc commit}} template. This is adapted from the FlightGear page http://wiki.flightgear.org/index.php?title=Template:Repo_link/doc_commit&oldid=94927.)
 
m (Switch from the imported {{informative template}} to the relax {{template info}} template)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Informative template|1=
+
{{template info |1=
 
__NOTOC__
 
__NOTOC__
 
== Goal ==
 
== Goal ==
Line 5: Line 5:
  
 
{{repo link/doc usage
 
{{repo link/doc usage
| template                    = {{{repo|MISSING}}} commit
+
| template                    = {{{label|MISSING}}} commit
 
| commit                      = 1
 
| commit                      = 1
 
| type_commit                = num
 
| type_commit                = num
Line 24: Line 24:
 
{{repo link/doc design sourceforge commit
 
{{repo link/doc design sourceforge commit
 
| label{{#if:{{{label|}}}||NULL}} = {{{label}}}
 
| label{{#if:{{{label|}}}||NULL}} = {{{label}}}
| proj                           = {{{proj}}}
+
| proj{{#if:{{{proj|}}}||NULL}}  = {{{proj}}}
 
| repo{{#if:{{{repo|}}}||NULL}}  = {{{repo}}}
 
| repo{{#if:{{{repo|}}}||NULL}}  = {{{repo}}}
 
| user                            = 0
 
| user                            = 0
Line 34: Line 34:
 
== Examples ==
 
== Examples ==
 
=== Auto-generated text ===
 
=== Auto-generated text ===
  {{obr}}{{{repo|MISSING}}} commit {{!}} {{{eg1commit|MISSING}}}{{cbr}}
+
  {{obr}}{{{label|MISSING}}} commit {{!}} {{{eg1commit|MISSING}}}{{cbr}}
  
{{{{{repo|MISSING}}} commit | {{{eg1commit|MISSING}}} }}
+
{{{{{label|MISSING}}} commit | {{{eg1commit|MISSING}}} }}
  
 
=== User supplied text ===
 
=== User supplied text ===
  {{{eg2intro|MISSING}}} {{obr}}{{{repo|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} text = {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
+
  {{{eg2intro|MISSING}}} {{obr}}{{{label|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} text = {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
  
 
{{{eg2intro|MISSING}}}
 
{{{eg2intro|MISSING}}}
{{{{{repo|MISSING}}} commit
+
{{{{{label|MISSING}}} commit
 
| {{{eg2commit|MISSING}}}
 
| {{{eg2commit|MISSING}}}
 
| text = {{{eg2text|MISSING}}}
 
| text = {{{eg2text|MISSING}}}
Line 49: Line 49:
  
 
=== Parameter alias ===
 
=== Parameter alias ===
  {{{eg2intro|MISSING}}} {{obr}}{{{repo|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} t = {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
+
  {{{eg2intro|MISSING}}} {{obr}}{{{label|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} t = {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
  
 
{{{eg2intro|MISSING}}}
 
{{{eg2intro|MISSING}}}
{{{{{repo|MISSING}}} commit
+
{{{{{label|MISSING}}} commit
 
| {{{eg2commit|MISSING}}}
 
| {{{eg2commit|MISSING}}}
 
| t = {{{eg2text|MISSING}}}
 
| t = {{{eg2text|MISSING}}}
Line 59: Line 59:
  
 
=== Numbered parameters ===
 
=== Numbered parameters ===
  {{{eg2intro|MISSING}}} {{obr}}{{{repo|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
+
  {{{eg2intro|MISSING}}} {{obr}}{{{label|MISSING}}} commit {{!}} {{{eg2commit|MISSING}}} {{!}} {{{eg2text|MISSING}}}{{cbr}}{{#if: {{{eg2post|}}} |  {{{eg2post}}} }}.
  
 
{{{eg2intro|MISSING}}}
 
{{{eg2intro|MISSING}}}
{{{{{repo|MISSING}}} commit
+
{{{{{label|MISSING}}} commit
 
| {{{eg2commit|MISSING}}}
 
| {{{eg2commit|MISSING}}}
 
| {{{eg2text|MISSING}}}
 
| {{{eg2text|MISSING}}}

Latest revision as of 13:14, 23 October 2020

Template documentation

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. 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/<proj>/<repo>/

SourceForge git <URL>

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

https://sourceforge.net/p/<proj>/<repo>/ci/<commit>

SourceForge svn <URL>

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

https://sourceforge.net/p/<proj>/<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/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

{{MISSING commit | MISSING}}

Template:MISSING commit

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