User:Johan G/project infrastructure: Difference between revisions
Jump to navigation
Jump to search
(+ Examples) |
(Extending) |
||
Line 6: | Line 6: | ||
| url = http://build.flightgear.org:8080/{{{urn|}}} | | url = http://build.flightgear.org:8080/{{{urn|}}} | ||
| link = [http://build.flightgear.org:8080/{{{urn|}}} {{{label|FlightGear build server}}}] | | link = [http://build.flightgear.org:8080/{{{urn|}}} {{{label|FlightGear build server}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''buildserver'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''buildserver'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
| forum = {{#switch: {{{2|link}}} | | forum = {{#switch: {{{2|link}}} | ||
Line 12: | Line 12: | ||
| url = http://forum.flightgear.org/{{{urn|}}} | | url = http://forum.flightgear.org/{{{urn|}}} | ||
| link = [http://forum.flightgear.org/{{{urn|}}} {{{label|FlightGear forum}}}] | | link = [http://forum.flightgear.org/{{{urn|}}} {{{label|FlightGear forum}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''forum'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''forum'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
| main = {{#switch: {{{2|link}}} | | main = {{#switch: {{{2|link}}} | ||
| name = SourceForge | | name = SourceForge | ||
| | | code = sf | ||
| url = http://sourceforge.net/projects/flightgear/{{{urn|}}} | | url = http://sourceforge.net/projects/flightgear/{{{urn|}}} | ||
| link = [http://sourceforge.net/projects/flightgear/{{{urn|}}} {{{label|Main FlightGear repository}}}] | | link = [http://sourceforge.net/projects/flightgear/{{{urn|}}} {{{label|Main FlightGear repository}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''main'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''main'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
| mapserver = {{#switch: {{{2|link}}} | | mapserver = {{#switch: {{{2|link}}} | ||
Line 25: | Line 25: | ||
| url = http://mapserver.flightgear.org/{{{urn|}}} | | url = http://mapserver.flightgear.org/{{{urn|}}} | ||
| link = [http://mapserver.flightgear.org/{{{urn|}}} {{{label|FlightGear mapserver}}}] | | link = [http://mapserver.flightgear.org/{{{urn|}}} {{{label|FlightGear mapserver}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''mapserver'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''mapserver'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
| website = {{#switch: {{{2|link}}} | | website = {{#switch: {{{2|link}}} | ||
Line 31: | Line 31: | ||
| url = http://flightgear.org/{{{urn|}}} | | url = http://flightgear.org/{{{urn|}}} | ||
| link = [http://flightgear.org/{{{urn|}}} {{{label|website}}}] | | link = [http://flightgear.org/{{{urn|}}} {{{label|website}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''website'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''website'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
| wiki = {{#switch: {{{2|link}}} | | wiki = {{#switch: {{{2|link}}} | ||
Line 37: | Line 37: | ||
| url = http://wiki.flightgear.org/{{{urn|}}} | | url = http://wiki.flightgear.org/{{{urn|}}} | ||
| link = [http://wiki.flightgear.org/{{{urn|}}} {{{label|FlightGear wiki}}}] | | link = [http://wiki.flightgear.org/{{{urn|}}} {{{label|FlightGear wiki}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''wiki'''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure '''wiki'''|User:Johan G/project infrastructure}} | ||
}} | }} | ||
<!-- | = {{#switch: {{{2|link}}} | <!-- | = {{#switch: {{{2|link}}} | ||
Line 43: | Line 43: | ||
| url = | | url = | ||
| link = [ {{{label|}}}] | | link = [ {{{label|}}}] | ||
| #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure ''''''|project infrastructure}} | | #default = {{error|Attribute '''{{{2}}}''' invalid for infrastructure ''''''|User:Johan G/project infrastructure}} | ||
}} --> | }} --> | ||
| #default = {{error|Invalid '''infrastructure''' parameter|project infrastructure}} | | #default = {{error|Invalid '''infrastructure''' parameter|User:Johan G/project infrastructure}} | ||
}}<noinclude> | }}<noinclude> | ||
{{Informative template|1= | {{Informative template|1= | ||
__NOTOC__ | __NOTOC__ | ||
== Goal == | == Goal == | ||
This template | This meta template is used by other templates as lookup table. It will return attributes associated with project infrastructure websites. | ||
== Usage == | == Usage == | ||
Line 64: | Line 58: | ||
; infrastructure: Name of the infrastucture, for example '''forum''', '''wiki''' or '''main'''. Defaults to '''main-repo'''. | ; infrastructure: Name of the infrastucture, for example '''forum''', '''wiki''' or '''main'''. Defaults to '''main-repo'''. | ||
; attribute: | ; attribute: Attribute associated with the infrastructure to return. Defaults to '''link'''. | ||
:; code: Returns an internal code for the host used by other templates (in essence an abbreviation) | |||
:; link: Returns an external link | |||
:; name: Returns the name of the infrastructure | |||
:; url: Returns an url to the infrastructure | |||
; urn: Optional string with path, queries, parameters and fragments to use with the '''url''' and '''link''' attributes. | ; urn: Optional string with path, queries, parameters and fragments to use with the '''url''' and '''link''' attributes. | ||
; label: Optional label to use with the '''link''' attribute. | ; label: Optional label to use with the '''link''' attribute. | ||
Available parameters: | Available parameters and attributes: | ||
{{{!}} class="wikitable" | {{{!}} class="wikitable" | ||
! rowspan="2" valign="top" {{!}} Infrastructure | ! rowspan="2" valign="top" {{!}} Infrastructure | ||
! colspan=" | ! colspan="4" {{!}} Attributes | ||
{{!}} | {{!}} rowspan="2" valign="bottom" {{!}} urn | ||
{{!}} | {{!}} rowspan="2" valign="bottom" {{!}} label | ||
{{!-}} | {{!-}} | ||
{{!}} | {{!}} code {{!!}} link {{!!}} name {{!!}} url | ||
{{!-}} | {{!-}} | ||
{{!}} buildserver {{!!}} {{ | {{!}} buildserver | ||
{{!}} {{n/a}} {{!!}} {{User:Johan G/project infrastructure|buildserver|link}} {{!!}} {{User:Johan G/project infrastructure|buildserver|name}} {{!!}} {{User:Johan G/project infrastructure|buildserver|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
{{!-}} | {{!-}} | ||
{{!}} forum {{!!}} {{ | {{!}} forum | ||
{{!}} {{n/a}} {{!!}} {{User:Johan G/project infrastructure|forum|link}} {{!!}} {{User:Johan G/project infrastructure|forum|name}} {{!!}} {{User:Johan G/project infrastructure|forum|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
{{!-}} | {{!-}} | ||
{{!}} main {{!!}} {{ | {{!}} main | ||
{{!}} {{User:Johan G/project infrastructure|main|code}} {{!!}} {{User:Johan G/project infrastructure|main|link}} {{!!}} {{User:Johan G/project infrastructure|main|name}} {{!!}} {{User:Johan G/project infrastructure|main|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
{{!-}} | {{!-}} | ||
{{!}} mapserver {{!!}} {{ | {{!}} mapserver | ||
{{!}} {{n/a}} {{!!}} {{User:Johan G/project infrastructure|mapserver|link}} {{!!}} {{User:Johan G/project infrastructure|mapserver|name}} {{!!}} {{User:Johan G/project infrastructure|mapserver|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
{{!-}} | {{!-}} | ||
{{!}} website {{!!}} {{ | {{!}} website | ||
{{!}} {{n/a}} {{!!}} {{User:Johan G/project infrastructure|website|link}} {{!!}} {{User:Johan G/project infrastructure|website|name}} {{!!}} {{User:Johan G/project infrastructure|website|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
{{!-}} | {{!-}} | ||
{{!}} wiki {{!!}} {{yes}} {{!!}} {{yes}} {{!!}} {{ | {{!}} wiki | ||
{{!}} {{n/a}} {{!!}} {{User:Johan G/project infrastructure|wiki|link}} {{!!}} {{User:Johan G/project infrastructure|wiki|name}} {{!!}} {{User:Johan G/project infrastructure|wiki|url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} | |||
<!-- {{!-}} | |||
{{!}} | |||
{{!}} {{User:Johan G/project infrastructure||code}} {{!!}} {{User:Johan G/project infrastructure||link}} {{!!}} {{User:Johan G/project infrastructure||name}} {{!!}} {{User:Johan G/project infrastructure||url}} | |||
{{!}} {{yes}} {{!!}} {{yes}} --> | |||
{{!}}} | {{!}}} | ||
== Examples == | == Examples == | ||
{{obr}}project infrastructure{{cbr}} | |||
{{User:Johan G/project infrastructure}} | |||
{{obr}}project infrastructure{{!}}forum{{cbr}} | {{obr}}project infrastructure{{!}}forum{{cbr}} | ||
{{User:Johan G/project infrastructure|forum}} | {{User:Johan G/project infrastructure|forum}} | ||
{{obr}}project infrastructure{{!}}forum{{!}}code{{cbr}} | |||
{{User:Johan G/project infrastructure|forum|code}} | |||
{{obr}}project infrastructure{{!}}forum{{!}}link{{cbr}} | {{obr}}project infrastructure{{!}}forum{{!}}link{{cbr}} | ||
Line 107: | Line 127: | ||
== Known issues == | == Known issues == | ||
== Related templates == | == Related templates == | ||
* {{tl| | * {{tl|project infrastructure}} | ||
}} | }} |
Revision as of 07:22, 8 March 2016
This template suggestion is a draft.
I will be back to this shortly. Feel free to have a peek. I notice that there is a lot of repetition and thus room for a subtemplate. |
The following template description is not displayed when the template is inserted in an article.
Goal
This meta template is used by other templates as lookup table. It will return attributes associated with project infrastructure websites.
Usage
{{project infrastructure|infrastructure|attribute|urn=|label=}}
All parameters are optional. The label parameter can only be used when value of the attribute parameter is link. If no parameter is given a link to the SourceForge project page will be returned.
- infrastructure
- Name of the infrastucture, for example forum, wiki or main. Defaults to main-repo.
- attribute
- Attribute associated with the infrastructure to return. Defaults to link.
- code
- Returns an internal code for the host used by other templates (in essence an abbreviation)
- link
- Returns an external link
- name
- Returns the name of the infrastructure
- url
- Returns an url to the infrastructure
- urn
- Optional string with path, queries, parameters and fragments to use with the url and link attributes.
- label
- Optional label to use with the link attribute.
Available parameters and attributes:
Infrastructure | Attributes | urn | label | |||
---|---|---|---|---|---|---|
code | link | name | url | |||
buildserver | N/A | FlightGear build server | FlightGear build server | http://build.flightgear.org:8080/ | Yes | Yes |
forum | N/A | FlightGear forum | FlightGear forum | http://forum.flightgear.org/ | Yes | Yes |
main | sf | Main FlightGear repository | SourceForge | http://sourceforge.net/projects/flightgear/ | Yes | Yes |
mapserver | N/A | FlightGear mapserver | FlightGear mapserver | http://mapserver.flightgear.org/ | Yes | Yes |
website | N/A | website | website | http://flightgear.org/ | Yes | Yes |
wiki | N/A | FlightGear wiki | FlightGear wiki | http://wiki.flightgear.org/ | Yes | Yes |
Examples
{{project infrastructure}}
{{project infrastructure|forum}}
{{project infrastructure|forum|code}}
{{User:Johan G/project infrastructure}}: Attribute code invalid for infrastructure forum
{{project infrastructure|forum|link}}
{{project infrastructure|forum|name}}
FlightGear forum
{{project infrastructure|forum|url}}
{{project infrastructure|forum|link|urn=viewtopic.php?f=8&t=28727|label=Forum Rules topic}}
Known issues
Related templates