Template:GithubToTravis/doc
From MozillaWiki
Usage
{{GithubToTravis}} (or {{gtt}}) converts Github-links to Travis CI-links, with the option to display the link as a full address, with custom link text, or as an image (the Travis CI icon).
Parameters
There are 2 parameters, both named, of which one is required and 1 is optional.
Syntax
The template's syntax is
-
{{GithubToTravis|github= |IconOnly= }}
or, for quick and easy typing,
-
{{gtt|github= |IconOnly= }}
Required parameter
github
- Github link
The full URL of the Github link you want to convert.
- Notes
- You can format the link address as an external wikilink (
[https://www.example.moz/ Custom link text]
, notice the space character between the URL and the desired link text).
- Usage
-
{{GithubToTravis|github=full github link}}
Optional parameter
IconOnly
- Displays Travis CI icon
Use this parameter to display the link as the Travis CI icon (, for actual size, see Examples below).
- Notes
- The parameter name is case-sensitive, i.e. it must be entered as
IconOnly
, with capital letters and all, or the template will not display the icon. - You can enter any value you want to invoke this parameter, but if you leave the parameter empty (i.e. only type
IconOnly=
) the template will not display the icon.
- Usage
-
{{GithubToTravis|IconOnly=true}}
Examples
Correct use
Case | What you type | What you see | Comments |
---|---|---|---|
Plain link | https://github.com/mozilla/build-relengapi-slaveloan}} | https://travis-ci.org/mozilla/build-relengapi-slaveloan | |
External wikilink |
github=[https://github.com/mozilla/build-relengapi-slaveloan build-relengapi-slaveloan]}} | build-relengapi-slaveloan | Output as an external wikilink, displaying the custom link text |
Image | github=https://github.com/mozilla/build-relengapi-slaveloan|IconOnly=True}} |
Incorrect use
Case | What you type | What you see | Comments |
---|---|---|---|
No value for IconOnly |
github=https://github.com/mozilla/build-relengapi-slaveloan|IconOnly=}} | https://travis-ci.org/mozilla/build-relengapi-slaveloan | IconOnly will be ignored, and the template falls back to displaying the entered link
|
Param name of IconOnly is case-sensitive |
github=https://github.com/mozilla/build-relengapi-slaveloan|icononly=True}} | https://travis-ci.org/mozilla/build-relengapi-slaveloan | If IconOnly is entered as, e.g. "icononly", it will be ignored, and the template will fall back to displaying the entered link
|
Fallbacks
Case | What you type | What you see | Comments |
---|---|---|---|
Other value than true for IconOnly |
github=https://github.com/mozilla/build-relengapi-slaveloan|IconOnly=gurka}} | IconOnly interprets any entered value as true
|
See also
- {{ExternalLinkToText}}: {{GithubToTravis}} calls this template to check the entered URLs.