Template:Github/doc

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 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:

Usage
Basic produces:

Action

produces:

Line number produces:

{	"params": { "repo": { "description": "Full repository name (e.g. \"mediawiki\" or \"mediawiki-extensions-EventLogging\"). Must not include any \".git\" suffix.", "type": "string", "default": "mediawiki", "label": "GitHub repository name" },		"action": { "description": "A GitHub repo action. One of \"blob\", \"raw\", \"blame\", \"commits\", or \"tree\"", "type": "string", "default": "blob", "label": "GitHub repository action" },		"branch": { "type": "string", "default": "master", "label": "GitHub branch", "description": "Represents the git branch of the repository to view", "example": "REL1_34" },		"file": { "type": "string", "required": true, "label": "Absolute file path", "description": "Represents the full, absolute path to the file" },		"line": { "type": "number", "label": "Line number", "description": "Represents the line number to directly link to" },		"text": { "description": "Custom label for the link created by this template.", "type": "string", "default": "The file path", "label": "Link label" },		"org": { "label": "GitHub organization name", "description": "The full name of the organization on GitHub", "type": "string", "default": "wikimedia" }	},	"description": "A convenient way of linking to source code on GitHub.", "paramOrder": [ "org", "repo", "action", "branch", "file", "line", "text" ],	"format": "inline" }