Template:Github zip file: Difference between revisions
(Added examples for aliased and numbered parameter usage.) |
(Added support for the 'tag' parameter.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{repo link | {{repo link | ||
| site | | site = github | ||
| protocol | | protocol = https | ||
| type | | type = zip | ||
| user{{#if:{{{user|}}}||NULL}} = {{{user}}} | | user{{#if:{{{user|{{{u|}}}}}}||NULL}} = {{{user|{{{u}}}}}} | ||
| proj{{#if:{{{proj|}}}||NULL}} | | proj{{#if:{{{proj|{{{p|{{{1|}}}}}}}}}||NULL}} = {{{proj|{{{p|{{{1}}}}}}}}} | ||
| repo{{#if:{{{repo|}}}||NULL}} | | repo{{#if:{{{repo|{{{r|{{{2|}}}}}}}}}||NULL}} = {{{repo|{{{r|{{{2}}}}}}}}} | ||
| branch{{#if:{{{branch|}}}||NULL}} | | branch{{#if:{{{branch|{{{b|{{{3|}}}}}}}}}||NULL}} = {{{branch|{{{b|{{{3}}}}}}}}} | ||
| commit{{#if:{{{commit|}}}||NULL}} | | tag{{#if:{{{tag|}}}||NULL}} = {{{tag}}} | ||
| text{{#if:{{{text|}}}||NULL}} | | commit{{#if:{{{commit|{{{c|{{{4|}}}}}}}}}||NULL}} = {{{commit|{{{c|{{{4}}}}}}}}} | ||
| pre{{#if:{{{pre|}}}||NULL}} | | text{{#if:{{{text|{{{t|{{{5|}}}}}}}}}||NULL}} = {{{text|{{{t|{{{5}}}}}}}}} | ||
| simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}} | | pre{{#if:{{{pre|}}}||NULL}} = {{{pre}}} | ||
| full{{#if:{{{full|}}}||NULL}} | | simplepath{{#if:{{{simplepath|}}}||NULL}} = {{{simplepath}}} | ||
| full{{#if:{{{full|}}}||NULL}} = {{{full}}} | |||
}}<noinclude> | }}<noinclude> | ||
Line 71: | Line 72: | ||
=== Aliased parameters === | === Aliased parameters === | ||
This is for https://github.com/Juanvvc/c172p-detailed/archive/ | This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip. | ||
{{obr}}github zip file | {{obr}}github zip file | ||
Line 88: | Line 89: | ||
=== Numbered parameters === | === Numbered parameters === | ||
This is for https://github.com/Juanvvc/c172p-detailed/archive/ | This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip. | ||
{{obr}}github zip file {{!}} Juanvvc {{!}} c172p-detailed {{!}} release/2016.1 {{!}} full = 1 {{cbr}}. | {{obr}}github zip file {{!}} Juanvvc {{!}} c172p-detailed {{!}} release/2016.1 {{!}} full = 1 {{cbr}}. |
Latest revision as of 13:35, 15 July 2016
Goal
This template is for providing direct download links to the automatically generated zip archives of GitHub 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
{{github 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 GitHub 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 GitHub open source infrastructure. | p | 1 | mandatory |
repo | The name of the repository. A project registered on the GitHub 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.
|
optional | ||
full | If set to 1, the full URL will be shown rather than any text label. | optional |
Examples
Default
This is for https://github.com/Juanvvc/c172p-detailed/archive/master.zip.
{{github zip file | proj = Juanvvc | repo = c172p-detailed | full = 1 }}.
https://github.com/Juanvvc/c172p-detailed/archive/master.zip.
Branch
This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
{{github zip file | proj = Juanvvc | repo = c172p-detailed | branch = release/2016.1 | full = 1 }}.
https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
Commit
This is for https://github.com/Juanvvc/c172p-detailed/archive/c9cef81a899201802b32109c43ca686bbeffdb42.zip.
{{github zip file | proj = Juanvvc | repo = c172p-detailed | commit = c9cef81a899201802b32109c43ca686bbeffdb42 | full = 1 }}.
https://github.com/Juanvvc/c172p-detailed/archive/c9cef81a899201802b32109c43ca686bbeffdb42.zip.
Aliased parameters
This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
{{github zip file | p = Juanvvc | r = c172p-detailed | b = release/2016.1 | full = 1 }}.
https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
Numbered parameters
This is for https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
{{github zip file | Juanvvc | c172p-detailed | release/2016.1 | full = 1 }}.
https://github.com/Juanvvc/c172p-detailed/archive/release/2016.1.zip.
Related templates
|