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 Gitiles or Diffusion the Gitblit server at git.wikimedia.org (WMF deprecated gitblit and git.wikimedia.org in 2015). Editors may find GitHub's interface more user-friendly, faster responding, visually appealing, or otherwise preferable. Compare:
- gitiles link ←
{{git file|file=index.php|text=gitiles link|line=39|branch=REL1_25}}
- github link ←
{{github|index.php|github link|line=39|branch=REL1_25}}
Usage
[edit]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 on GitHub.
Parameter | Description | Type | Status | |
---|---|---|---|---|
GitHub owner name | owner | The GitHub username of the user or organization that owns the repository
| String | optional |
GitHub repository name | repo | Full repository name (e.g. "mediawiki" or "mediawiki-extensions-EventLogging"). Must not include any ".git" suffix.
| String | optional |
GitHub repository action | action | A GitHub repo action. One of "blob", "raw", "blame", "commits", or "tree"
| String | optional |
GitHub branch | branch | Represents the git branch of the repository to view
| String | optional |
Absolute file path | file | Represents the full, absolute path to the file | String | required |
Line number | line | Represents the line number to directly link to | Number | optional |
Link label | text | Custom label for the link created by this template.
| String | optional |
See also
[edit]- {{Git file }}
- {{Git }}
- {{GithubDownload }}