6,566
edits
(Switch the 'site' parameter default to use the {{project infrastructure/code}} subtemplate.) |
(Redesign and large simplification of the GitHub URL and Mediawiki link text construction. Now if the 'user' or 'proj' parameters are not supplied the base GitHub URL will be constructed, and the default text of "GitHub website" will be used.) |
||
Line 198: | Line 198: | ||
| github = <!-- | | github = <!-- | ||
-->{{{protocol|https}}}://<!-- URL protocol (default = https). | -->{{{protocol|https}}}://<!-- URL protocol (default = https). | ||
-->github.com | -->github.com<!-- The URL. | ||
-->{{#if: {{{user|}}} <!-- | -->{{#if: {{{user|{{{proj|}}}}}} | {{#if: {{{repo|}}}<!-- Continue with the URL construction, only if the project or repository is given. --> | ||
| {{#if: {{{user|}}} <!-- Project or user? --> | |||
| /{{{user}}} | |||
| {{#if: {{{proj|}}} | /{{{proj|}}}}} | |||
-->{{{repo|}}}<!-- | }}<!-- | ||
-->{{#switch: {{{type|git web}}} <!-- | -->{{#if: {{{repo|}}} | /{{{repo|}}}}}<!-- The version control repository. | ||
-->{{#switch: {{{type|git web}}} <!-- The URL type. --> | |||
| git = .git<!-- Append '.git' to the base repository URL. --> | | git = .git<!-- Append '.git' to the base repository URL. --> | ||
| git web = /<!-- | | git web = /<!-- | ||
-->{{{view|tree}}}/<!-- The repository view. | -->{{{view|tree}}}/<!-- The repository view. | ||
-->{{{commit|{{{branch|master}}}}}}<!-- | -->{{{commit|{{{tag|{{{branch|master}}}}}}}}}<!-- The branch or commit. | ||
-->{{#if: {{{path|}}} | /{{{path}}}}}<!-- The file or directory path. | -->{{#if: {{{path|}}} | /{{{path}}}}}<!-- The file or directory path. | ||
-->{{#if: {{{line|}}} | #L{{{line}}} }} <!-- The optional line number(s). --> | -->{{#if: {{{line|}}} | #L{{{line}}} }} <!-- The optional line number(s). --> | ||
}} <!-- | | zip = /archive/<!-- The base zip file URL. | ||
-->{{{commit|{{{tag|{{{branch|master}}}}}}}}}.zip<!-- Download for a specific commit, tag, or branch (defaulting to master). --> | |||
}} | |||
}}}} <!-- | |||
-->{{#if: {{{text|}}} | |||
| {{{text}}}<!-- The text description for the link. --> | |||
| {{#ifeq: {{{full|}}} | 1 | |||
| <!-- No text. --> | |||
| {{#if: {{{user|{{{proj|}}}}}} | |||
| {{#if: {{{repo|}}} | |||
| {{#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|master}}}}}}}}}<!-- The repository commit, tag or branch.--> | |||
}} | |||
}}<!-- | |||
-->{{#switch: {{{type|git web}}} <!-- The URL type. --> | |||
| git web = | |||
{{#if: {{{path|}}} | /{{{path}}}}}<!-- The file or directory path. | |||
-->{{#if: {{{line|}}} | #L{{{line}}}}} <!-- The optional line number(s). | |||
-->{{#switch: {{{view|tree}}} <!-- The view description. --> | |||
| blob = | |||
| blame = <nowiki></nowiki> blame view | |||
| commit = <nowiki></nowiki> commit view | |||
| commits = <nowiki></nowiki> history view | |||
| raw = <nowiki></nowiki> raw view | |||
| tree = | |||
}} | |||
| zip = <nowiki></nowiki> zip file<!-- The link description. --> | |||
}} | }} | ||
}} | }} | ||
| GitHub website | |||
}} | }} | ||
}} | }} |