Template:Repo link: Difference between revisions

Jump to navigation Jump to search
+ two-letter repo names; +-error message; +templ: obr, cbr; + For now commented GitLab doc
m (Add stub for GitLab)
(+ two-letter repo names; +-error message; +templ: obr, cbr; + For now commented GitLab doc)
Line 1: Line 1:
{{#switch: {{{site|}}}
{{#switch: {{{site|}}}
|gito
| g
|gitorious = [https://{{#if: {{{subdom|}}} | {{{subdom}}}. }}gitorious.org/<!--
| gito
| gitorious = [https://{{#if: {{{subdom|}}} | {{{subdom}}}. }}gitorious.org/<!--
-->{{{proj|fg/fgdata}}}/{{{view|source}}}/{{{brrev|master}}}:{{{path|}}}<!--
-->{{{proj|fg/fgdata}}}/{{{view|source}}}/{{{brrev|master}}}:{{{path|}}}<!--
-->{{#if: {{{lines|}}} |&#35;L{{{lines}}} }}<!--
-->{{#if: {{{lines|}}} |&#35;L{{{lines}}} }}<!--
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|fg/fgdata}}} }}/{{#if: {{{path|}}} | {{{path}}} |{{{brrev|master}}}}} }}]
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|fg/fgdata}}} }}/{{#if: {{{path|}}} | {{{path}}} |{{{brrev|master}}}}} }}]
|gith
| gh
|github = [https://{{#ifeq: {{{view|tree}}} | raw | raw.githubusercontent | github }}.com/<!--
| gith
| github = [https://{{#ifeq: {{{view|tree}}} | raw | raw.githubusercontent | github }}.com/<!--
-->{{{proj|}}}/<!--
-->{{{proj|}}}/<!--
-->{{#ifeq: {{{view|tree}}} | raw | | {{{view|tree}}}/ }}<!--
-->{{#ifeq: {{{view|tree}}} | raw | | {{{view|tree}}}/ }}<!--
Line 12: Line 14:
-->{{#if: {{{lines|}}} | &#35;L{{{lines}}} }}<!--
-->{{#if: {{{lines|}}} | &#35;L{{{lines}}} }}<!--
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|}}} }}/{{#if: {{{path|}}} | {{{path}}} | {{{brrev|master}}}}} }}]
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|}}} }}/{{#if: {{{path|}}} | {{{path}}} | {{{brrev|master}}}}} }}]
|gitl
| gl
|gitlab = [https://about.gitlab.com/ GitLab.com]
| gitl
|sf
| gitlab = [https://about.gitlab.com/ GitLab.com]
|svn
| sf
|sourceforge = [http://sourceforge.net/p/<!--
| svn
| sourceforge = [http://sourceforge.net/p/<!--
-->{{{proj|flightgear/fgaddon}}}/{{{rev|HEAD}}}/tree/{{{branch|trunk}}}/{{{path|Aircraft}}}<!--  
-->{{{proj|flightgear/fgaddon}}}/{{{rev|HEAD}}}/tree/{{{branch|trunk}}}/{{{path|Aircraft}}}<!--  
-->{{#if: {{{lines|}}} | &#35;l{{{lines}}} }}<!--
-->{{#if: {{{lines|}}} | &#35;l{{{lines}}} }}<!--
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|flightgear/fgaddon}}}/{{{branch|{{{rev|HEAD}}}}}}}}/{{#if: {{{path|}}} | {{{path}}} | Aircraft }} }}]
--> {{#if: {{{text|}}} | {{{text}}} | {{#if: {{{pre|}}} | {{{pre}}} | {{{proj|flightgear/fgaddon}}}/{{{branch|{{{rev|HEAD}}}}}}}}/{{#if: {{{path|}}} | {{{path}}} | Aircraft }} }}]
|#default = <big style="color: red">{{tl|Repo link}} does not recognize site name.</big>
| #default = <big style="color: red">{{tl|Repo link}}: Invalid or missing site</big>
}}<noinclude>{{Informative template|1=
}}<noinclude>{{Informative template|1=
__NOTOC__
__NOTOC__
Line 31: Line 34:


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''repo link
  {{obr}}'''repo link
  {{!}} site  =
  {{!}} site  =
  {{!}} ''subdom'' =
  {{!}} ''subdom'' =
Line 45: Line 48:
  {{!}} ''text''  =  
  {{!}} ''text''  =  
  {{!}} ''pre''    =
  {{!}} ''pre''    =
  <nowiki>}}</nowiki>
  {{cbr}}


All parameters except '''site''' are optional.
All parameters except '''site''' are optional.


; site: Points the template to a repository host:
; site: Points the template to a repository host:
:* For [https://gitorious.org/ Gitorious] use either '''gito''' or '''gitorious'''
:* For [https://gitorious.org/ Gitorious] use either '''g''', '''gito''' or '''gitorious'''
:* For [https://github.com/ GitHub] use either '''gith''' or '''github'''
:* For [https://github.com/ GitHub] use either '''gh''', '''gith''' or '''github'''
<!-- :* For [https://about.gitlab.com/ GitLab] use either '''gl''', '''gitl''' or '''gitlab''' -->
:* For [http://sourceforge.net/ SourceForge] use either '''svn''', '''sf''' or '''sourceforge'''
:* For [http://sourceforge.net/ SourceForge] use either '''svn''', '''sf''' or '''sourceforge'''


Line 86: Line 90:
== Examples ==
== Examples ==
=== Gitorious example ===
=== Gitorious example ===
  <nowiki>{{repo link
  {{obr}}repo link
| site  = gito
{{!}} site  = gito
| proj  = fg/hoorays-fgdata
{{!}} proj  = fg/hoorays-fgdata
| view  = source
{{!}} view  = source
| brrev  = topics/scriptable-ai-submodule
{{!}} brrev  = topics/scriptable-ai-submodule
| path  = Nasal/ai/ai.nas
{{!}} path  = Nasal/ai/ai.nas
| lines  = 1-2
{{!}} lines  = 1-2
| text  = Scripted AI Objects repo
{{!}} text  = Scripted AI Objects repo
}}</nowiki>
{{cbr}}


{{repo link
{{repo link
Line 107: Line 111:


=== Subdomain example ===
=== Subdomain example ===
  <nowiki>{{repo link
  {{obr}}repo link
| site  = gito
{{!}} site  = gito
| subdom = qt
{{!}} subdom = qt
| proj  = qt/qt
{{!}} proj  = qt/qt
| view  = source
{{!}} view  = source
| brrev  = 4.7
{{!}} brrev  = 4.7
| path  = examples/README
{{!}} path  = examples/README
| lines  = 1
{{!}} lines  = 1
}}</nowiki>
{{cbr}}


{{repo link
{{repo link
Line 128: Line 132:


=== GitHub example ===
=== GitHub example ===
  <nowiki>{{repo link
  {{obr}}repo link
| site  = gith
{{!}} site  = gith
| proj  = bhugh/Bombable
{{!}} proj  = bhugh/Bombable
| path  = examples/README
{{!}} path  = examples/README
| lines  = 30
{{!}} lines  = 30
| path  = Aircraft/A-10-Bombable/A-10-Bombable-set.xml
{{!}} path  = Aircraft/A-10-Bombable/A-10-Bombable-set.xml
| pre    = $FG_ROOT
{{!}} pre    = $FG_ROOT
}}</nowiki>
{{cbr}}


{{repo link
{{repo link
Line 147: Line 151:


=== SourceForge example ===
=== SourceForge example ===
  <nowiki>{{repo link
  {{obr}}repo link
| site = sf
{{!}} site = sf
| rev = 280
{{!}} rev = 280
| branch = branches/release-3.4.0
{{!}} branch = branches/release-3.4.0
| text = FG 3.4 add-on aircraft
{{!}} text = FG 3.4 add-on aircraft
}}</nowiki>
{{cbr}}


{{repo link
{{repo link

Navigation menu