Template:Repo link/doc infrastructure source: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Improved the documentation.)
(Switch to using {{repo link/doc infrastructure source}} for the documentation.)
Line 5: Line 5:


== Usage ==
== Usage ==
{{obr}}'''{{{site|MISSING}}} source'''
{{repo link/doc usage
{{!}} ''cmd''       =
| template  = {{{site|MISSING}}} source
{{!}} ''opt''       =<!--
| cmd        = 1
--> {{#ifeq: {{{login|}}} |1| <nowiki></nowiki>
| opt        = 1
{{!}} ''login''     =  
| protocol  = {{{protocol|0}}}
}}<!--
| login      = {{{login|0}}}
--> {{#ifeq: {{{protocol|}}} |1| <nowiki></nowiki>
| type      = 1
{{!}} ''protocol''  =
| user       = {{{user|0}}}
}}
| proj      = 1
{{!}} ''type''       =<!--
| repo      = 1
--> {{#ifeq: {{{user|}}} |1| <nowiki></nowiki>
| branch    = 1
{{!}} ''user''      =
| tag        = 1
}}
| path      = 1
{{!}} ''proj''       =
| commit    = 1
{{!}} ''repo''       =
| line      = 1
{{!}} ''branch''     =
| post      = 1
{{!}} ''path''       =
| view      = 1
{{!}} ''commit''     =
| text      = 1
{{!}} ''line''       =
| pre        = 1
{{!}} ''post''       =
| simplepath = 1
| full      = 1
{{!}} ''view''       =
| intro      =
{{!}} ''text''       =
{{!}} ''pre''       =
{{!}} ''simplepath'' =
{{!}} ''full''       =
{{cbr}}
 
{{#ifeq: {{{user|}}} | 1
{{#ifeq: {{{user|}}} | 1
  | Either the '''user''' or '''proj''' parameter
  | Either the '''user''' or '''proj''' parameter
  | The '''proj''' parameter
  | The '''proj''' parameter
}}, as well as the '''repo''' parameter, must be supplied.  All other parameters are optional.
}}, as well as the '''repo''' parameter, must be supplied.  All other parameters are optional.
 
| sf        = {{{sf|0}}}
; cmd: An optional command line tool name + options to prepend to the URL.  For example '''git clone'''.
| gh        = {{{gh|0}}}
 
| gl        = {{{gl|0}}}
; opt: Any additional options to show after '''cmd''', if supplied.
| go        = {{{go|0}}}
: {{inote|Developer note: This is for future non-CLI handling of a standardised set of '''cmd''' parameter values}}
| svn        = {{{svn|0}}}
{{#ifeq: {{{protocol|}}} | 1
| git        = {{{git|0}}}
|
; protocol: The URL protocol, for example '''https''', '''http''', '''git''', '''ssh'''{{#ifeq: {{{svn|}}} |1|, '''svn'''}}.  This defaults to '''https'''.
 
}}{{#ifeq: {{{login|}}} | 1
|
; login: The optional user login.
 
}}
}}
; type: Choose between the web interface or direct repository link.  This can be either '''git''', '''git web''', or '''zip'''.  For zip files however, please see the [[#Download templates|<nowiki>{{* zip file}}</nowiki> templates]].  The default is '''{{{default_type|git web}}}'''.
{{#ifeq: {{{user|}}} | 1
|
; user: The {{{label|MISSING}}} user name.  This will 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 {{{label|MISSING}}} open source infrastructure.
; 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.
; branch: The git branch or tag name.  For git tags, simply append <code>/~</code> to the tag name.  This defaults to '''{{{default_branch|master}}}'''.
; path: The file path.
; commit: The commit identifier (git hash).
; line: Line number of the file to display.
; view:  {{{desc_view|View to display.}}}
; text: Text to display as the link label.  Overrides '''pre'''.
; pre: Prefix to a link label.
; post: Text to append.
; simplepath:  If set, this strips off the repository name from the URL label, leaving just the contents of the '''path''' parameter.
: {{inote|The ''text'' parameter will override this.}}
; full: If set, the full URL will be shown.


== Examples ==
== Examples ==

Revision as of 13:52, 3 March 2016

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

Goal

This template is for creating links or URLs for the content of the version control repositories of the MISSING open source infrastructure. It is a subtemplate of the master {{repo link}} template designed to be specific for the MISSING repositories.

Usage

Usage

{{MISSING source
| cmd        =
| opt        =
| type       =
| proj       =
| repo       =
| branch     =
| tag        =
| commit     =
| path       =
| line       =
| post       =

| view       =
| text       =
| pre        =
| simplepath =
| full       =
}}

The proj parameter, as well as the repo parameter, must be supplied. All other 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.
Note The separation of cmd and opt is for future non-CLI handling of a standardised set of cmd parameter values
optional
type Choose between the web interface or a direct repository link. This can be one of. The default is svn web. optional
proj The name of the project, consisting of a grouping of repositories on the open source infrastructure. optional
repo The name of the repository. A project registered on one of the open source infrastructures generally allows for multiple repositories under that project name. optional
branch The branch name. optional
tag The repository tag name. optional
commit The commit identifier. optional
path The file or directory path. optional
line The line number(s) of the file to display. 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: optional
text Text to display as the link label. Overrides pre. 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.
Note The text parameter will override this.
optional
full If set to 1, the full URL will be shown rather than any text label. optional

Examples

Related templates