Template:Repo link: Difference between revisions

Jump to navigation Jump to search
Added GitHub support for zip archive downloads, and documented the option.
(Added GitHub examples for zip file downloads for branches or commits (to be implemented).)
(Added GitHub support for zip archive downloads, and documented the option.)
Line 178: Line 178:
             }}
             }}
         }}
         }}
    | zip = /archive/<!--                                          The base zip file URL.
    -->{{#if: {{{commit|{{{tag|{{{branch|}}} }}} }}}
        | {{{commit|{{{tag|{{{branch|}}} }}} }}}<!--              Download for a specific commit, tag, or branch (defaulting to master). -->
        | master<!--                                              Default to the master branch. -->
      }}.zip <!--
    -->{{#if: {{{text|}}}
        | {{{text}}} <!--                                          The text description for the link. -->
        | {{#if: {{{full|}}}
            | <!--                                                No text. -->
            | {{#if: {{{pre|}}}
                | {{{pre}}}<!--                                    A prefix to the link label. -->
                | {{#if: {{{simplepath|}}}
                    | <!--                                        No project, repository or branch. -->
                    | github/<!--                                  Site advertising.
                    -->{{{user|{{{proj|}}}}}}/<!--                  The user or project name
                    -->{{{repo|}}}/<!--                            The repository name.
                    -->{{{commit|{{{tag|{{{branch|}}} }}} }}}<!--  The commit, tag, or branch.-->
                  }}
              }} <nowiki></nowiki> zip file<!--                    The link description. -->
          }}
      }}
   }}
   }}
| gl
| gl
Line 332: Line 353:


; type: Choose between git or svn and web interface, a direct repository link, or a zip file download.  This can be one of '''git''', '''git web''', '''svn''', '''svn web''', or '''zip'''.  The default is '''git web'''.
; type: Choose between git or svn and web interface, a direct repository link, or a zip file download.  This can be one of '''git''', '''git web''', '''svn''', '''svn web''', or '''zip'''.  The default is '''git web'''.
: {{inote|Zip archive downloads are currently only supported for GitLab repositories.}}
: {{inote|Zip archive downloads are currently only supported for GitHub and GitLab repositories.}}


; user: The name of the user page for the open source infrastructure.  This is notably different to the '''login''' parameter.  This will generally have precedence over the '''proj''' parameter.  The user page is treated in the same way as a project name.
; user: The name of the user page for the open source infrastructure.  This is notably different to the '''login''' parameter.  This will generally have precedence over the '''proj''' parameter.  The user page is treated in the same way as a project name.
Line 497: Line 518:
  <nowiki><protocol>://raw.githubusercontent.com/<user|proj>/<repo>/<commit|branch>[/<path>][#L<line>]</nowiki>
  <nowiki><protocol>://raw.githubusercontent.com/<user|proj>/<repo>/<commit|branch>[/<path>][#L<line>]</nowiki>


==== GitHub URL <TEXT> ====
==== GitHub <URL> for 'type=zip' ====
For this parameter value, the zip file URL will be:
<nowiki><protocol>://github.com/<proj>/<repo>/archive/<commit|tag|branch>.zip</nowiki>
 
If neither a commit, branch, nor tag is specified, the URL will default to:
<nowiki><protocol>://github.com/<proj>/<repo>/archive/master.zip</nowiki>
 
==== GitHub URL <TEXT> for 'type=git' and 'type=git web' ====
The link text <code><TEXT></code>, if the '''full''' parameter is not set, will be:
The link text <code><TEXT></code>, if the '''full''' parameter is not set, will be:
  <nowiki>github/<user|proj>/<repo>/<commit|branch|HEAD>[/<path>][#L<line>]</nowiki>
  <nowiki>github/<user|proj>/<repo>/<commit|branch|HEAD>[/<path>][#L<line>]</nowiki>
Line 506: Line 534:
If the '''pre''' parameter is supplied, this changes to:
If the '''pre''' parameter is supplied, this changes to:
  <nowiki><pre>[/<path>][#L<line>]</nowiki>
  <nowiki><pre>[/<path>][#L<line>]</nowiki>
The '''text''' parameter trumps all, and <code><TEXT></code> is simply:
<nowiki><text></nowiki>
==== GitHub URL <TEXT> for 'type=zip' ====
The link text <code><TEXT></code>, if the '''full''' parameter is not set, will be:
<nowiki>github/<user|proj>/<repo>/[<commit|tag|branch>] zip file</nowiki>
If the '''simplepath''' parameter is set, this changes to:
<nowiki> zip file</nowiki>
If the '''pre''' parameter is supplied, this changes to:
<nowiki><pre> zip file</nowiki>


The '''text''' parameter trumps all, and <code><TEXT></code> is simply:
The '''text''' parameter trumps all, and <code><TEXT></code> is simply:

Navigation menu