Template:Github/doc
This is a documentation subpage for Template:Github. It contains usage information, categories and other content that is not part of the original template page. |
This template provides an alternative to {{git file}} for linking to source code.
This uses the GitHub mirror instead of Diffusion the Gitblit server at git.wikimedia.org (WMF is deprecating gitblit and git.wikimedia.org in 2015). Editors may find GitHub's interface more user-friendly, faster responding, visually appealing, or otherwise preferable. Compare:
- diffusion link ←
{{git file|file=index.php|text=diffusion link|line=39|branch=REL1_25}}
- github link ←
{{github|index.php|github link|line=39|branch=REL1_25}}
Usage
Basic
{{github |file=composer.json }} {{github |repo=mediawiki-extensions-Flow |file=composer.json }}
produces:
Action
{{github |repo=mediawiki-extensions-EventLogging |file=server/bin/eventlogging-devserver |text=development server | action=raw }}
produces:
Line number
{{github |file=tests/phpunit/includes/MessageTest.php |line=152 }}
produces:
A convenient way of linking to source code.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Repo | repo | Full repository name (e.g. "mediawiki" or "mediawiki/extensions/EventLogging"). Must not include any ".git" suffix.
| String | optional |
Action | action | A GitHub repo action. One of "blob", "raw", "blame", "commits", or "tree"
| String | optional |
Branch | branch | no description
| String | optional |
File | file | no description
| String | required |
Line | line | no description | Number | optional |
Text | text | Custom label for the link created by this template.
| String | optional |
See also
- {{Git file}}
- {{Git}}
- {{GithubDownload}}