Template:GitHub: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>AntumDeluge
Add category "RefactoringTemplates"
imported>AntumDeluge
Link to "Category:RefactoringTemplates" under "See Also" section & clarify usage
Line 9: Line 9:
== Usage ==
== Usage ==


<span style="font-family:monospace;font-size:20px;border:solid 2px;border-color:lightgray;"><nowiki>{{GitHub|user/org|[repo]|[branch/tag/commit]|[file]|[text]}}</nowiki></span>
* <span style="font-family:monospace;font-size:14px;border:solid 2px;border-color:lightgray;font-weight:bold;"><nowiki>{{GitHub|name|[repo|[branch/tag/commit|[file]]]|[text]}}</nowiki></span>

=== Arguments ===


{| class="wikitable"
{| class="wikitable"
! Argument || Description
! Argument || Required || Description
|-
|-
| user/org || User or organization name.
| name || {{status|check}} || User or organization name.
|-
|-
| repo || Repository name.
| repo || || Repository name.
|-
|-
| branch/tag/commit || Branch name or tag/commit ID.
| branch/tag/commit || || Branch name or tag/commit ID.
|-
|-
| file || Relative path to file.
| file || || Relative path to file.
|-
|-
| text || Alternate text to display.
| text || || Alternate text to display.
|}
|}


Line 50: Line 52:


* [[Templates|List of templates]]
* [[Templates|List of templates]]
* [[:Category:RefactoringTemplates|List of refactoring templates]]





Revision as of 01:10, 18 March 2018


Description

Template:GitHub

For quickly linking to repository pages or source files on GitHub.

Usage

  • {{GitHub|name|[repo|[branch/tag/commit|[file]]]|[text]}}

Arguments

Argument Required Description
name User or organization name.
repo Repository name.
branch/tag/commit Branch name or tag/commit ID.
file Relative path to file.
text Alternate text to display.

Example

Description Input Output
Link to a user/organization page. {{GitHub|arianne}} https://github.com/arianne
Link to a user/organization repository. {{GitHub|arianne|stendhal}} https://github.com/arianne/stendhal
Link to a repository branch/tag/commit. {{GitHub|arianne|stendhal|master}} https://github.com/arianne/stendhal/tree/master
Link to a file in a repository branch/tag/commit. {{GitHub|arianne|stendhal|cc06d43|data/sprites/outfit/dress/dress_005.png}} https://github.com/arianne/stendhal/blob/cc06d43/data/sprites/outfit/dress/dress_005.png
Display alternate text (user/organization). {{GitHub|arianne||||Arianne organization}} Arianne organization
Display alternate text (repo). {{GitHub|arianne|stendhal|||Stendhal repository}} Stendhal repository
Display alternate text (file). {{GitHub|arianne|stendhal|cc06d43|data/sprites/outfit/dress/dress_005.png|dress_005}} dress_005

See Also