Pang-bô͘:Track gauge/doc

Lohankhapedia (自由的百科全書) 欲共你講..。
跳至導覽 跳至搜尋

This template accepts a track gauge and returns that defined track gauge well formatted, plus the converted size value by another unit:

  • {{Track gauge|1520 mm}}1,520 mm (4 ft 11+2732 in)
  • {{Track gauge|4 ft}}4 ft (1,219 mm)

Extra options are available:

  • {{Track gauge|1520 mm|lk=on}}1,520 mm (4 ft 11+2732 in)
  • {{Track gauge|1520 mm|al=on}}1,520 mm (4 ft 11+2732 in) Russian gauge
  • {{Track gauge|1520 mm|allk=on}}1,520 mm (4 ft 11+2732 in) Russian gauge

Input options[修改]

The first parameter specifies the gauge:

  • <syntaxhighlight lang="text" class="" id="" style="" inline="1">{{Track gauge|1435 mm}}</syntaxhighlight> → 1,435 mm (4 ft 8+12 in)
  • <syntaxhighlight lang="text" class="" id="" style="" inline="1">{{Track gauge|4 ft 8.5 in}}</syntaxhighlight> → 4 ft 8+12 in (1,435 mm)
  • <syntaxhighlight lang="text" class="" id="" style="" inline="1">{{Track gauge|4 ft 8 1/2 in}}</syntaxhighlight> → 4 ft 8+12 in (1,435 mm)
  • <syntaxhighlight lang="text" class="" id="" style="" inline="1">{{Track gauge|56.5 in}}</syntaxhighlight> → 4 ft 8+12 in (1,435 mm)
  • <syntaxhighlight lang="text" class="" id="" style="" inline="1">{{Track gauge|Standard gauge}}</syntaxhighlight> → 1,435 mm (4 ft 8+12 in)

Rail track gauges can be entered as they are defined: in units mm or ft in. Also common accepted names can be used, see below.

The input value (a length, in metric or imperial units) must be a defined track gauge. Currently 135 gauges are defined by metric units, and 148 by imperial units. Some are defined in both unit systems, such as the standard gauge.

  • When an input value is not recognised by the template, the template simply returns the input as it is: {{Track gauge|25in}} → 25in
The page with this unknown input is also listed in a maintenance category, in the background, that signals interested editors that there is a new rail gauge used in Wikipedia. More on this below.
  • Some gauges in metric are defined in metres: 1 m is recognised. However, it is not available for all metric defined gauges. Using <syntaxhighlight lang="text" class="" id="" style="" inline="1">mm</syntaxhighlight> is a safer bet.

List of defined track gauges[修改]

Pang-bô͘:Track gauge/doc/input options

Formatting input[修改]

