Template:Gitlab zip file: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Creation of the {{gitlab zip file}} subtemplate of {{repo link}}.)
 
(Added support for the 'tag' parameter.)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{repo link
{{repo link
| site                                     = gitlab
| site                                             = gitlab
| protocol                                 = https
| protocol                                         = https
| type                                     = zip
| type                                             = zip
| proj{{#if:{{{proj|}}}||NULL}}             = {{{proj}}}
| user{{#if:{{{user|{{{u|}}}}}}||NULL}}            = {{{user|{{{u}}}}}}
| repo{{#if:{{{repo|}}}||NULL}}             = {{{repo}}}
| proj{{#if:{{{proj|{{{p|{{{1|}}}}}}}}}||NULL}}     = {{{proj|{{{p|{{{1}}}}}}}}}
| branch{{#if:{{{branch|}}}||NULL}}         = {{{branch}}}
| repo{{#if:{{{repo|{{{r|{{{2|}}}}}}}}}||NULL}}     = {{{repo|{{{r|{{{2}}}}}}}}}
| commit{{#if:{{{commit|}}}||NULL}}         = {{{commit}}}
| branch{{#if:{{{branch|{{{b|{{{3|}}}}}}}}}||NULL}} = {{{branch|{{{b|{{{3}}}}}}}}}
| text{{#if:{{{text|}}}||NULL}}             = {{{text}}}
| tag{{#if:{{{tag|}}}||NULL}}                      = {{{tag}}}
| pre{{#if:{{{pre|}}}||NULL}}               = {{{pre}}}
| commit{{#if:{{{commit|{{{c|{{{4|}}}}}}}}}||NULL}} = {{{commit|{{{c|{{{4}}}}}}}}}
| post{{#if:{{{post|}}}||NULL}}             = {{{post}}}
| text{{#if:{{{text|{{{t|{{{5|}}}}}}}}}||NULL}}     = {{{text|{{{t|{{{5}}}}}}}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}}
| pre{{#if:{{{pre|}}}||NULL}}                       = {{{pre}}}
| full{{#if:{{{full|}}}||NULL}}             = {{{full}}}
| post{{#if:{{{post|}}}||NULL}}                     = {{{post}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}}         = {{{simplepath}}}
| full{{#if:{{{full|}}}||NULL}}                     = {{{full}}}
}}<noinclude>
}}<noinclude>


{{Informative template|1=
{{repo link/doc zip file
== Goal ==
| label              = GitLab
This template is for providing direct download links to zip archives of GitLab repositories.  It is a subtemplate of the master {{tl|repo link}} template designed to simplify the interface.
| site              = gitlab
 
| default_branch_git = master
== Usage ==
| gl                = 1
{{obr}}'''gitlab zip file'''
| git                = 1
{{!}} ''proj''      =
| examples          =
{{!}} ''repo''      =
{{!}} ''branch''    =
{{!}} ''commit''    =
{{!}} ''text''      =  
{{!}} ''pre''        =
{{!}} ''simplepath'' =
{{!}} ''full''      =
{{cbr}}
 
All parameters are optional.
 
; proj: The name of the project, consisting of a grouping of repositories on the open source infrastructure.
 
; repo: The name of the repository, for example '''fgdata'''.  A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name.
 
; branch: The git branch or tag name.  For git tags, simply append <code>/~</code> to the tag name.
 
; commit: The commit identifier (git hash).  This defaults to '''next'''.
 
; text: Text to display as the link label.  Overrides '''pre'''.
 
; pre: Prefix to a link label.
 
; simplepath:  If set, this strips off the repository name from the URL label, leaving just the contents of the '''path''' parameter.
: {{inote|The ''text'' parameter will override this.}}
 
; full: If set, the full URL will be shown.
 
== Examples ==
 
=== Branch ===
=== Branch ===
This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.
This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.
Line 81: Line 52:
| full  = 1
| full  = 1
}}
}}
=== Parameter alias ===
This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.
{{obr}}gitlab zip file
{{!}} p    = extra500
{{!}} r    = extra500
{{!}} b    = FG/2016.1
{{!}} full = 1
{{cbr}}
{{gitlab zip file
| p      = extra500
| r      = extra500
| b      = FG/2016.1
| full  = 1
}}
=== Zip file with tag ===
This is for https://gitlab.com/emilianh/IAR80/repository/archive.zip?ref=latest
{{obr}}gitlab zip file
{{!}} u    = emilianh
{{!}} r    = IAR80
{{!}} tag  = latest
{{!}} full = 1
{{cbr}}
{{gitlab zip file
| u    = emilianh
| r    = IAR80
| tag  = latest
| full = 1
}}
=== Numbered parameters ===
This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.
{{obr}}gitlab zip file {{!}} extra500 {{!}} extra500 {{!}} FG/2016.1 {{!}} full = 1 {{cbr}}
{{gitlab zip file | extra500 | extra500 | FG/2016.1 | full = 1 }}


== Related templates ==
== Related templates ==

Latest revision as of 13:35, 15 July 2016

GitLab website


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

Goal

This template is for providing direct download links to the automatically generated zip archives of GitLab repositories. The temporary zip file is created on demand when the link is followed. It is a subtemplate of the master {{repo link}} template designed to simplify the interface.

Usage

Usage

{{gitlab zip file
| user       =
| proj       =
| repo       =
| branch     =
| tag        =
| commit     =

| text       =
| pre        =
| simplepath =
| full       =
}}

The parameters are:

Parameter Description Abbreviated
parameter
Numbered
parameter
Status
user The name of the user page for the GitLab open source infrastructure. This is notably different to the login parameter. This will have precedence over the proj parameter. The user page is treated in the same way as a project name. u 1 mandatory
proj The name of the project, consisting of a grouping of repositories on the GitLab open source infrastructure. p 1 mandatory
repo The name of the repository. A project registered on the GitLab open source infrastructure generally allows for multiple repositories under that project name. r 2 mandatory
branch The branch name. This defaults to master. b 3 optional
tag The repository tag name. optional
commit The commit identifier (git hash). This defaults to HEAD. c 4 optional
text Text to display as the link label. Overrides pre. t 5 optional
pre Prefix to a link label. optional
simplepath If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
Note The text parameter will override this.
optional
full If set to 1, the full URL will be shown rather than any text label. optional

Examples

Branch

This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.

{{gitlab zip file
| proj   = extra500
| repo   = extra500
| branch = FG/2016.1
}}

gitlab/extra500/extra500/FG/2016.1 zip file

Or as a full download link:

{{gitlab zip file
| proj   = extra500
| repo   = extra500
| branch = FG/2016.1
| full   = 1
}}

https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1

Parameter alias

This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.

{{gitlab zip file
| p    = extra500
| r    = extra500
| b    = FG/2016.1
| full = 1
}}

https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1

Zip file with tag

This is for https://gitlab.com/emilianh/IAR80/repository/archive.zip?ref=latest

{{gitlab zip file
| u    = emilianh
| r    = IAR80
| tag  = latest
| full = 1
}}

https://gitlab.com/emilianh/IAR80/repository/archive.zip?ref=latest

Numbered parameters

This is for https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1.

{{gitlab zip file | extra500 | extra500 | FG/2016.1 | full = 1 }}

https://gitlab.com/extra500/extra500/repository/archive.zip?ref=FG/2016.1

Related templates

Related templates