Template:GithubToTravis/doc
Jump to navigation
Jump to search
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 | {{GithubToTravis|https://github.com/mozilla/build-relengapi-slaveloan}} |
https://travis-ci.org/mozilla/build-relengapi-slaveloan | |
External wikilink |
{{GithubToTravis|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 | {{GithubToTravis|github=https://github.com/mozilla/build-relengapi-slaveloan|IconOnly=True}} |
![]() |
Incorrect use
Case | What you type | What you see | Comments |
---|---|---|---|
No value for IconOnly |
{{GithubToTravis|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 |
{{GithubToTravis|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
See also
- {{ExternalLinkToText}}: {{GithubToTravis}} calls this template to check the entered URLs.