Template:Programming language: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Missing brackets.)
m (fix Lua)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#switch: {{lc|{{{language|C++}}}}}
{{#if: {{{1|}}}
  | c         = C           {{main other|[[Category:C software]]}}
  | {{#switch: {{lc:{{{1|}}}}}
  | c++       = C++         {{main other|[[Category:C++ software]]}}
      | c           ={{{pre|}}}C<!--
  | fortran   = FORTRAN     {{main other|[[Category:FORTRAN software]]}}
                  -->{{main other|[[Category:C software]]}}
  | go         = Go           {{main other|[[Category:Go software]]}}
      | c++         ={{{pre|}}}C++<!--
  | java       = Java         {{main other|[[Category:Java software]]}}
                  -->{{main other|[[Category:C++ software]]}}
  | javascript = JavaScript   {{main other|[[Category:JavaScript software]]}}
      | fortran     ={{{pre|}}}FORTRAN<!--
  | nasal     = Nasal       {{main other|[[Category:Nasal software]]}}
                  -->{{main other|[[Category:FORTRAN software]]}}
  | perl       = Perl         {{main other|[[Category:Perl software]]}}
      | go         ={{{pre|}}}Go<!--
  | php       = Php          {{main other|[[Category:Php software]]}}
                  -->{{main other|[[Category:Go software]]}}
  | python     = Python       {{main other|[[Category:Python software]]}}
      | java       ={{{pre|}}}Java<!--
  | ruby       = Ruby         {{main other|[[Category:Ruby software]]}}
                  -->{{main other|[[Category:Java software]]}}
  | r         = R           {{main other|[[Category:R software]]}}
      | javascript ={{{pre|}}}JavaScript<!--
  | shell     = Shell script {{main other|[[Category:Shell script software]]}}
                  -->{{main other|[[Category:JavaScript software]]}}
  | swift     = Swift       {{main other|[[Category:Swift software]]}}
      | lua        ={{{pre|}}}Lua<!--
}}
                  -->{{main other|[[Category:Lua software]]}}
<noinclude>
      | nasal       ={{{pre|}}}Nasal<!--
                  -->{{main other|[[Category:Nasal software]]}}
      | objective-c ={{{pre|}}}Objective-C<!--
                  -->{{main other|[[Category:Objective-C software]]}}
      | perl       ={{{pre|}}}Perl<!--
                  -->{{main other|[[Category:Perl software]]}}
      | php         ={{{pre|}}}PHP<!--
                  -->{{main other|[[Category:PHP software]]}}
      | python     ={{{pre|}}}Python<!--
                  -->{{main other|[[Category:Python software]]}}
      | ruby       ={{{pre|}}}Ruby<!--
                  -->{{main other|[[Category:Ruby software]]}}
      | r           ={{{pre|}}}R<!--
                  -->{{main other|[[Category:R software]]}}
      | shell       ={{{pre|}}}Shell script<!--
                  -->{{main other|[[Category:Shell script software]]}}
      | swift       ={{{pre|}}}Swift<!--
                  -->{{main other|[[Category:Swift software]]}}
      | #default    ={{{pre|}}}{{{1}}}<!--
                  -->{{main other|[[Category:Unknown software]]}}
    }}
}}<noinclude>
{{-}}
{{-}}
{{Informative template|1=
{{Informative template|1=
Line 26: Line 47:
  {{obr}}'''programming language'''
  {{obr}}'''programming language'''
  {{!}} language            =  
  {{!}} language            =  
{{!}} ''pre''                =
  {{cbr}}
  {{cbr}}


; language:  The string representation of the programming language.
; language:  The string representation of the programming language.  Capitalisation is ignored.
 
; pre:  Text to prefix prior to the link text.  This is useful for creating lists.


== Examples ==
== Examples ==
Line 41: Line 65:


{{programming language|c++}}
{{programming language|c++}}
=== Nasal ===
  {{obr}}programming language{{!}}Nasal{{cbr}}
{{programming language|Nasal}}
=== Multiple languages ===
This should fail - the list should be processed using the #titleparts parser function upstream.
  {{obr}}programming language{{!}}C/C++/Nasal{{cbr}}
{{programming language|C/C++/Nasal}}


}}
}}

Latest revision as of 12:42, 5 October 2020


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

Goal

This template is used to process programming language strings to return standardised names and categories.

Usage

Add this to the top of the article describing the software.

{{programming language
| language            = 
| pre                 = 
}}
language
The string representation of the programming language. Capitalisation is ignored.
pre
Text to prefix prior to the link text. This is useful for creating lists.

Examples

C++

  {{programming language|C++}}

C++

  {{programming language|c++}}

C++

Nasal

  {{programming language|Nasal}}

Nasal

Multiple languages

This should fail - the list should be processed using the #titleparts parser function upstream.

  {{programming language|C/C++/Nasal}}

C/C++/Nasal