Template:Repo link/doc usage: Difference between revisions

Jump to navigation Jump to search
Bulk switch to the {{param}} template for all of the parameter and parameter value formatting.
(Introduced the 'value_cmd' parameter. This is currently used for the 'opt' parameter description.)
(Bulk switch to the {{param}} template for all of the parameter and parameter value formatting.)
Line 237: Line 237:
  {{!}} {{param|site}}
  {{!}} {{param|site}}
  {{!}} Points the template to a repository host:
  {{!}} Points the template to a repository host:
:* For [[SourceForge]] use either '''s''', '''sf''' or '''sourceforge'''.
:* For [[SourceForge]] use either {{param||s}}, {{param||sf}} or {{param||sourceforge}}.
:* For [[GitHub]] use either '''gh''', '''gith''' or '''github'''.
:* For [[GitHub]] use either {{param||gh}}, {{param||gith}} or {{param||github}}.
:* For [[GitLab]] use either '''gl''', '''gitl''' or '''gitlab'''.
:* For [[GitLab]] use either {{param||gl}}, {{param||gitl}} or {{param||gitlab}}.
:* For the [[Gitorious]] archive use either '''g''', '''gito''' or '''gitorious'''.
:* For the [[Gitorious]] archive use either {{param||g}}, {{param||gito}} or {{param||gitorious}}.
:* For generic repositories, the '''site''' parameter will be interpreted as the domain name.
:* For generic repositories, the {{param|site}} parameter will be interpreted as the domain name.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_site|}}} | {{param|{{{short_site}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_site|}}} | {{param|{{{short_site}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_site|}}} | {{param|{{{pos_site}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_site|}}} | {{param|{{{pos_site}}}}}}}
Line 249: Line 249:
  <tr>
  <tr>
  {{!}} {{param|cmd}}
  {{!}} {{param|cmd}}
  {{!}} An optional command line tool name + options to prepend to the URL.  For example '''{{{eg_cmd|git clone}}}'''.
  {{!}} An optional command line tool name + options to prepend to the URL.  For example {{param||{{{eg_cmd|git clone}}}}}.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_cmd|}}} | {{param|{{{short_cmd}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_cmd|}}} | {{param|{{{short_cmd}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_cmd|}}} | {{param|{{{pos_cmd}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_cmd|}}} | {{param|{{{pos_cmd}}}}}}}
Line 258: Line 258:
  {{!}} {{param|opt}}
  {{!}} {{param|opt}}
  {{!}} Any additional options to show after {{#if: {{{value_cmd|}}} | the command {{#tag:code|{{{value_cmd}}}}} | {{param|cmd}}}}, but before the URL.{{#ifeq: {{{cmd|}}} | 1 |
  {{!}} Any additional options to show after {{#if: {{{value_cmd|}}} | the command {{#tag:code|{{{value_cmd}}}}} | {{param|cmd}}}}, but before the URL.{{#ifeq: {{{cmd|}}} | 1 |
: {{inote|Developer note: This is for future non-CLI handling of a standardised set of '''cmd''' parameter values}}
: {{inote|Developer note: This is for future non-CLI handling of a standardised set of {{param|cmd}} parameter values}}
}}
}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_opt|}}} | {{param|{{{short_opt}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_opt|}}} | {{param|{{{short_opt}}}}}}}
Line 267: Line 267:
  <tr>
  <tr>
  {{!}} {{param|protocol}}
  {{!}} {{param|protocol}}
  {{!}} The URL protocol, for example '''https''', '''http''', '''ssh'''{{#if:{{{git|}}}|, '''git'''}}{{#if:{{{svn|}}}|, '''svn'''}}.  This defaults to '''{{{default_protocol|https}}}'''.
  {{!}} The URL protocol, for example {{param||https}}, {{param||http}}, {{param||ssh}}{{#if:{{{git|}}}|, {{param||git}}}}{{#if:{{{svn|}}}|, {{param||svn}}}}.  This defaults to {{param||{{{default_protocol|https}}}}}.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_protocol|}}} | {{param|{{{short_protocol}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_protocol|}}} | {{param|{{{short_protocol}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_protocol|}}} | {{param|{{{pos_protocol}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_protocol|}}} | {{param|{{{pos_protocol}}}}}}}
Line 275: Line 275:
  <tr>
  <tr>
  {{!}} {{param|login}}
  {{!}} {{param|login}}
  {{!}} The optional user login. {{#ifeq:{{{user|}}}|1|This should not to be confused with the '''user''' parameter.}}
  {{!}} The optional user login. {{#ifeq:{{{user|}}}|1|This should not to be confused with the {{param|user}} parameter.}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_login|}}} | {{param|{{{short_login}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_login|}}} | {{param|{{{short_login}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_login|}}} | {{param|{{{pos_login}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_login|}}} | {{param|{{{pos_login}}}}}}}
Line 289: Line 289:
     -->This can be one of<!--
     -->This can be one of<!--
     -->{{#ifeq: {{{git|}}} | 1
     -->{{#ifeq: {{{git|}}} | 1
         |<nowiki></nowiki> '''git''', '''git web'''<!--
         |<nowiki></nowiki> {{param||git}}, {{param||git web}}<!--
       -->{{#ifeq: {{{svn|{{{gh|{{{gl|}}}}}}}}} | 1 |, <nowiki></nowiki>}}
       -->{{#ifeq: {{{svn|{{{gh|{{{gl|}}}}}}}}} | 1 |, <nowiki></nowiki>}}
       }}<!--
       }}<!--
     -->{{#ifeq: {{{svn|}}} | 1
     -->{{#ifeq: {{{svn|}}} | 1
         |<nowiki></nowiki> '''svn''', '''svn web'''<!--
         |<nowiki></nowiki> {{param||svn}}, {{param||svn web}}<!--
       -->{{#ifeq: {{{gh|{{{gl|}}}}}} | 1 |, <nowiki></nowiki>}}
       -->{{#ifeq: {{{gh|{{{gl|}}}}}} | 1 |, <nowiki></nowiki>}}
       }}<!--
       }}<!--
     -->{{#ifeq: {{{gh|{{{gl|}}}}}} | 1 |<nowiki></nowiki>'''zip'''<!--
     -->{{#ifeq: {{{gh|{{{gl|}}}}}} | 1 |<nowiki></nowiki>{{param||zip}}<!--
       -->. See the [[#Download templates|<nowiki>{{* zip file}}</nowiki> templates]] for a simplified interface for the zip files
       -->. See the [[#Download templates|<nowiki>{{* zip file}}</nowiki> templates]] for a simplified interface for the zip files
       }}. <!--
       }}. <!--
     -->The default is '''{{{default_type|{{#ifeq:{{{git|}}}|1|git web|svn web}}}}}'''.
     -->The default is {{param||{{{default_type|{{#ifeq:{{{git|}}}|1|git web|svn web}}}}}}}.
       {{#ifeq: {{{sf|{{{go|}}}}}} | 1
       {{#ifeq: {{{sf|{{{go|}}}}}} | 1
         | {{#ifeq: {{{gh|{{{gl|}}}}}} | 1
         | {{#ifeq: {{{gh|{{{gl|}}}}}} | 1
Line 315: Line 315:
  <tr>
  <tr>
  {{!}} {{param|user}}
  {{!}} {{param|user}}
  {{!}} The name of the user page for the {{#if: {{{site_name|}}} | [[{{{site_name}}}]]}} open source infrastructure.  This is notably different to the '''login''' parameter.  This will have precedence over the '''proj''' parameter.  The user page is treated in the same way as a project name.
  {{!}} The name of the user page for the {{#if: {{{site_name|}}} | [[{{{site_name}}}]]}} open source infrastructure.  This is notably different to the {{param|login}} parameter.  This will have precedence over the {{param|proj}} parameter.  The user page is treated in the same way as a project name.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_user|}}} | {{param|{{{short_user}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_user|}}} | {{param|{{{short_user}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_user|}}} | {{param|{{{pos_user}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_user|}}} | {{param|{{{pos_user}}}}}}}
Line 323: Line 323:
  <tr>
  <tr>
  {{!}} {{param|proj}}
  {{!}} {{param|proj}}
  {{!}} The name of the project, consisting of a grouping of repositories on the {{#if: {{{site_name|}}} | [[{{{site_name}}}]]}} open source infrastructure.  This defaults to '''{{{default_proj|flightgear}}}'''.
  {{!}} The name of the project, consisting of a grouping of repositories on the {{#if: {{{site_name|}}} | [[{{{site_name}}}]]}} open source infrastructure.  This defaults to {{param||{{{default_proj|flightgear}}}}}.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_proj|}}} | {{param|{{{short_proj}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_proj|}}} | {{param|{{{short_proj}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_proj|}}} | {{param|{{{pos_proj}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_proj|}}} | {{param|{{{pos_proj}}}}}}}
Line 331: Line 331:
  <tr>
  <tr>
  {{!}} {{param|repo}}
  {{!}} {{param|repo}}
  {{!}} The name of the repository{{#if: {{{eg_repo|}}}, for example '''eg_repo'''}}.  A project registered on {{#if: {{{site_name|}}} | the [[{{{site_name}}}]] open source infrastructure | one of the open source infrastructures}} generally allows for multiple repositories under that project name.  This defaults to '''{{{default_repo|flightgear}}}'''.
  {{!}} The name of the repository{{#if: {{{eg_repo|}}}, for example {{param||eg_repo}}}}.  A project registered on {{#if: {{{site_name|}}} | the [[{{{site_name}}}]] open source infrastructure | one of the open source infrastructures}} generally allows for multiple repositories under that project name.  This defaults to {{param||{{{default_repo|flightgear}}}}}.
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_repo|}}} | {{param|{{{short_repo}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_repo|}}} | {{param|{{{short_repo}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_repo|}}} | {{param|{{{pos_repo}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_repo|}}} | {{param|{{{pos_repo}}}}}}}
Line 344: Line 344:
     -->{{#if: {{{git|}}}
     -->{{#if: {{{git|}}}
         | {{#if: {{{svn|}}}
         | {{#if: {{{svn|}}}
             | This defaults to '''{{{default_branch_git|next}}}''' or '''{{{default_branch_svn|trunk}}}''' for git and svn respectively. <nowiki></nowiki>
             | This defaults to {{param||{{{default_branch_git|next}}}}} or {{param||{{{default_branch_svn|trunk}}}}} for git and svn respectively. <nowiki></nowiki>
             | This defaults to '''{{{default_branch_git|next}}}'''. <nowiki></nowiki>
             | This defaults to {{param||{{{default_branch_git|next}}}}}. <nowiki></nowiki>
           }}
           }}
         | {{#if: {{{svn|}}}
         | {{#if: {{{svn|}}}
             | This defaults to '''{{{default_branch_svn|trunk}}}'''. <nowiki></nowiki>
             | This defaults to {{param||{{{default_branch_svn|trunk}}}}}. <nowiki></nowiki>
           }}
           }}
       }}
       }}
Line 378: Line 378:
     -->{{#ifeq: {{{git|}}} | 1
     -->{{#ifeq: {{{git|}}} | 1
         | {{#ifeq: {{{svn|}}} | 1
         | {{#ifeq: {{{svn|}}} | 1
             |<nowiki></nowiki> (git hash or svn revision number).  This defaults to '''HEAD'''.
             |<nowiki></nowiki> (git hash or svn revision number).  This defaults to {{param||HEAD}}.
             |<nowiki></nowiki> (git hash).  This defaults to '''HEAD'''.
             |<nowiki></nowiki> (git hash).  This defaults to {{param||HEAD}}.
           }}
           }}
         | {{#ifeq: {{{svn|}}} | 1
         | {{#ifeq: {{{svn|}}} | 1
             |<nowiki></nowiki> (svn revision number).  This defaults to '''HEAD'''.
             |<nowiki></nowiki> (svn revision number).  This defaults to {{param||HEAD}}.
             |.
             |.
           }}
           }}
Line 403: Line 403:
       }}{{#ifeq: {{{gh|}}} | 1 |  
       }}{{#ifeq: {{{gh|}}} | 1 |  
:* For GitHub either use:
:* For GitHub either use:
:** A single line number, for example '''2'''.
:** A single line number, for example {{param||2}}.
:** Two line numbers separated with a hyphen ('''-'''), for example '''3-10'''.
:** Two line numbers separated with a hyphen ({{param||-}}), for example {{param||3-10}}.
       }}
       }}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_line|}}} | {{param|{{{short_line}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_line|}}} | {{param|{{{short_line}}}}}}}
Line 413: Line 413:
  <tr>
  <tr>
  {{!}} {{param|post}}
  {{!}} {{param|post}}
  {{!}} Text to append.  This is forms a set with the parameter {{#ifeq:{{{cmd|}}}|1|{{param|cmd}}{{#ifeq:{{{opt|}}}|1|<nowiki></nowiki> and <nowiki></nowiki>}}}}{{#ifeq:{{{opt|}}}|1|{{param|opt}}}}.  For example it can represent any command line options that come after the URL. {{#if:{{{default_post|}}}|The default value is '''{{{default_post}}}'''.}}
  {{!}} Text to append.  This is forms a set with the parameter {{#ifeq:{{{cmd|}}}|1|{{param|cmd}}{{#ifeq:{{{opt|}}}|1|<nowiki></nowiki> and <nowiki></nowiki>}}}}{{#ifeq:{{{opt|}}}|1|{{param|opt}}}}.  For example it can represent any command line options that come after the URL. {{#if:{{{default_post|}}}|The default value is {{param||{{{default_post}}}}}.}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_post|}}} | {{param|{{{short_post}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_post|}}} | {{param|{{{short_post}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_post|}}} | {{param|{{{pos_post}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_post|}}} | {{param|{{{pos_post}}}}}}}
Line 423: Line 423:
  {{!}} View to display:
  {{!}} View to display:
       {{#ifeq: {{{sf|}}} | 1 |
       {{#ifeq: {{{sf|}}} | 1 |
:* For SourceForge use one of '''tree''', '''log''', '''commit''', or '''rss'''.  The default is '''tree'''.
:* For SourceForge use one of {{param||tree}}, {{param||log}}, {{param||commit}}, or {{param||rss}}.  The default is {{param||tree}}.
       }}{{#ifeq: {{{gh|}}} | 1 |  
       }}{{#ifeq: {{{gh|}}} | 1 |  
:* For GitHub use one of '''blob''', '''blame''', '''commit''', '''commits''' or '''raw'''.  The default is '''tree'''.
:* For GitHub use one of {{param||blob}}, {{param||blame}}, {{param||commit}}, {{param||commits}} or {{param||raw}}.  The default is {{param||tree}}.
       }}{{#ifeq: {{{gl|}}} | 1 |  
       }}{{#ifeq: {{{gl|}}} | 1 |  
:* The GitLab interface for '''type=git web''' is not yet implemented in the master {{tl|repo link}} template, so the '''view''' parameter currently does nothing.
:* The GitLab interface for {{param|type|git web}} is not yet implemented in the master {{tl|repo link}} template, so the {{param|view}} parameter currently does nothing.
       }}{{#ifeq: {{{go|}}} | 1 |  
       }}{{#ifeq: {{{go|}}} | 1 |  
:* 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.
:* For the Gitorious archive use one of {{param||summary}}, {{param||shortlog}}, {{param||log}}, {{param||blob}}, {{param||commit}}, {{param||commitdiff}}, {{param||tree}}, {{param||history}}, or {{param||raw}}.  The default is {{param||blob}} if a path is given, {{param||commit}} if a commit is given, or {{param||summary}} otherwise.
       }}
       }}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_view|}}} | {{param|{{{short_view}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_view|}}} | {{param|{{{short_view}}}}}}}
Line 438: Line 438:
  <tr>
  <tr>
  {{!}} {{param|text}}
  {{!}} {{param|text}}
  {{!}} Text to display as the link label. {{#if: {{{pre|}}} | Overrides '''pre'''.}}
  {{!}} Text to display as the link label. {{#if: {{{pre|}}} | Overrides {{param|pre}}.}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_text|}}} | {{param|{{{short_text}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_text|}}} | {{param|{{{short_text}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_text|}}} | {{param|{{{pos_text}}}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{pos_text|}}} | {{param|{{{pos_text}}}}}}}
Line 454: Line 454:
  <tr>
  <tr>
  {{!}} {{param|simplepath}}
  {{!}} {{param|simplepath}}
  {{!}} If set, this strips off the repository name from the URL label, leaving just the contents of the '''path''' parameter.
  {{!}} If set, this strips off the repository name from the URL label, leaving just the contents of the {{param|path}} parameter.
: {{inote|The ''text'' parameter will override this.}}
: {{inote|The ''text'' parameter will override this.}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_simplepath|}}} | {{{short_simplepath|}}}}}
  {{!}} style="text-align: center" {{!}} {{#if: {{{short_simplepath|}}} | {{{short_simplepath|}}}}}
Line 516: Line 516:
; site_name:  The optional name for the open source infrastructure, for use in some of the parameter descriptions.
; site_name:  The optional name for the open source infrastructure, for use in some of the parameter descriptions.


; type_*:  The parameter type.  This defaults to '''name''' to define this as a named parameter.  For an anonymous or numbered parameter, set this to '''num'''.
; type_*:  The parameter type.  This defaults to {{param||name}} to define this as a named parameter.  For an anonymous or numbered parameter, set this to {{param||num}}.


; short_*:  The optional abbreviated parameter name used as an alias for the full parameter name.
; short_*:  The optional abbreviated parameter name used as an alias for the full parameter name.
Line 522: Line 522:
; pos_*:  The parameter position for anonymous or numbered parameters.
; pos_*:  The parameter position for anonymous or numbered parameters.


; stat_*:  The parameter status, for example '''mandatory'''.  This defaults to '''optional'''.
; stat_*:  The parameter status, for example {{param||mandatory}}.  This defaults to {{param||optional}}.


; eg_*:  An example for the parameter.
; eg_*:  An example for the parameter.
Line 532: Line 532:
; intro:  Introductory text before the parameter table.  This defaults to ''The parameters are:''.
; intro:  Introductory text before the parameter table.  This defaults to ''The parameters are:''.


; break:  If set to '''1''', an empty line between the URL and text formatting will be added.
; break:  If set to {{param||1}}, an empty line between the URL and text formatting will be added.


== Examples ==
== Examples ==

Navigation menu