Template:Repo link/doc usage: Difference between revisions
Jump to navigation
Jump to search
(Documentation of parameter shortcuts for the {{repo link}} subtemplates. This is to document abbreviated parameters, e.g. 'l' as an alias for 'line'. And for positional parameters, e.g. {{{1}}} for 'proj'.) |
(Switched to a sortable wikitable for the parameter shortcuts.) |
||
Line 185: | Line 185: | ||
--> | --> | ||
{{#if: {{{shortcut|}}} |=== The Parameter shortcuts ===}} | {{#if: {{{shortcut|}}} |=== The Parameter shortcuts ===}} | ||
{| class="wikitable" style="text-align: center; {{#if: {{{shortcut|}}} | | display: none;}}" | {| class="wikitable sortable" style="text-align: center; {{#if: {{{shortcut|}}} | | display: none;}}" | ||
! style="width: 33%" | Parameter | ! style="width: 33%" | Parameter | ||
! style="width: 33%" | Abbreviated parameter | ! style="width: 33%" | Abbreviated parameter |
Revision as of 14:14, 5 March 2016
{{MISSING }}
The following template description is not displayed when the template is inserted in an article.
Goal
This is a master documentation template for use in all of the {{repo link}} subtemplates. It documents the usage of the templates.
Usage
{{repo link/doc usage | template = | site = | cmd = | opt = | protocol = | login = | type = | user = | proj = | repo = | branch = | tag = | path = | commit = | line = | post = | view = | text = | pre = | simplepath = | full = | intro = | sf = | gh = | gl = | go = | svn = | git = | eg_cmd = | default_protocol = | default_type = | default_proj = | default_repo = }}
Examples
All options
{{repo link/doc usage | template = repo link | site = 1 | cmd = 1 | opt = 1 | protocol = 1 | login = 1 | type = 1 | user = 1 | proj = 1 | repo = 1 | branch = 1 | tag = 1 | path = 1 | commit = 1 | line = 1 | post = 1 | view = 1 | text = 1 | pre = 1 | simplepath = 1 | full = 1 | intro = All parameters except site are optional. | sf = 1 | gh = 1 | gl = 1 | go = 1 | svn = 1 | git = 1 }}
{{repo link | site = | cmd = | opt = | protocol = | login = | type = | user = | proj = | repo = | branch = | tag = | path = | commit = | line = | post = | view = | text = | pre = | simplepath = | full = }}
All parameters except site are optional.
- site
- Points the template to a repository host:
- For SourceForge use either s, sf or sourceforge.
- For GitHub use either gh, gith or github.
- For GitLab use either gl, gitl or gitlab.
- For the Gitorious archive use either g, gito or gitorious.
- For generic repositories, the site parameter will be interpreted as the domain name.
- cmd
- An optional command line tool name + options to prepend to the URL. For example git clone.
- opt
- Any additional options to show after cmd, if supplied.
- Note Developer note: This is for future non-CLI handling of a standardised set of cmd parameter values
- protocol
- The URL protocol, for example https, http, ssh, git, svn. This defaults to https.
- login
- The optional user login. This should not to be confused with the user parameter.
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, svn, svn web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
- Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
- user
- The name of the user page for the open source infrastructure. This is notably different to the login parameter. This will generally have precedence over the proj parameter. The user page is treated in the same way as a project name.
- proj
- The name of the project, consisting of a grouping of repositories on the open source infrastructure. This defaults to flightgear.
- repo
- The name of the repository, for example fgdata. A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name. This defaults to flightgear.
- branch
- The branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. For git tags, simply append
/~
to the tag name. This defaults to next or trunk for git and svn respectively. - tag
- Reserved for future use. This will be used for a situation in which tags and branches are treated differently by an open source infrastructure site.
- path
- The file path.
- commit
- The commit identifier (git hash or svn revision number). This defaults to next and HEAD for git and svn respectively.
- line
- The line number(s) of the file to display.
- For SourceForge and the Gitorious archive: Use a single line number.
- For GitHub either use:
- A single line number, for example 2.
- Two line numbers separated with a hyphen (-), for example 3-10.
- post
- Text to append. This is forms a set with to the cmd and opt parameters. For example it can represent any command line options that come after the URL.
- view
- View to display:
- For SourceForge use one of tree, log, commit, or rss. The default is tree.
- For GitHub use one of blob, blame, commit, commits or raw. The default is tree.
- The GitLab interface for type=git web is not yet implemented in the master {{repo link}} template, so the view parameter currently does nothing.
- For the Gitorious archive use one of summary, shortlog, log, blob, commit, commitdiff, tree, history, or raw. The default is blob if a path is given, commit if a commit is given, or summary otherwise.
- text
- Text to display as the link label. Overrides pre.
- pre
- Prefix to a link label.
- simplepath
- If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
- Note The text parameter will override this.
- full
- If set, the full URL will be shown rather than any text label.
Shortcuts enabled
{{repo link/doc usage | template = repo link | site = 1 | cmd = 1 | opt = 1 | protocol = 1 | login = 1 | type = 1 | short_type = y | user = 1 | short_user = u | pos_user = 1 | proj = 1 | short_proj = j | pos_proj = 1 | repo = 1 | short_repo = r | pos_repo = 2 | branch = 1 | short_branch = b | pos_branch = 3 | tag = 1 | path = 1 | short_path = p | pos_path = 4 | commit = 1 | short_commit = c | pos_commit = 5 | line = 1 | short_line = l | post = 1 | view = 1 | short_view = v | text = 1 | short_text = t | pre = 1 | simplepath = 1 | full = 1 | short_full = f | intro = All parameters except site are optional. | sf = 1 | gh = 1 | gl = 1 | go = 1 | svn = 1 | git = 1 | shortcut = 1 }}
{{repo link | site = | cmd = | opt = | protocol = | login = | type = | user = | proj = | repo = | branch = | tag = | path = | commit = | line = | post = | view = | text = | pre = | simplepath = | full = }}
All parameters except site are optional.
- site
- Points the template to a repository host:
- For SourceForge use either s, sf or sourceforge.
- For GitHub use either gh, gith or github.
- For GitLab use either gl, gitl or gitlab.
- For the Gitorious archive use either g, gito or gitorious.
- For generic repositories, the site parameter will be interpreted as the domain name.
- cmd
- An optional command line tool name + options to prepend to the URL. For example git clone.
- opt
- Any additional options to show after cmd, if supplied.
- Note Developer note: This is for future non-CLI handling of a standardised set of cmd parameter values
- protocol
- The URL protocol, for example https, http, ssh, git, svn. This defaults to https.
- login
- The optional user login. This should not to be confused with the user parameter.
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, svn, svn web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
- Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
- user
- The name of the user page for the open source infrastructure. This is notably different to the login parameter. This will generally have precedence over the proj parameter. The user page is treated in the same way as a project name.
- proj
- The name of the project, consisting of a grouping of repositories on the open source infrastructure. This defaults to flightgear.
- repo
- The name of the repository, for example fgdata. A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name. This defaults to flightgear.
- branch
- The branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. For git tags, simply append
/~
to the tag name. This defaults to next or trunk for git and svn respectively. - tag
- Reserved for future use. This will be used for a situation in which tags and branches are treated differently by an open source infrastructure site.
- path
- The file path.
- commit
- The commit identifier (git hash or svn revision number). This defaults to next and HEAD for git and svn respectively.
- line
- The line number(s) of the file to display.
- For SourceForge and the Gitorious archive: Use a single line number.
- For GitHub either use:
- A single line number, for example 2.
- Two line numbers separated with a hyphen (-), for example 3-10.
- post
- Text to append. This is forms a set with to the cmd and opt parameters. For example it can represent any command line options that come after the URL.
- view
- View to display:
- For SourceForge use one of tree, log, commit, or rss. The default is tree.
- For GitHub use one of blob, blame, commit, commits or raw. The default is tree.
- The GitLab interface for type=git web is not yet implemented in the master {{repo link}} template, so the view parameter currently does nothing.
- For the Gitorious archive use one of summary, shortlog, log, blob, commit, commitdiff, tree, history, or raw. The default is blob if a path is given, commit if a commit is given, or summary otherwise.
- text
- Text to display as the link label. Overrides pre.
- pre
- Prefix to a link label.
- simplepath
- If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
- Note The text parameter will override this.
- full
- If set, the full URL will be shown rather than any text label.
The Parameter shortcuts
Parameter | Abbreviated parameter | Numbered/positional parameter |
---|---|---|
site | ||
cmd | ||
opt | ||
type | y | |
user | u | 1 |
proj | j | 1 |
repo | r | 2 |
branch | b | 3 |
tag | ||
path | p | 4 |
commit | c | 5 |
line | l | |
post | ||
view | v | |
text | t | |
pre | ||
simplepath | ||
full | f |
Parameter: type
Everything
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | gh = 1 | gl = 1 | go = 1 | svn = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, svn, svn web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
- Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
Everything svn
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | gh = 1 | gl = 1 | go = 1 | svn = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of svn, svn web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is svn web.
- Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
Everything git
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | gh = 1 | gl = 1 | go = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
- Note Zip archive downloads are currently only supported for GitHub and GitLab repositories.
SourceForge
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | svn = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface or a direct repository link. This can be one of git, git web, svn, svn web. The default is git web.
SourceForge svn
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | svn = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface or a direct repository link. This can be one of svn, svn web. The default is svn web.
SourceForge git
{{repo link/doc usage | template = repo link | type = 1 | sf = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface or a direct repository link. This can be one of git, git web. The default is git web.
GitHub and GitLab
{{repo link/doc usage | template = repo link | type = 1 | gh = 1 | gl = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
GitHub
{{repo link/doc usage | template = repo link | type = 1 | gh = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
GitLab
{{repo link/doc usage | template = repo link | type = 1 | gl = 1 | git = 1 | break = 0 }}
{{repo link | type = }}
- type
- Choose between the web interface, a direct repository link, or a zip file download. This can be one of git, git web, zip. See the {{* zip file}} templates for a simplified interface for the zip files. The default is git web.
Related templates
|