Difference between revisions of "Template:LCSR/doc"

From blackwiki
Jump to navigation Jump to search
imported>Bungle
(documentation for template)
 
imported>Bungle
(update doc)
Line 4: Line 4:
  
 
==Usage==
 
==Usage==
  <nowiki>{{LCSR|Country (ISO)|Male rank|Male number|Female rank|Female number|Parameters (optional)}}</nowiki>
+
  <nowiki>{{LCSR|Country (ISO)|Country rank|Both sexes rank|Male rank|Male number|Female rank|Female number|Parameters (optional)}}</nowiki>
  
 
This template is used for managing table items on the article [[List of countries by suicide rate]]. It will automatically calculate the average and ratio from specified figures. In addition, it will detect if there is an associated article relating to suicide for that country and display a link if there is.
 
This template is used for managing table items on the article [[List of countries by suicide rate]]. It will automatically calculate the average and ratio from specified figures. In addition, it will detect if there is an associated article relating to suicide for that country and display a link if there is.
Line 16: Line 16:
 
   <nowiki>{|class="wikitable sortable" style="text-align:right"
 
   <nowiki>{|class="wikitable sortable" style="text-align:right"
 
   |-
 
   |-
   !Country !! Both sexes !! Male<br>rank !! Male !! Female<br>rank !! Female !! Male:Female ratio
+
   ! Both sexes<br>rank !! Country !! Both sexes !! Male<br>rank !! Male !! Female<br>rank !! Female !! Male:Female ratio
   {{LCSR|China|143|7.9|24|8.3|style=italic}}
+
   {{LCSR|China|103|8.0|143|7.9|24|8.3|style=italic}}
   {{LCSR|Romania|85|13.9|141|2.4}}
+
   {{LCSR|Romania|103|8.0|85|13.9|141|2.4}}
   {{LCSR|Singapore|114|11.1|76|4.9|fn=legislation-b}}
+
   {{LCSR|Singapore|105|7.9|114|11.1|76|4.9|fn=legislation-b}}
   {{LCSR|Montenegro|102|12.6|108|3.6}}
+
   {{LCSR|Montenegro|105|7.9|102|12.6|108|3.6}}
   {{LCSR|Bulgaria|95|13.1|118|3.2}}</nowiki>
+
   {{LCSR|Bulgaria|105|7.9|95|13.1|118|3.2}}</nowiki>
 
   <nowiki>|}</nowiki>
 
   <nowiki>|}</nowiki>
  
Line 32: Line 32:
 
{|class="wikitable sortable" style="text-align:right"
 
{|class="wikitable sortable" style="text-align:right"
 
|-
 
|-
!Country !! Both sexes !! Male<br>rank !! Male !! Female<br>rank !! Female !! Male:Female ratio
+
! Both sexes<br>rank !! Country !! Both sexes !! Male<br>rank !! Male !! Female<br>rank !! Female !! Male:Female ratio
{{LCSR|China|143|7.9|24|8.3|style=italic}}
+
{{LCSR|China|103|8.0|143|7.9|24|8.3|style=italic}}
{{LCSR|Romania|85|13.9|141|2.4}}
+
{{LCSR|Romania|103|8.0|85|13.9|141|2.4}}
{{LCSR|Singapore|114|11.1|76|4.9|fn=legislation-b}}
+
{{LCSR|Singapore|105|7.9|114|11.1|76|4.9|fn=legislation-b}}
{{LCSR|Montenegro|102|12.6|108|3.6}}
+
{{LCSR|Montenegro|105|7.9|102|12.6|108|3.6}}
{{LCSR|Bulgaria|95|13.1|118|3.2}}
+
{{LCSR|Bulgaria|105|7.9|95|13.1|118|3.2}}
 
|}
 
|}
  

Revision as of 13:37, 20 January 2019

Usage

{{LCSR|Country (ISO)|Country rank|Both sexes rank|Male rank|Male number|Female rank|Female number|Parameters (optional)}}

This template is used for managing table items on the article List of countries by suicide rate. It will automatically calculate the average and ratio from specified figures. In addition, it will detect if there is an associated article relating to suicide for that country and display a link if there is.

Parameters

  • |fn=NAME, optional, defines a reference to a footnote
  • |flag=no, optional, disables the flag icon (retains flag space)
  • |style=bold OR italic, optional, defines whether the row should be styled in italic or bold

Example

 {|class="wikitable sortable" style="text-align:right"
  |-
  ! Both sexes<br>rank !! Country !! Both sexes !! Male<br>rank !! Male !! Female<br>rank !! Female !! Male:Female ratio
  {{LCSR|China|103|8.0|143|7.9|24|8.3|style=italic}}
  {{LCSR|Romania|103|8.0|85|13.9|141|2.4}}
  {{LCSR|Singapore|105|7.9|114|11.1|76|4.9|fn=legislation-b}}
  {{LCSR|Montenegro|105|7.9|102|12.6|108|3.6}}
  {{LCSR|Bulgaria|105|7.9|95|13.1|118|3.2}}
 |}
 {{notelist|refs=
{{efn|name=legislation-b|Suicide attempts are illegal in this country, and punishable by imprisonment or other penalties.   This might be the reason for the low suicide rate in these countries. See also [[Suicide legislation]].}}
}}

will create..

Both sexes
rank
Country Both sexes Male
rank
Male Female
rank
Female Male:Female ratio
103  China Asia 8.0 143 7.9 24 8.3 0.95
103  Romania Europe 8.0 85 13.9 141 2.4 5.79
105  Singapore[lower-alpha 1] Asia 7.9 114 11.1 76 4.9 2.27
105  Montenegro Europe 7.9 102 12.6 108 3.6 3.5
105  Bulgaria Europe 7.9 95 13.1 118 3.2 4.09

Notes

  1. Suicide attempts are illegal in this country, and punishable by imprisonment or other penalties. This might be the reason for the low suicide rate in these countries. See also Suicide legislation.

Notes MUST have the original citation located directly within the respective notes section, within the notelist template.