Template:Relax svn source
Template documentation
Contents
- 1 Goal
- 2 Usage
- 3 Design
- 4 Plain text
- 5 Examples
- 5.1 No parameters
- 5.2 The repository
- 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_SVN_SRC
- 5.12 Full path
- 5.13 SVN checkout
- 5.14 Aliased parameters
- 5.15 Numbered parameters
- 6 Related templates
Goal
This template is for creating links or URLs for the relax svn 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 svn co. | optional | ||
opt | Any additional options to show after cmd, but before the URL.
|
optional | ||
protocol | The URL protocol, for example https, http, ssh, svn. 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 svn, svn web. The default is svn web. | optional | ||
branch | The branch name. As tags are simply branches in SVN repositories, this parameter can also be used for svn tags. This defaults to trunk. | b | optional | |
tag | The repository tag name. | optional | ||
commit | The commit identifier (svn revision number). 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 svn, a login is allowed:
<protocol>://[<login>@]<DOMAIN>/p/<proj>/<repo>/
SourceForge <URL> for 'type=svn'
For this parameter value, the <URL>
value will instead be:
<protocol>://[<login>@]svn.code.sf.net/p/<proj>/<repo>/<branch>[/<path>][@<commit>]
SourceForge <URL> for 'type=svn web'
For this parameter value, the <URL>
value will be:
<protocol>://sourceforge.net/p/<proj>/<repo>/<commit|HEAD>/<VIEW>/<branch>[/<path>][#l<line>]
The <VIEW>
value for different values of view is:
- tree
tree/
.- log
log/?path=
.
If the parameter setting view=commit is used, a truncated <URL> value is produced:
<protocol>://sourceforge.net/p/<proj>/<repo>/<commit|HEAD>/
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=svn' and 'type=svn web'
The link text <TEXT>
, if the full parameter is not set, will be:
<proj>/<repo>/<branch>[/<path>][#l<line>][@r<commit>] <DESC>
If the simplepath parameter is set, this changes to:
[/<path>][#l<line>][@r<commit>] <DESC>
If the pre parameter is supplied, this changes to:
<pre>[/<path>][#l<line>][@r<commit>] <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
{{relax svn source}}
The repository
{{relax svn source | text = The relax svn source repository }}
The relax svn source repository
File
{{relax svn source | path = pipe_control/diffusion_tensor.py }}
nmr-relax/code-svn-archive/trunk/pipe_control/diffusion_tensor.py
File and a branch
{{relax svn source | path = maths_fns/chi2.py | branch = branches/cst }}
nmr-relax/code-svn-archive/branches/cst/maths_fns/chi2.py
File and a tag
{{relax svn source | path = pipe_control/diffusion_tensor.py | tag = tags/4.0.3 }}
nmr-relax/code-svn-archive/tags/4.0.3/pipe_control/diffusion_tensor.py
File and a commit
{{relax svn source | path = data_store/exp_info.py | commit = 20143 }}
nmr-relax/code-svn-archive/trunk/data_store/exp_info.py@r20143
Commit
{{relax svn source | commit = 28287 | view = commit }}
nmr-relax/code-svn-archive@r28287 commit view
File and line number
{{relax svn source | path = gui/spin_viewer/tree.py | line = 68 }}
nmr-relax/code-svn-archive/trunk/gui/spin_viewer/tree.py#l68
File, line number, and commit
{{relax svn source | path = gui/spin_viewer/tree.py | commit = 17225 | line = 546 }}
nmr-relax/code-svn-archive/trunk/gui/spin_viewer/tree.py#l546@r17225
Custom label given
{{relax svn source | path = gui/spin_viewer/tree.py | text = The spin viewer window tree element }}
The spin viewer window tree element
Prefix of $RELAX_SVN_SRC
{{relax svn source | path = gui/spin_viewer/tree.py | pre = $RELAX_SVN_SRC }}
$RELAX_SVN_SRC/gui/spin_viewer/tree.py
Full path
{{relax svn source | path = gui/spin_viewer/tree.py | commit = 17225 | line = 546 | full = 1 }}
https://sourceforge.net/p/nmr-relax/code-svn-archive/17225/tree/trunk/gui/spin_viewer/tree.py#l546
SVN checkout
This is for svn co svn://svn.code.sf.net/p/nmr-relax/code-svn-archive/trunk
.
{{#tag:code|{{#tag:nowiki|{{relax svn source | cmd = svn co | protocol = svn | type = svn | post = relax-svn-trunk | full = 1 }}}}}}.
svn co svn://svn.code.sf.net/p/nmr-relax/code-svn-archive/trunk relax-svn-trunk
.
Aliased parameters
This is for https://sourceforge.net/p/nmr-relax/code-svn-archive/9407/tree/branches/j_couplings/generic_fns/align_tensor.py.
{{relax svn source | f = generic_fns/align_tensor.py | b = branches/j_couplings | c = 9407 | full = 1 }}
Numbered parameters
This is for https://sourceforge.net/p/nmr-relax/code-svn-archive/9407/tree/branches/j_couplings/generic_fns/align_tensor.py.
{{relax svn source | generic_fns/align_tensor.py | b = branches/j_couplings | c = 9407 | full = 1 }}
Related templates
|