Template:Repo link/doc design gitorious: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Switch from === to <h3> for the first heading. This is needed as the Mediawiki requirement of the heading starting on a new line may not be satisfied.)
(Documentation of the merge request URL construction.)
 
(One intermediate revision by the same user not shown)
Line 23: Line 23:


If the '''view''' parameter is set to one of '''blob''', '''raw''', or '''tree''', the <code><URL></code> fragment for the commit, branch or tag is constructed as:
If the '''view''' parameter is set to one of '''blob''', '''raw''', or '''tree''', the <code><URL></code> fragment for the commit, branch or tag is constructed as:
  <nowiki><protocol>://gitorious.org/<proj>/<repo>[?hb=<commit>|refs/heads/<branch>]</nowiki>
  <nowiki><protocol>://gitorious.org/<proj>/<repo>[?hb=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]</nowiki>


Otherwise it will be:
Otherwise it will be:
  <nowiki><protocol>://gitorious.org/<proj>/<repo>[?h=<commit>|refs/heads/<branch>]</nowiki>
  <nowiki><protocol>://gitorious.org/<proj>/<repo>[?h=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]</nowiki>


In summary, the full web URL will be:
In summary, the full web URL will be:
  <nowiki><protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git;a=<VIEW>[;f=<path>][;<h|hb>=<commit>|refs/heads/<branch>][#l<line>]</nowiki>
  <nowiki><protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git;a=<VIEW>[;f=<path>][;<h|hb>=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>][#l<line>]</nowiki>


==== Gitorious URL <TEXT> ====
==== Gitorious URL <TEXT> ====
Line 42: Line 42:


The '''text''' parameter trumps all, and <code><TEXT></code> is simply:
The '''text''' parameter trumps all, and <code><TEXT></code> is simply:
  <nowiki><text></nowiki>
  <pre><nowiki><text></nowiki></pre>
<noinclude>
<noinclude>



Latest revision as of 18:12, 8 March 2016

Site: Gitorious

The Gitorious URLs are predominantly query rather than path based. And only the https:// protocol is supported. The base URL constructed by this template is:

<protocol>://gitorious.org/<proj>/<repo>

Gitorious <URL> for 'type=git'

For this parameter value, the complete <URL> value will be:

<protocol>://gitorious.org/<proj>/<repo>.git

Gitorious <URL> for 'type=git web'

As the current archival system is based on queries — the text after the ? character — absolutely any random path after the gitorious.org/ domain name can be used. But, for aesthetics, the project and repository name will be appended by this template. The <URL> will be:

<protocol>://gitorious.org/<proj>/<repo>?<QUERY>[#l<line>]

The <QUERY> string consists of parts for the project and repository (p=), the type of view (a=), the path (f=), and the commit, branch or tag (h= or hb=, depending on the view). The <URL> fragment for the project and repository is constructed as:

<protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git

The <URL> fragment for the view is constructed as:

<protocol>://gitorious.org/<proj>/<repo>?a=<VIEW>

Where <VIEW> is the value of the view parameter, if supplied, with the value of raw translated to blob_plain. If not supplied, the value of blob is used if path is given, commit if commit is given, or summary otherwise. The <URL> fragment for the path is constructed as:

<protocol>://gitorious.org/<proj>/<repo>?f=<path>

If the view parameter is set to one of blob, raw, or tree, the <URL> fragment for the commit, branch or tag is constructed as:

<protocol>://gitorious.org/<proj>/<repo>[?hb=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]

Otherwise it will be:

<protocol>://gitorious.org/<proj>/<repo>[?h=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>]

In summary, the full web URL will be:

<protocol>://gitorious.org/<proj>/<repo>?p=<proj>:<repo>.git;a=<VIEW>[;f=<path>][;<h|hb>=refs/merge-requests/<mr>|<commit>|refs/heads/<branch>][#l<line>]

Gitorious URL <TEXT>

The link text <TEXT>, if the full parameter is not set, will be:

<proj>/<repo>/<commit|branch|HEAD>[/<path>][#l<line>]

If the simplepath parameter is set, this changes to:

[/<path>][#l<line>]

If the pre parameter is supplied, this changes to:

<pre>[/<path>][#l<line>]

The text parameter trumps all, and <TEXT> is simply:

<text>


The following template description is not displayed when the template is inserted in an article.

Goal

To provide documentation of the design of the {{repo link}} family of templates. This is only for use within documentation of the subtemplates.