When entering a track gauge (like {{Track gauge|1435mm}}, these are formatting options. Keep in mind that only defined gauges are recognised.

Spacing is free, and fractions can be used in imperial units. Primes (' and ") may be used for [foot, inch]. Any [foot, inch] size can be entered in all-inches (4 ft 8 1/2 in equals 56 1/2 in and 56.5 in).

Input options, examples
Parameter
input
Result Note
<syntaxhighlight lang="text" class="" id="" style="" inline="1">1435 mm</syntaxhighlight> 1,435 mm (4 ft 8+12 in) standard gauge
<syntaxhighlight lang="text" class="" id="" style="" inline="1">standard gauge</syntaxhighlight> 1,435 mm (4 ft 8+12 in) standard gauge, by name
<syntaxhighlight lang="text" class="" id="" style="" inline="1">4 ft 8.5 in</syntaxhighlight> 4 ft 8+12 in (1,435 mm) standard gauge, this way puts imperial units first
<syntaxhighlight lang="text" class="" id="" style="" inline="1">UK sg</syntaxhighlight> 4 ft 8+12 in (1,435 mm) standard gauge, this way puts imperial units first
<syntaxhighlight lang="text" class="" id="" style="" inline="1">56.5 in</syntaxhighlight> 4 ft 8+12 in (1,435 mm) standard gauge, by all-inches
<syntaxhighlight lang="text" class="" id="" style="" inline="1">56.5"</syntaxhighlight> 4 ft 8+12 in (1,435 mm) standard gauge, using primes
<syntaxhighlight lang="text" class="" id="" style="" inline="1">56 1/2 in</syntaxhighlight> 4 ft 8+12 in (1,435 mm) standard gauge, using slash for fraction
<syntaxhighlight lang="text" class="" id="" style="" inline="1">1 m</syntaxhighlight> 1,000 mm (3 ft 3+38 in) 1 m is recognised, but not many more in <syntaxhighlight lang="text" class="" id="" style="" inline="1">m</syntaxhighlight>. Better use <syntaxhighlight lang="text" class="" id="" style="" inline="1">mm</syntaxhighlight>
<syntaxhighlight lang="text" class="" id="" style="" inline="1">16.5 mm</syntaxhighlight> 16.5 mm (0.65 in) HO scale model railway
<syntaxhighlight lang="text" class="" id="" style="" inline="1">16.5 in</syntaxhighlight> 16+12 in (419 mm) Miniature railway
<syntaxhighlight lang="text" class="" id="" style="" inline="1">7 ft 0.25 in</syntaxhighlight> 7 ft 14 in (2,140 mm) Brunel
<syntaxhighlight lang="text" class="" id="" style="" inline="1">2140 mm</syntaxhighlight> 2140 mm Not recognised (so no converted value). This track gauge, Brunel's, is not defined in mm.
<syntaxhighlight lang="text" class="" id="" style="" inline="1">65 in</syntaxhighlight> 65 in Input not recognised (so no converted value); output copies the input.
This is a good way to enter an uncovered rail gauge on a page: other editors will notice (and can add a new gauge to the template!).

Parameters[修改]

{{Track gauge
|
| lk=on
| first=imp, met
| disp= s, /, 1, br, [], <any literal text>
| al=on
| allk=on
| nowrap=off (default), on, all
| addcat=no
| unitlink=on
}}
Optional parameters
Parameter What it does Example (code) Example (output)
lk=on Links the defining measure (first measure)
"defined size" depends on input
{{Track gauge|3ft6in|lk=on}}

{{Track gauge|1067mm|lk=on}}

3 ft 6 in (1,067 mm)
1,067 mm (3 ft 6 in)
al=on Adds the alternate name after the gauge measurement values {{Track gauge|sg|al=on}} 1,435 mm (4 ft 8+12 in) phiau-chún thih-ki-kui
allk=on Adds a wikilink to the alternate name where applicable {{Track gauge|sg|allk=on}} 1,435 mm (4 ft 8+12 in) phiau-chún thih-ki-kui
first=imp
first=met
Puts the requested measure first (metric, imperial) {{Track gauge|1000mm|first=imp}} 3 ft 3+38 in (1,000 mm)
disp=any text The text will be written between the measurements, two spaces added. Brackets are omitted. Text must be 2 characters or more. (codes for |disp= are processed as described: 1, s, /, br). {{Track gauge|sg|disp=also defined as being}} 1,435 mm also defined as being 4 ft 8+12 in
disp=s or / Uses a slash as a separator rather than parentheses {{Track gauge|sg|disp=s}} 1,435 mm / 4 ft 8+12 in
disp=[] Uses a square brackets rather than parentheses {{Track gauge|sg|disp=[]}} 1,435 mm [4 ft 8+12 in]
disp=1 Only shows the first measure (may be used when repeated on a page
or in conjunction with first= to display the output only)
{{Track gauge|sg|disp=1}} 1,435 mm
disp=br Forces a line break after the first size (and also before any gauge name) {{Track gauge|sg|disp=br}} 1,435 mm
(4 ft 8+12 in)
nowrap=off (default), on, all Sets possible line break (line wrap): after between the measurements (off=defalt), not (on, all), or not at all when named gauge is present. (note: until May 2014, default behaviour was no break between the measurements. This has changed.) {{Track gauge|sg|nowrap=on}} 1,435 mm (4 ft 8+12 in)
addcat=no Will not add a maintenance category {{Track gauge|sg|addcat=no}} 1,435 mm (4 ft 8+12 in)
unitlink=on Adds wikilinks to the measurement unit labels {{Track gauge|sg|unitlink=on}} 1,435 mm (ft 8+12 in)
  • Names can be universal, being defined worldwide. For example: Iberian gauge, 1,668 mm (5 ft 5+2132 in) Iberian gauge. Other names can be localor culturally restricted, for example the name "Cape gauge" is used in South Africa for 3 ft 6 in (1,067 mm), but not in Japan (in Japan that same track gauge is not named).
  • Also, two sizes can lead to one gauge name.

Named gauges[修改]

Established gauge names can be entered. The word "gauge" can be omitted. Case-insensitive (A=a). See also the |al=, |allk= parameters (below), to show a gauge name in the outcome.

Input Result Note
{{Track gauge|Baltimore gauge|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge
{{Track gauge|Baltimore|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge Omitting " gauge", same effect
{{Track gauge|baltimore|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge Case-insensitive (A=a)
{{Track gauge|baltimore|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge |al=on shows the alternative (name)
{{Track gauge|baltimore|allk=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge |allk=on shows the alternative (name), linked
{{Track gauge|baltimore|lk=on|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge |lk=on links the size (as always)
{{Track gauge|Baltimore streetcar gauge|al=on}} 5 ft 4+12 in (1,638 mm) Baltimore streetcar gauge This one has more names
{{Track gauge|Bosnian|al=on}} 760 mm (2 ft 5+1516 in) Bosnian gauge
{{Track gauge|Brunel|al=on}} 7 ft (2,134 mm) Brunel gauge
{{Track gauge|Cape|al=on}} 3 ft 6 in (1,067 mm) Cape gauge
{{Track gauge|Iberian|al=on}} 1,668 mm (5 ft 5+2132 in) Iberian gauge
{{Track gauge|Indian|al=on}} 5 ft 6 in (1,676 mm) Indian gauge
{{Track gauge|Victorian|al=on}} 1,600 mm (5 ft 3 in) Victorian broad gauge
{{Track gauge|Irish|al=on}} 5 ft 3 in (1,600 mm) Irish gauge
{{Track gauge|metre|al=on}} 1,000 mm (3 ft 3+38 in) metre gauge
{{Track gauge|Ohio|al=on}} 4 ft 10 in (1,473 mm) Ohio gauge
{{Track gauge|Pennsylvania|al=on}} 5 ft 2+12 in (1,588 mm) Pennsylvania trolley gauge
{{Track gauge|Pennsylvania trolley|al=on}} 5 ft 2+12 in (1,588 mm) Pennsylvania trolley gauge
{{Track gauge|Russian|al=on}} 1,520 mm (4 ft 11+2732 in) Russian gauge
{{Track gauge|Scotch|al=on}} 4 ft 6 in (1,372 mm) Scotch gauge
{{Track gauge|standard gauge|al=on}} 1,435 mm (4 ft 8+12 in) phiau-chún thih-ki-kui Also: "sg", "metsg" (metric units first)
{{Track gauge|US sg|al=on}} 4 ft 8+12 in (1,435 mm) phiau-chún thih-ki-kui Also: "imp sg", "UK sg", "NA sg" (imperial units first)
{{Track gauge|Swedish three foot|al=on}} 891 mm (2 ft 11+332 in) Swedish three foot
{{Track gauge|Swedish|al=on}} 891 mm (2 ft 11+332 in) Swedish three foot
{{Track gauge|Toronto|al=on}} 4 ft 10+78 in (1,495 mm) Toronto gauge

English variant (ENGVAR)[修改]

This template defaults to UK-English. For articles written in US-English, set parameter |engvar to |engvar=en-US. In this situation, the US-English spelling is shown:

{{track gauge|1000mm|allk=on|engvar=en-US}}1,000 mm (3 ft 3+38 in) meter gauge

As of 2016, the only two gauges impacted are the 1000 mm and 1009 mm gauges. In UK-English these are spelled metre, in US-English these are spelled meter.

Why not use {{Convert}}?[修改]

To convert a track gauge, using {{Convert}} comes to mind. For example, standard gauge:

  • {{Convert|1435|mm|ftin|abbr=on}} → 1,435 mm (4 ft 8.5 in)
However, this has some disadvantages. First of all, track gauges are defined by an institute, not just measured. The list of those defined track gauges is limited, and overseeable (today some 270 physical sizes are defined).
Using {{Track gauge}} allows us to track (follow) all articles with a specific gauge. This way the list can be made more accurate, correct and complete.
Also, the track definition can be directly linked to the sourcing article: 1,067 mm (3 ft 6 in).
Further more, the template allows to recognise named gauges such as "Russian gauge".

Tracking category[修改]

{{Track gauge}} detects that an undefined gauge is entered, and signal the page for maintenance. For example, metre gauge is only defined in metric. Entering an imperial size would categorise that article in Category:Articles using Template:Track gauge with unrecognized input (0).

TemplateData[修改]

This is the TemplateData documentation for this template used by VisualEditor and other tools.

See the monthly error report for this template.

TemplateData for Track gauge

TemplateData

The template formats a track gauge size into standard notation and adds the conversion into the imperial/metric (other) size

模板參數[編輯模板資料]

參數描述類型狀態
Track gauge definition1

Defined track gauge, in mm or ft in. Also can accept: ' '', m, gauge name

字串必填
Link top measurement unitslk

=on: adds link to the gauge defining article

字串非必填
Alternative nameal

=on: Add gauge name (if existing)

字串非必填
Alternative name, linkedallk

=on: Add gauge name (if existing) and link to its wiki page

字串非必填
Display converted gaugedisp

Separator for the converted value: 1=none (first value only); =s, /: slash separator; =''Any text'' (2 or more characters): Any literal text written between the two values.

預設
(...) brackets
字串非必填
Which unit to mention firstfirst

=met: metric first; =imp: imperial first (default: input unit)

預設
By input
字串非必填
Allow line wrapping of textnowrap

wrap=off, on, all: allows lin breaking between the two measurements. Default: on. 'all' disallows linebreaking wiothing an alternative name

預設
off
字串非必填
Wikilink unitsunitlink

=on: do wikilink

字串非必填
Categorize pageaddcat

=no: do not categorize

預設
yes
字串非必填
ENGVARengvar

When set to en-US, "metRE" is spelled "metER"

預設
en-UK
範例
meter gauge only
不明非必填
commacomma

沒有描述

不明非必填

See also[修改]

Pang-bô͘:Navbox track gauge categories

Sources

External links; sources[修改]

Sources
Scaled rail models
DGEG (German) Spurweiten_Auswahl 107-Spurweiten_Auswahl Spurweiten_Auswahl