Difference between revisions of "Template:Relax source"
(Switch to the {{project infrastructure/proj}} and {{project infrastructure/repo}} templates.) |
m (Renamed the 'repo' parameter to 'name' to match the {{repo link/doc git source}} change) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 23: | Line 23: | ||
{{repo link/doc git source | {{repo link/doc git source | ||
| label = relax | | label = relax | ||
− | | | + | | name = relax |
| examples = | | examples = | ||
=== No parameters === | === No parameters === | ||
− | {{obr}}relax source{{cbr}} | + | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/. |
− | {{relax source}} | + | |
+ | {{obr}}relax source{{cbr}}. | ||
+ | |||
+ | {{relax source}}. | ||
+ | |||
+ | === Text link === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/. | ||
− | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} text = The relax source repository | {{!}} text = The relax source repository | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| text = The relax source repository | | text = The relax source repository | ||
− | }} | + | }}. |
=== File === | === File === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/pipe_control/diffusion_tensor.py. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = pipe_control/diffusion_tensor.py | {{!}} path = pipe_control/diffusion_tensor.py | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = pipe_control/diffusion_tensor.py | | path = pipe_control/diffusion_tensor.py | ||
− | }} | + | }}. |
=== File and a branch === | === File and a branch === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py. | ||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = generic_fns/align_tensor.py | {{!}} path = generic_fns/align_tensor.py | ||
{{!}} branch = j_couplings | {{!}} branch = j_couplings | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = generic_fns/align_tensor.py | | path = generic_fns/align_tensor.py | ||
| branch = j_couplings | | branch = j_couplings | ||
− | }} | + | }}. |
=== File and a tag === | === File and a tag === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/4.0.3/tree/pipe_control/diffusion_tensor.py. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = pipe_control/diffusion_tensor.py | {{!}} path = pipe_control/diffusion_tensor.py | ||
{{!}} tag = 4.0.3 | {{!}} tag = 4.0.3 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = pipe_control/diffusion_tensor.py | | path = pipe_control/diffusion_tensor.py | ||
| tag = 4.0.3 | | tag = 4.0.3 | ||
− | }} | + | }}. |
=== File and a commit === | === File and a commit === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/bb91d6/tree/data_store/exp_info.py. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = data_store/exp_info.py | {{!}} path = data_store/exp_info.py | ||
{{!}} commit = bb91d6 | {{!}} commit = bb91d6 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = data_store/exp_info.py | | path = data_store/exp_info.py | ||
| commit = bb91d6 | | commit = bb91d6 | ||
− | }} | + | }}. |
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = data_store/exp_info.py | {{!}} path = data_store/exp_info.py | ||
{{!}} commit = bb91d693f4102f81735e2a965cc1eed610211753 | {{!}} commit = bb91d693f4102f81735e2a965cc1eed610211753 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = data_store/exp_info.py | | path = data_store/exp_info.py | ||
| commit = bb91d693f4102f81735e2a965cc1eed610211753 | | commit = bb91d693f4102f81735e2a965cc1eed610211753 | ||
− | }} | + | }}. |
=== Commit === | === Commit === | ||
+ | {{note|For a simpler interface for this specific example, see {{tl|relax commit}}.}} | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/6105c8/. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} commit = 6105c8 | {{!}} commit = 6105c8 | ||
{{!}} view = commit | {{!}} view = commit | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| commit = 6105c8 | | commit = 6105c8 | ||
| view = commit | | view = commit | ||
− | }} | + | }}. |
=== File and line number === | === File and line number === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py#l68. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = gui/spin_viewer/tree.py | {{!}} path = gui/spin_viewer/tree.py | ||
{{!}} line = 68 | {{!}} line = 68 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = gui/spin_viewer/tree.py | | path = gui/spin_viewer/tree.py | ||
| line = 68 | | line = 68 | ||
− | }} | + | }}. |
=== File, line number, and commit === | === File, line number, and commit === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/21462188d194d28ee6bd0523ebcc13a00a73c4ba/tree/gui/spin_viewer/tree.py#l546. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = gui/spin_viewer/tree.py | {{!}} path = gui/spin_viewer/tree.py | ||
{{!}} commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | {{!}} commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | ||
{{!}} line = 546 | {{!}} line = 546 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
Line 124: | Line 143: | ||
| commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | | commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | ||
| line = 546 | | line = 546 | ||
− | }} | + | }}. |
=== Custom label given === | === Custom label given === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = gui/spin_viewer/tree.py | {{!}} path = gui/spin_viewer/tree.py | ||
{{!}} text = The spin viewer window tree element | {{!}} text = The spin viewer window tree element | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = gui/spin_viewer/tree.py | | path = gui/spin_viewer/tree.py | ||
| text = The spin viewer window tree element | | text = The spin viewer window tree element | ||
− | }} | + | }}. |
=== Prefix of $RELAX_SRC === | === Prefix of $RELAX_SRC === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = gui/spin_viewer/tree.py | {{!}} path = gui/spin_viewer/tree.py | ||
{{!}} pre = $RELAX_SRC | {{!}} pre = $RELAX_SRC | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| path = gui/spin_viewer/tree.py | | path = gui/spin_viewer/tree.py | ||
| pre = $RELAX_SRC | | pre = $RELAX_SRC | ||
− | }} | + | }}. |
=== Full path === | === Full path === | ||
+ | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/21462188d194d28ee6bd0523ebcc13a00a73c4ba/tree/gui/spin_viewer/tree.py#l546. | ||
+ | |||
{{obr}}relax source | {{obr}}relax source | ||
{{!}} path = gui/spin_viewer/tree.py | {{!}} path = gui/spin_viewer/tree.py | ||
Line 154: | Line 179: | ||
{{!}} line = 546 | {{!}} line = 546 | ||
{{!}} full = 1 | {{!}} full = 1 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
Line 161: | Line 186: | ||
| line = 546 | | line = 546 | ||
| full = 1 | | full = 1 | ||
− | }} | + | }}. |
=== Git clone === | === Git clone === | ||
− | This is for <code><nowiki>git clone git://git.code.sf.net/p/relax/ | + | {{note|For a simpler interface for this specific example, see {{tl|relax clone}}.}} |
+ | This is for <code><nowiki>git clone git://git.code.sf.net/p/nmr-relax/code</nowiki></code>. | ||
{{obr}}#tag:code{{!}}{{obr}}#tag:nowiki{{!}}{{obr}}relax source | {{obr}}#tag:code{{!}}{{obr}}#tag:nowiki{{!}}{{obr}}relax source | ||
Line 181: | Line 207: | ||
=== Aliased parameters === | === Aliased parameters === | ||
− | This is | + | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py#l227. |
{{obr}}relax source | {{obr}}relax source | ||
{{!}} f = generic_fns/align_tensor.py | {{!}} f = generic_fns/align_tensor.py | ||
{{!}} b = j_couplings | {{!}} b = j_couplings | ||
+ | {{!}} l = 227 | ||
{{!}} full = 1 | {{!}} full = 1 | ||
− | {{cbr}} | + | {{cbr}}. |
{{relax source | {{relax source | ||
| f = generic_fns/align_tensor.py | | f = generic_fns/align_tensor.py | ||
| b = j_couplings | | b = j_couplings | ||
+ | | l = 227 | ||
| full = 1 | | full = 1 | ||
− | }} | + | }}. |
=== Numbered parameters === | === Numbered parameters === | ||
− | This is | + | This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py. |
− | {{obr}}relax source {{!}} generic_fns/align_tensor.py {{!}} b = j_couplings {{!}} full = 1 {{cbr}} | + | {{obr}}relax source {{!}} generic_fns/align_tensor.py {{!}} b = j_couplings {{!}} full = 1 {{cbr}}. |
− | {{relax source | generic_fns/align_tensor.py | b = j_couplings | full = 1 }} | + | {{relax source | generic_fns/align_tensor.py | b = j_couplings | full = 1 }}. |
}}</noinclude> | }}</noinclude> |
Latest revision as of 08:07, 27 October 2017
Template documentation
Contents
- 1 Goal
- 2 Usage
- 3 Design
- 4 Plain text
- 5 Examples
- 5.1 No parameters
- 5.2 Text link
- 5.3 File
- 5.4 File and a branch
- 5.5 File and a tag
- 5.6 File and a commit
- 5.7 Commit
- 5.8 File and line number
- 5.9 File, line number, and commit
- 5.10 Custom label given
- 5.11 Prefix of $RELAX_SRC
- 5.12 Full path
- 5.13 Git clone
- 5.14 Aliased parameters
- 5.15 Numbered parameters
- 6 Related templates
Goal
This template is for creating links or URLs for the relax git version control repository. It is a subtemplate of the master {{repo link}} template designed to be specific for the relax repository.
Usage
{{relax source | cmd = | opt = | protocol = | login = | type = | branch = | tag = | commit = | path = | line = | post = | view = | text = | pre = | simplepath = | full = }}
All parameters are optional.
Parameter | Description | Abbreviated parameter |
Numbered parameter |
Status |
---|---|---|---|---|
cmd | An optional command line tool name + options to prepend to the URL. For example git clone. | optional | ||
opt | Any additional options to show after cmd, but before the URL.
|
optional | ||
protocol | The URL protocol, for example https, http, ssh, git. This defaults to https. | optional | ||
login | The optional user login. | optional | ||
type | Choose between the web interface or a direct repository link. This can be one of git, git web. The default is git web. | optional | ||
branch | The branch name. This defaults to next. For SourceForge git repositories, if the character / is present in the branch name, the text /~ must be appended to the branch.
|
b | optional | |
tag | The repository tag name. For SourceForge git repositories, if the character / is present in the tag name, the text /~ must be appended to the tag.
|
optional | ||
commit | The commit identifier (git hash). This defaults to HEAD. | c | optional | |
path | The file or directory path. | f | 1 | optional |
line | The line number(s) of the file to display.
|
l | optional | |
post | Text to append. This is forms a set with the parameter cmd and opt. For example it can represent any command line options that come after the URL. | optional | ||
view | View to display:
|
v | optional | |
text | Text to display as the link label. Overrides pre. | t | optional | |
pre | Prefix to a link label. | optional | ||
simplepath | If set, this strips off the repository name from the URL label, leaving just the contents of the path parameter.
|
optional | ||
full | If set to 1, the full URL will be shown rather than any text label. | optional |
Design
In this section, the following notation will be used:
- Angular brackets + lower case text
<xyz>
- Template parameters.
- Angular brackets + upper case text
<XYZ>
- Template constructed text.
- Square brackets
[xyz]
- Optional text, only added if the parameter is set.
- Or symbol
|
- The value on the left, if present, otherwise the value on the right of the symbol.
Overview
The general design is:
<cmd> <opt> [<URL> <TEXT>] <post>
Here the square brackets do not denote optional text, but will instead produce a Mediawiki link. This can be modified by setting full = 1 to produce:
<cmd> <opt> <URL> <post>
Site: SourceForge
Project page
For a normal SourceForge project page, the base URL is respectively constructed as:
<protocol>://<DOMAIN>/p/<proj>/<repo>/
For the type parameter value of git, a login is allowed:
<protocol>://[<login>@]<DOMAIN>/p/<proj>/<repo>/
SourceForge <URL> for 'type=git'
For this parameter value, the complete <URL>
value will be:
<protocol>://[<login>@]git.code.sf.net/p/<proj>/<repo>/
SourceForge <URL> for 'type=git web'
For this parameter value, the <URL>
value will be:
<protocol>://sourceforge.net/p/<proj>/<repo>/ci/<commit|branch>/<VIEW>/<path>[#l<line>]
The <VIEW>
value for different values of view is:
- tree
tree/
.- log
log/?path=
.- commit
- nothing.
If the parameter setting view=rss is used, a different <URL>
value is produced:
<protocol>://sourceforge.net/p/<proj>/<repo>/feed/
SourceForge URL <TEXT> for 'type=git' and 'type=git web'
The link text <TEXT>
, if the full parameter is not set, will be:
<proj>/<repo>/<commit|branch>[/<path>][#l<line>] <DESC>
If the simplepath parameter is set, this changes to:
[/<path>][#l<line>] <DESC>
If the pre parameter is supplied, this changes to:
<pre>[/<path>][#l<line>] <DESC>
The RSS feed is a special case in that <TEXT>
will be one of:
<proj>/<repo> <DESC>
<pre> <DESC>
The description <DESC>
is dependent on the view parameter:
- tree
- Nothing.
- log
log view
.- commit
commit view
.- rss
RSS feed
.
The text parameter trumps all, and <TEXT>
is simply:
<text>
Plain text
To create a URL or link as plain text and avoid external links, simply use the {{#tag:tagname|content}}
magic word construct:
{{#tag:nowiki| {{repo link | full = 1 }} }}
https://sourceforge.net/p/nmr-relax/code/ci/master/tree/
To use the <code> tags:
{{#tag:code|{{#tag:nowiki| {{repo link | full = 1 }} }}}}
https://sourceforge.net/p/nmr-relax/code/ci/master/tree/
Examples
No parameters
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/.
{{relax source}}.
Text link
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/.
{{relax source | text = The relax source repository }}.
File
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/pipe_control/diffusion_tensor.py.
{{relax source | path = pipe_control/diffusion_tensor.py }}.
nmr-relax/code/master/pipe_control/diffusion_tensor.py.
File and a branch
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py.
{{relax source | path = generic_fns/align_tensor.py | branch = j_couplings }}.
nmr-relax/code/j_couplings/generic_fns/align_tensor.py.
File and a tag
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/4.0.3/tree/pipe_control/diffusion_tensor.py.
{{relax source | path = pipe_control/diffusion_tensor.py | tag = 4.0.3 }}.
nmr-relax/code/4.0.3/pipe_control/diffusion_tensor.py.
File and a commit
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/bb91d6/tree/data_store/exp_info.py.
{{relax source | path = data_store/exp_info.py | commit = bb91d6 }}.
nmr-relax/code/bb91d6/data_store/exp_info.py.
{{relax source | path = data_store/exp_info.py | commit = bb91d693f4102f81735e2a965cc1eed610211753 }}.
nmr-relax/code/bb91d693f4102f81735e2a965cc1eed610211753/data_store/exp_info.py.
Commit
Note For a simpler interface for this specific example, see {{relax commit}}. |
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/6105c8/.
{{relax source | commit = 6105c8 | view = commit }}.
nmr-relax/code/6105c8 commit view.
File and line number
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py#l68.
{{relax source | path = gui/spin_viewer/tree.py | line = 68 }}.
nmr-relax/code/master/gui/spin_viewer/tree.py#l68.
File, line number, and commit
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/21462188d194d28ee6bd0523ebcc13a00a73c4ba/tree/gui/spin_viewer/tree.py#l546.
{{relax source | path = gui/spin_viewer/tree.py | commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | line = 546 }}.
nmr-relax/code/21462188d194d28ee6bd0523ebcc13a00a73c4ba/gui/spin_viewer/tree.py#l546.
Custom label given
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py.
{{relax source | path = gui/spin_viewer/tree.py | text = The spin viewer window tree element }}.
The spin viewer window tree element.
Prefix of $RELAX_SRC
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/master/tree/gui/spin_viewer/tree.py.
{{relax source | path = gui/spin_viewer/tree.py | pre = $RELAX_SRC }}.
$RELAX_SRC/gui/spin_viewer/tree.py.
Full path
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/21462188d194d28ee6bd0523ebcc13a00a73c4ba/tree/gui/spin_viewer/tree.py#l546.
{{relax source | path = gui/spin_viewer/tree.py | commit = 21462188d194d28ee6bd0523ebcc13a00a73c4ba | line = 546 | full = 1 }}.
Git clone
Note For a simpler interface for this specific example, see {{relax clone}}. |
This is for git clone git://git.code.sf.net/p/nmr-relax/code
.
{{#tag:code|{{#tag:nowiki|{{relax source | cmd = git clone | protocol = git | type = git | full = 1 }}}}}}.
git clone git://git.code.sf.net/p/nmr-relax/code/
.
Aliased parameters
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py#l227.
{{relax source | f = generic_fns/align_tensor.py | b = j_couplings | l = 227 | full = 1 }}.
https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py#l227.
Numbered parameters
This is a link to https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py.
{{relax source | generic_fns/align_tensor.py | b = j_couplings | full = 1 }}.
https://sourceforge.net/p/nmr-relax/code/ci/j_couplings/tree/generic_fns/align_tensor.py.
Related templates
|