Changes
→Text cells in icon rows: cell width table
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{High-use}}
{{Lua sidebar}}
{{Lua|Module:Routemap}}
{{Uses TemplateStyles|Template:Routemap/styles.css}}
This [[Wikipedia:Lua|Lua]]-based template replaces the older parser-function-based {{tl|BS-map}} (and deprecated {{tl|Railway line header}}, {{tl|BS-header}} and {{tl|BS-table}}) templates for [[Wikipedia:Route diagram template]]s because diagrams created by {{Routemap}} load faster.
== Usage ==
{{Parameter names example | _template={{PAGENAMETDOC}}
| title = {{(((}}title{{)))}} | navbar={{PAGENAMETDOC}} | legend alt | top | footnote
| map =
HUBrg-R\HUBq-L\HUBq-L\HUBlg-L
HUB-R!~s*{{(((}}map{{)))}}__fontsize=cmt\\\HUB-L
HUBlf-R\HUBq-R\HUBq-R\HUBrf-L
}}
<pre style="overflow:auto;">
{{Routemap
|navbar =
|navbar pos =
|navbar mini =
|title =
|title color =
|title bg =
|bg =
|inline =
|collapsible =
|collapse =
|legend =
|legend alt =
|float =
|style =
|top =
|footnote =
|text-width =
|map =
}}
</pre>
== Markup for map parameter ==
{{for|a tabulated list of many of the pictograms available for railway routemaps|commons:BSicon/Catalogue}}
{{hatnote|If you've already read this section, you may want to skip to [[#Syntax overview|§ Syntax overview]].}}
The markup for composing the diagram in the {{para|map}} parameter is different to the {{tl|BSrow}}-based templates. The major differences are the separators in each row. Subtemplates are not necessary, since a new row in the table is simply created by a [[carriage return]] (newline).
{{pre|{{blue|1={{Routemap
<var style="font-family:sans-serif;color:#252525"><small>Add other parameters like {{para|title}} here.</small></var>
|map=
<var style="font-family:sans-serif;color:#252525"><small>Map markup goes here!</small></var>
}}}}}}
=== Basic ===
{{Routemap|title=Example 1.1|legend=0|collapsible=0|map=
exCONTg~~ ~~ ~~{{mono|exCONTg}}
ENDExa~~ ~~ ~~{{mono|ENDExa}}
CONTgq\KRZu\CONTfq~~ ~~ ~~{{mono|CONTgq{{blue|\}}KRZu{{blue|\}}CONTfq}}
BHF~~ ~~ ~~{{mono|BHF}}
\ABZgl\CONTfq~~ ~~ ~~{{mono|{{blue|\}}ABZgl{{blue|\}}CONTfq}}
CONTf~~ ~~ ~~{{mono|CONTf}}
}}
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>}}}}
* Icons are separated by the [[backslash]] <code>\</code>.
* Each group of icons is centered in its row. The nameless icon (at the start of row 5 in the diagram) can be used as a spacer.
* The ID of each icon can be seen in its [[tooltip]]. Move your cursor over the icons to see them.
==== Sidebar text ====
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|dist./time}}</var>~~<var>{{color|#252525|main text}}</var>~~<var>{{color|#252525|remark}}</var>~~<var>{{color|#252525|right remark}}</var>}}}}
or
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|main text}}</var>}}}}
{|
|<pre><nowiki>{{Routemap
|title=Example 1.2
|map=
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 1.2
|map=
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
|}
* The third and fourth pairs of tildes can be omitted if there is no content following either of them.
* After the last icon ID, if there is only one set of "[[tilde]]-tilde" (<code>~~</code>), the following text will be displayed in the '''main text''' cell instead of '''dist./time'''.
* Separating text cells requires at least one empty space; otherwise the tildes will be treated as a [[Wikipedia:signature|signature]].
==== Text cells in icon rows ====
{{pre|{{blue|*<var>{{color|#252525|text}}</var>\d*<var>{{color|#252525|text}}</var>\cd*<var>{{color|#252525|text}}</var>~~<var>{{color|#252525|main text}}</var>}}}}
{|
|<syntaxhighlight lang="moin">{{Routemap
|title=Example 1.3
|map=
ENDEa~~ ~~ ~~Reversing siding
SPLa
cBS\vSTR\cBS~~Station
d*1\cBS\vSTR\cBS\d*2~~ ~~ ~~Platform numbers
cBS\vSTR\cBS
vCONTfge~~ ~~ ~~''to City''
}}</syntaxhighlight>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 1.3
|map=
ENDEa~~ ~~ ~~Reversing siding
SPLa
cBS\vSTR\cBS~~Station
d*1\cBS\vSTR\cBS\d*2~~ ~~ ~~Platform numbers
cBS\vSTR\cBS
vCONTfge~~ ~~ ~~''to City''
}}
|}
The asterisk indicating a text cell can be preceded by one of the BSicons' width prefixes. (Normal BSicons are square.)
{| class="wikitable" style="text-align:center;"
|-
!scope="row" style="text-align:right;"| Letters
| <code>o</code> || <code>c</code> || <code>d</code> || <code>cd</code> || {{CNone|''none''}} || <code>b</code> || <code>s</code> || <code>bs</code> || <code>w</code>
|-
!scope="row" style="text-align:right;"| Width
| {{frac|1|8}} || {{frac|1|4}} || {{frac|1|2}} || {{frac|3|4}} || '''1''' || 2 || 4 || 6 || 8
|}
=== Icon overlay, icon link, background color and colspan ===
{|
|<syntaxhighlight lang="moin">{{Routemap
|title=Example 2.1
|map=
-colspan-1
Icon overlay
uSTRq!~STR2!~BHF!~lHUB\\dSTR!~uSTRq\dSTR!~dNULf
-colspan-2-style=border-bottom:5px solid red;
----
icon link
utBHF!@Superhub
-colspan
----
background color
-colspan-end
utSTR~~ ~~ ~~ ~~ ~~bg=#7af
}}</syntaxhighlight>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 2.1
|map=
-colspan-1
Icon overlay
uSTRq!~STR2!~BHF!~lHUB\\dSTR!~uSTRq\dSTR!~dNULf
-colspan-2-style=border-bottom:5px solid red;
----
icon link
utBHF!@Superhub
-colspan
----
background color
-colspan-end
utSTR~~ ~~ ~~ ~~ ~~bg=#7af
}}
|}
* Overlay separator "exclamation mark-tilde" (<code>!~</code>) must follow the icon ID which is to be overlaid.
* Overlay is practically unlimited, but legibility should be taken into account.
* The width of the underlying icon determines the width of the combination, even if less than the overlay. The icons are aligned with their left edges together, so that they will not be centered on each other if they differ in width. If the overlay extends past the underlying icon, it will overlay the following icon (but not the following icon's overlay).
* When using icon overlay and icon link for the same icon cell, the icon link separator (<code>!@</code>) must follow the last (top) overlaying icon ID.
* The background color parameter (<code>bg=</code>) requires 5 sets of preceding text separators to be recognizable even if there is no text on that row whatsoever.
=== Other formatting options ===
==== Rows ====
{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 2.2
|map=
utSTR~~ ~~ ~~{{mono|1=bg=<abbr title="This is the normal BSicon color for watercourses.">#007CC3</abbr>}}~~ ~~bg=#007CC3
*1\*2\*3~~ ~~ ~~{{mono|1=color=red,bold=yes}}~~ ~~color=red,bold=yes
*A\*C\*E~~ ~~ ~~{{mono|1=align=l,b=1,fontsize=cmt}}~~ ~~align=left,b=1,fontsize=cmt
*B\*D\*F~~ ~~ ~~{{mono|1=colour=orange, align=b, i=y}}~~ ~~colour=orange, align=b, i=y
}}
Aside from <code>bg=</code>, there are several other parameters, separated by commas (<code>,</code>), which can be used to customize the display of a row. Only <code>bg=</code> can be used to change the display of icons; all others only affect text cells.
{| class="wikitable mw-collapsible mw-collapsed" style="font-size:small; min-width:75%"
! colspan="3" |Row parameters
|-
!Parameter name
!Values
!Result
|-
|<code>bg=</code>, <code>background=</code> ''or'' <code>bgcolor=</code>
|Any [[X11 color names|X11 color name]], [[RGB hex triplet]] or other valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/background background] property
|Row background is colored
|-
|<code>color=</code> ''or'' <code>colour=</code>
|Any [[X11 color names|X11 color name]] or [[RGB hex triplet]]
|Text cells in a row are colored
|-
|<code>b=</code> ''or'' <code>bold=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
|Text cells in a row are '''emboldened'''
|-
|<code>i=</code>, <code>it=</code> ''or'' <code>italic=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
|Text cells in a row are ''italicized''
|-
| rowspan="9" |<code>align=</code>
|No or invalid value
|Text in cells is centered horizontally and vertically
|-
|<code>l</code> ''or'' <code>left</code>
|Text in cells is aligned to the left
|-
|<code>r</code> ''or'' <code>right</code>
|Text in cells is aligned to the right
|-
|<code>a</code>, <code>t</code> ''or'' <code>top</code>
|Text in cells is aligned to the top
|-
|<code>e</code>, <code>b</code> ''or'' <code>bottom</code>
|Text in cells is aligned to the bottom
|-
|<code>la</code>, <code>tl</code>, <code>c4</code>, <code>nw</code>, <code>top-left</code> ''or'' <code>topleft</code>
|Text in cells is aligned to the top-left corner
|-
|<code>ra</code>, <code>tr</code>, <code>c1</code>, <code>ne</code>, <code>top-right</code> ''or'' <code>topright</code>
|Text in cells is aligned to the top-right corner
|-
|<code>le</code>, <code>bl</code>, <code>c3</code>, <code>sw</code>, <code>bottom-left</code> ''or'' <code>bottomleft</code>
|Text in cells is aligned to the bottom-left corner
|-
|<code>re</code>, <code>br</code>, <code>c2</code>, <code>se</code>, <code>bottom-right</code> ''or'' <code>bottomright</code>
|Text in cells is aligned to the bottom-right corner
|-
| rowspan="4" |<code>fontsize=</code>
|No value
|Text in cells is <code>10px</code> high and is transformed to be narrower <span style="font-size:10px;transform:scaleX(.9)">(example)</span>
|-
|<code>info</code> ''or'' <code>main</code>
|Text in cells is the same size as the large sidebar text (second column from center)
|-
|<code>cmt</code> ''or'' <code>comment</code>
|Text in cells is the same size as the <span style="font-size:90%">small sidebar text</span> (other columns)
|-
|Any valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/font-size font-size] property
|Text in cells is a different size (percentages are relative to the large sidebar text)
|}
==== Individual cells/icons ====
{{pre|{{blue|1=<var>{{color|#252525|icon}}</var>!_bg=<span style="background:purple;border-radius:0.15em;color:white">purple</span>\*<var>{{color|#252525|text}}</var>__align=l!~*<var>{{color|#252525|more text}}</var>__align=r,b='''yes'''}}}}
* Parameters for ''a single icon or text cell'' (e.g. <code>BHF</code>, <code>*Text</code>) are preceded by two underscores (<code>__</code>).
* Parameters for ''the contents of a table cell'' (a stack of overlaid objects, or a single icon or text box with no overlays) are preceded by an exclamation mark and an [[underscore]] (<code>!_</code>). This must follow the link (if any).
* For the last overlaid item in a stack, the individual item parameters (if any) must precede the stack parameters.
* Most of the parameters are the same as those for rows, but there are a few additional ones. Additionally, the values for <code>align=</code>, <code>bg=</code> and <code>color=</code> will override the row parameter values.
{| class="wikitable mw-collapsible mw-collapsed" style="font-size:small; min-width:75%"
! colspan="5" |Icon, text box and overlay stack parameters
|-
!Parameter name
!Values
! colspan="3" |Result
|-
|<code>bg=</code>, <code>background=</code> ''or'' <code>bgcolor=</code>
|Any [[X11 color names|X11 color name]], [[RGB hex triplet]] or other valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/background background] property
| colspan="3" |Background is colored<br/>''This should not be used with overlays above icons.''
|-
|<code>color=</code> ''or'' <code>colour=</code>
|Any [[X11 color names|X11 color name]] or [[RGB hex triplet]]
| colspan="3" |All the text of a cell, or the text of an individual text box, is colored
|-
|<code>b=</code> ''or'' <code>bold=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
| colspan="3" |'''Boldfaced''' text
|-
|<code>i=</code>, <code>it=</code> ''or'' <code>italic=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
| colspan="3" |''Italicized'' text
|-
| rowspan="16" |<code>align=</code>
|No or invalid value
| colspan="3" |Text is aligned per parameters of its parent (default: centered vertically and horizontally)
|-
|<code>l</code> ''or'' <code>left</code>
| rowspan="15" |Text is aligned to… (vertical / horizontal)<br/>''"Inherit" indicates that the cell will inherit its parent's value for that axis.''
|''inherit''
|left
|-
|<code>r</code> ''or'' <code>right</code>
|''inherit''
|right
|-
|<code>a</code>, <code>t</code> ''or'' <code>top</code>
|top
|''inherit''
|-
|<code>e</code>, <code>b</code> ''or'' <code>bottom</code>
|bottom
|''inherit''
|-
|<code>la</code>, <code>tl</code>, <code>c4</code>, <code>nw</code>, <code>top-left</code> ''or'' <code>topleft</code>
|top
|left
|-
|<code>ra</code>, <code>tr</code>, <code>c1</code>, <code>ne</code>, <code>top-right</code> ''or'' <code>topright</code>
|top
|right
|-
|<code>le</code>, <code>bl</code>, <code>c3</code>, <code>sw</code>, <code>bottom-left</code> ''or'' <code>bottomleft</code>
|bottom
|left
|-
|<code>re</code>, <code>br</code>, <code>c2</code>, <code>se</code>, <code>bottom-right</code> ''or'' <code>bottomright</code>
|bottom
|right
|-
|<code>c</code>, <code>center</code> ''or'' <code>centre</code>
|''inherit''
|center
|-
|<code>m</code> ''or'' <code>middle</code>
|middle
|''inherit''
|-
|<code>ma</code>, <code>tc</code>, <code>top-center</code>, <code>top-centre</code>, <code>topcenter</code> ''or'' <code>topcentre</code>
|top
|center
|-
|<code>me</code>, <code>bc</code>, <code>bottom-center</code>, <code>bottom-centre</code>, <code>bottomcenter</code> ''or'' <code>bottomcentre</code>
|bottom
|center
|-
|<code>lm</code>, <code>ml</code>, <code>middle-left</code> ''or'' <code>middleleft</code>
|middle
|left
|-
|<code>rm</code>, <code>mr</code>, <code>middle-right</code> ''or'' <code>middleright</code>
|middle
|right
|-
|<code>cm</code>, <code>mc</code>, <code>middle-center</code>, <code>middle-centre</code>, <code>middlecenter</code> ''or'' <code>middlecentre</code>
|middle
|center
|-
| rowspan="4" |<code>fontsize=</code>
|No value
| colspan="3" |Text is <code>10px</code> high and is transformed to be narrower <span style="font-size:10px;transform:scaleX(.9)">(example)</span>
|-
|<code>info</code> ''or'' <code>main</code>
| colspan="3" |Text is the same size as the large sidebar text (second column from center)
|-
|<code>cmt</code> ''or'' <code>comment</code>
| colspan="3" |Text is the same size as the <span style="font-size:90%">small sidebar text</span> (other columns)
|-
|Any valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/font-size font-size] property
| colspan="3" |Text is a different size (percentages are relative to the large sidebar text)
|-
|<code>abbr=</code>
|Pretty much anything that doesn't mess up the MediaWiki markup
| colspan="3" |Text has dotted underline and a tooltip containing the text after <code>abbr=</code><br/>''This will not have any effect if used on an overlay stack.''
|}
=== Collapsible ===
{|
|<pre><nowiki>{{Routemap
|title=Example 3.1: Basic collapsible
|text-width=80
|map=
-startCollapsible-collapsed
\KBHFa\~~terminus
hSTRa@g
WASSERq\hKRZW\WASSERq~~ ~~ ~~ ~~bridge
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 3.1: Basic collapsible
|text-width=80
|map=
-startCollapsible-collapsed
\KBHFa\~~terminus
hSTRag
WASSERq\hKRZW\WASSERq~~ ~~ ~~ ~~bridge
hSTRef
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
|}
{|
|<pre><nowiki>{{Routemap
|title=Example 3.2:<br/>Mixed odd and even rows
|tw=70
|map=
-startCollapsible-collapsed
d\KBHFa\d~~terminus
hKRZWae~~ ~~ ~~bridge
-endCollapsible-
BS2+l\BS2+r~~junction
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 3.2:<br/>Mixed odd and even rows
|tw=70
|map=
-startCollapsible-collapsed
d\KBHFa\d~~terminus
hKRZWae~~ ~~ ~~bridge
-endCollapsible-
BS2+l\BS2+r~~junction
}}
|}
* Adjust {{para|text-width}} (or {{para|tw}}) parameter until there is no break.
** Unit is "px" by default, but other units such as "em" are acceptable.
** Check the map in different browser and in mobile view, and increase text-width if it breaks.
* The icon number of the first row of collapsible section must be equal to or greater than the icon number of the widest non-collapsible row.
** As in example 3.2, use half-width empty icon {{bsq|d}} as filler when you are mixing both odd and even rows in the same map.
* Changing "''collapsed''" to "''nil''" will change the default state of the collapible section to uncollapsed.
==== Collapsible replacement ====
{|
|<pre><nowiki>{{Routemap
|title=Example 4.1
|text-width=150
|map=
KBHFa~~terminus
-startCollapsible-collapsed-replace
\LSTR\~~hidden section
\hSTRa@g\
WASSERq\hKRZW\WASSERq~~ ~~ ~~viaduct
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"| {{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 4.1
|text-width=150
|map=
KBHFa~~terminus
-startCollapsible-collapsed-replace
\LSTR\~~hidden section
\hSTRag\
WASSERq\hKRZW\WASSERq~~ ~~ ~~viaduct
hSTRef
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
|-
|<pre><nowiki>{{Routemap
|title=Example 4.2: Empty filler
|text-width=150
|map=
-startCollapsible-collapsed-replace
exCONTg~~under construction
leer
exKBHFa~~future terminus
exBHF~~future station
-endCollapsible
KBHFxa~~terminus
KBHFe~~terminus
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 4.2: Empty filler
|text-width=150
|map=
-startCollapsible-collapsed-replace
exCONTg~~under construction
leer
exKBHFa~~future terminus
exBHF~~future station
-endCollapsible
KBHFxa~~terminus
KBHFe~~terminus
}}
|}
* Both replacement and replaced rows must be as wide as the widest non-collapsible row in the diagram.
* If you want to hide the replaced row after expanding the collapsible, use icon {{bsq|leer}} as empty filler as in example 4.2.
* In any case, mind to provide a sufficient text-width. Here, using text-width=120 would break the alignment of the icons.
* Collapsible elements are intentionally disabled in mobile view, so the replaced row will never be visible. Keep this in mind while creating a diagram.
=== Dual text sidebar ===
For larger and more complicated diagrams, it often helps to have a text sidebar on the left as well as the right.
{{pre|{{blue|<var>{{color|#252525|left-left remark}}</var>~~<var>{{color|#252525|left remark}}</var>~~<var>{{color|#252525|left main text}}</var>~~<var>{{color|#252525|left dist./time}}</var>! !<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|right dist./time}}</var>~~<var>{{color|#252525|right main text}}</var>~~<var>{{color|#252525|right remark}}</var>~~<var>{{color|#252525|right-right remark}}</var>}}}}
or
{{pre|{{blue|<var>{{color|#252525|left main text}}</var>! !<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|right main text}}</var>}}}}
{|
|<pre><nowiki>{{Routemap
|title=Example 5
|map=
~~km! !~~km~~
commuter terminus~~0! !uKBHFa\\KBHFa~~0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~ ~~ ~~bridge
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2! !uKBHFe\\KBHFe~~2~~regional terminus
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|width=300px
|title=Example 5
|text-width=
|map=
~~km! !~~km~~
commuter terminus~~0! !uKBHFa\\KBHFa~~0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~ ~~ ~~bridge
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2! !uKBHFe\\KBHFe~~2~~regional terminus
}}
|}
* Left text cells require "exclamation mark-space-exclamation mark" (<code>! !</code>) separating them from icon cells.
* If there is no "tilde-tilde" (<code>~~</code>) separator to the left of "exclamation mark-space-exclamation mark", the text to the left of the separator will be displayed in the '''left main text''' cell.
==== Dual text sidebar collapsible ====
{|class="wikitable"
|-
! Code !! Result
|-
|
{{demo|<nowiki>{{Routemap
|title=Example 6.1: All text cells applied
|text-width=,130,,,110,
|map=
~~km! !\\~~km~~
-startCollapsible
commuter terminus~~0{{0|00}}! !uKBHFa\leer\KBHFa~~{{0|00}}0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~~~ ~~bridge
-endCollapsible
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2{{0|00}}! !uKBHFe\\KBHFe~~{{0|00}}2~~regional terminus
}}</nowiki>
|br=<td>
}}
</td>
|-
|
{{demo|<nowiki>{{Routemap
|title=Example 6.2: Only main text cell applied
|style=width:380px
|text-width=,120,,,120,
|map=
-startCollapsible
commuter terminus! !uKBHFa\\KBHFa~~regional terminus
River Boris! !uhKRZWae\WASSERq\hKRZWae~~bridge
-endCollapsible
station! !uINT\LDER\LSTR
commuter terminus! !uKBHFe\\KBHFe~~regional terminus
}}</nowiki>
|br=<td>
}}
</td>
|}
* Apply {{para|text-width}} to eliminate the break:
** Only 1 value: <code>'''right main text+right remark'''</code>
** 3 values, separated by commas: <code>'''right dist./time''','''right main text+right remark''','''right-right remark'''</code>
** 6 values: <code>'''Left-left remark''','''left remark+left main text''','''left dist./time''','''right dist./time''','''right main text+right remark''','''right-right remark'''</code>
** If the number of values is not equal to 1, 3 or 6, the entire parameter will be ignored.
* If the text width of '''right-right remark''' is smaller than needed, its width definition can be omitted, as in example 6.1.
* If a specific text cell is not used anywhere on the map, that width definition can be omitted, as in example 6.2.
* Define the general table width with the {{param|style}} parameter if {{param|text-width}} alone cannot prevent a break.
* If the empty icon cell of the collapsible row is being squashed, use empty icon {{bsq|leer}} to correct the icon columns.
=== Syntax overview ===
{| class="wikitable"
! Syntax !! Purpose
|-
| <code>\</code> || Icon separator
|-
| <code>!~</code> || Icon overlay
|-
| <code>!@</code> || Icon link
|-
| <code>!_</code> || Precedes icon stack formatting parameters
|-
| <code>__</code> || Precedes icon formatting parameters
|-
| <code>~~</code> || Text separator
|-
| <code>! !</code> || Separator between icons and left-column text
|-
| <code><var>key</var>=<var>value</var>,<var>...</var></code> || Formatting parameters
|-
| <code>-startCollapsible</code> || Start of collapsing section<!-- (collapsed on page load)
|-
| <code>-startCollapsible- -</code> || Start of collapsing section (expanded on page load)
|-
| <code>-startCollapsible--replace</code> || Start of collapsing section (collapsed on page load; first row hidden upon expanding)
|-
| <code>-startCollapsible- -replace</code> || Start of collapsing section (expanded on page load; first row hidden upon expanding)-->
|-
| <code>-endCollapsible</code> || End of collapsing section
|-
| <code>-colspan</code> || Start of non-diagram table cell
|-
| <code>-colspan-end</code> || End of non-diagram table cell
|-
| <code>-colspan-<var>n</var></code> || Start of non-diagram table cell; next <var>n</var> lines of code are in that cell (<var>n</var> can be any positive whole number)
|}
==Transition from legacy BS row template to Routemap markup==
===Conversion policies===
Many contributors of the English Route Diagram Template project during the implementation of Routemap have conflicting opinions about the justification of replacing all maps of legacy BS row templates by the Lua-based Routemap. Opponents deem the map markups of Routemap to be too esoteric for editors unfamiliar with Routemap markup to modify. While proponents support a complete conversion for better performance. There is no consensus reached at the moment so any transition without massively updating the map appearance for reflecting service and/or structural change in reality should only be done with the following considerations:
*The map of the legacy BS row template design has exceeded [[Wikipedia:Template limits|template size limit]] in the transcluding page, which means the template does not expand into its intended appearance but only the link to the template page is shown, so there is an imminent need to translate the map into Routemap design to reduce post-expand include size.
*If there is no template size issue, respect the preference of the initial contributor of the first completed version of the diagram. If that contributor contests the change to Routemap, retain the BS row template design.
===Technical options===
All [[:Category:Route diagram templates|BS row templates]] have had substitutable counterparts created; hence conversion can be easily done by prepending <code>subst:</code> and appending <code>/safesubst</code> to every BS row template name in the map. For example, change <code><nowiki>{{BS2|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code> in the map to <code><nowiki>{{subst:BS2/safesubst|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code>, then publish changes; it will produce <code><nowiki>STR!~uSTRq\BHF~~0~~1~~2~~3</nowiki></code>. The process can be sped up by using the "replace all" function of advanced edit tool or separate text editor such as [[Microsoft Notepad|Notepad]] or [[Notepad++]], but the search rule for the BS row templates should ideally be a [[regular expression]], like <code>\{\{(BS\d*(\-2)?)\{{!}}</code> → <code>{{((}}subst:$1/safesubst{{!}}</code>, in order to avoid templates with similar names such as BSto and BSsplit in case they are present in the map.
"Column mode editing" can avoid the trouble of find and replace to add <code>safesubst:</code> on all rows efficiently. This function is common in advanced text editors like [[Geany]],<sup>[https://www.geany.org/manual/current/index.html#column-mode-editing-rectangular-selections]</sup> Notepad++<sup>[https://notepad-plus-plus.org/features/column-mode-editing.html]</sup> and [[Sublime Text]]<sup>[https://www.sublimetext.com/docs/2/column_selection.html]</sup>.
You can also use the "convertbs" function of Module:Routemap.
====Function convertbs====
Copy and paste the following code to any edit area of this wiki, maybe the map page you are working on:
<pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki>
</nowiki></nowiki><nowiki>}}</nowiki></pre>
Then copy and paste the original BS-map or BS-table map code between the <code><nowiki><nowiki></nowiki></code> tags (alternatively paste the invoke convertbs header before the original map code and the <code></nowiki>}}</code> ending after the map code) and '''show preview'''. It will generate the safesubst version and show the original versions (for comparison) of the map code. You copy the safesubst code from the preview area back to the edit area, and you should remove everything of <code>#invoke:Routemap|convertbs</code> if the preview of the new code works properly.
On the English Wikipedia, the template {{tls|convertbs}} can be used as a shortcut:
<pre><nowiki>{{subst:convertbs|1=
}}</nowiki></pre>
If it doesn't work, it's possible that you haven't copied some of the relevant code, such as table markup for BS-table diagrams, or that you've copied code which actually belongs to something else.
{|class="wikitable mw-collapsible mw-collapsed" style="min-width:75%"
!Example
|-
|<pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki>
{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
</nowiki></nowiki><nowiki>}}</nowiki></pre>
|-
!Result
|-
|{{#invoke:Routemap|convertbs|<nowiki>
{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
</nowiki>}}
|-
!Copy safe substitution markup for actual usage
|-
|{{ {{PAGENAMETDOC}}
|title=Demonstration
|map=
KBHFa~~0 km~~A station~~Shuttle bus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~{{BSsplit|Suburb|Capital}}
KINTe~~10 km~~B station~~City hub
-colspan-2
----
Not to scale
}}
|}
== Embedding into infobox ==
* Use {{{inline}}} to remove title bar and table border. If creating a separate template which will be embedded into an infobox, wrap inline=1 in {{tag|includeonly|p}} tags. Also {{{navbar pos}}} is helpful to locate the {{tl|Navbar}} better.
{|
|style="vertical-align:top;"|<pre><nowiki>{{Infobox station
| name = {{color box|orange}} Station layout
| image = Placeholder.png
| image_upright = 0.5
| image_caption = Platform level
| opened = {{Start date|1935|05|15|df=y}}
| tracks = 2
| route_map =
{{routemap|inline=1|navbar=asd|navbar pos=2|
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
}}</nowiki></pre>
|style="vertical-align:top;"|{{Infobox station
| name = {{color box|orange}} Station layout
| image = Placeholder.png
| image_upright = 0.5
| image_caption = Platform level
| opened = {{Start date|1935|05|15|df=y}}
| tracks = 2
| route_map =
{{ {{PAGENAMETDOC}}|inline=1|navbar=asd|navbar pos=2|
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
}}
|}
== Template data ==
{{TemplateData header}}
<templatedata>
{
"description": "Template for displaying diagram composed of icon images and text labels in uniform style.",
"params": {
"inline": {
"label": "Inline state",
"type": "string",
"required": false,
"description": "Remove title bar and border for transclusion in infobox"
},
"title": {
"label": "Table title",
"type": "string",
"required": false,
"description": "Official title of the system. Value «no» will remove the table title row, but this will also disable the table collapsible switch as well"
},
"title color": {
"label": "Title font color",
"type": "string",
"required": false,
"default": "#FFF or #252525; depends",
"description": "Color of the title's text; automatically black or white to contrast with the title background color. Only use colors that contrast well with the background color",
"aliases": [
"title-color"
]
},
"title bg color": {
"label": "Title background color",
"type": "string",
"required": false,
"default": "#27404E",
"description": "Background color of the title",
"aliases": [
"title-bg"
]
},
"collapsible": {
"label": "Collapsibility",
"type": "string",
"required": false,
"description": "Whether the whole infobox is collapsible or not"
},
"collapse": {
"label": "Collapsing state",
"type": "string",
"required": false,
"description": "Collapsing state. Shown by default. Any value will make the table collapse by default",
"aliases": [
"collapsed"
]
},
"navbar": {
"label": "Template name for Navbar",
"type": "string",
"required": false,
"description": "This must exactly match the diagram template page name so the Navbar template will appear and link to the template page"
},
"navbar pos": {
"label": "Position of the Navbar",
"type": "string",
"required": false,
"description": "Position of the Navbar template. Float to left in the title bar by default; «1» for top-right corner of the map (just under the title bar); «2» for the middle bottom of the map"
},
"legend": {
"label": "Legend appearance",
"type": "wiki-page-name",
"required": false,
"default": "Template:Railway line legend",
"description": "Alias of the legend link. It can be «bus», «canal», «footpath» or «track». «0» or «no» for no legend at all"
},
"legend alt": {
"label": "Legend link text",
"type": "string",
"required": false,
"default": "Legend",
"description": "Different link name in place of «Legend» if desirable"
},
"float": {
"label": "Floating state",
"type": "string",
"required": false,
"default": "right",
"description": "Floating state of the whole box: «right» by default; optionally «left» or «none»"
},
"bg": {
"label": "Background color",
"type": "string",
"required": false,
"default": "#F9F9F9",
"description": "Background color of the whole map area"
},
"style": {
"label": "CSS style values",
"type": "string",
"required": false,
"description": "Additional CSS style definition of the whole infobox"
},
"top": {
"label": "Top note",
"type": "string",
"required": false,
"description": "Space for optional note or infobox above the map",
"aliases": [
"on top"
]
},
"footnote": {
"label": "Bottom note",
"type": "string",
"required": false,
"description": "Space for optional note or infobox below the map",
"aliases": [
"bottom"
]
},
"text-width": {
"label": "Width of map text cell",
"type": "string",
"required": false,
"description": "Extend the width of the map text cell so the collapsible section within the map does not break",
"aliases": [
"tw"
]
},
"map": {
"label": "Map markups",
"description": "Map data which uses specific markup/separators to load icon image and arrange the text in the uniform style",
"required": true,
"type": "string",
"aliases": [
"1"
]
},
"navbar mini": {
"label": "Small navbar",
"description": "If the navbar is not in default position, then this changes whether the navbar displays as \"V · T · E\" (default for navbar pos 1; values: «1», «y», «yes», «true») or \"This diagram: view · talk · edit\" (default for navbar pos 2; values: «0», «n», «no», «false»).",
"type": "string"
}
},
"format": "block",
"paramOrder": [
"inline",
"title",
"title color",
"title bg color",
"collapsible",
"collapse",
"navbar",
"navbar pos",
"navbar mini",
"legend",
"legend alt",
"float",
"bg",
"style",
"top",
"footnote",
"text-width",
"map"
]
}
</templatedata>
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Route diagram templates]]
}}</includeonly>
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{High-use}}
{{Lua sidebar}}
{{Lua|Module:Routemap}}
{{Uses TemplateStyles|Template:Routemap/styles.css}}
This [[Wikipedia:Lua|Lua]]-based template replaces the older parser-function-based {{tl|BS-map}} (and deprecated {{tl|Railway line header}}, {{tl|BS-header}} and {{tl|BS-table}}) templates for [[Wikipedia:Route diagram template]]s because diagrams created by {{Routemap}} load faster.
== Usage ==
{{Parameter names example | _template={{PAGENAMETDOC}}
| title = {{(((}}title{{)))}} | navbar={{PAGENAMETDOC}} | legend alt | top | footnote
| map =
HUBrg-R\HUBq-L\HUBq-L\HUBlg-L
HUB-R!~s*{{(((}}map{{)))}}__fontsize=cmt\\\HUB-L
HUBlf-R\HUBq-R\HUBq-R\HUBrf-L
}}
<pre style="overflow:auto;">
{{Routemap
|navbar =
|navbar pos =
|navbar mini =
|title =
|title color =
|title bg =
|bg =
|inline =
|collapsible =
|collapse =
|legend =
|legend alt =
|float =
|style =
|top =
|footnote =
|text-width =
|map =
}}
</pre>
== Markup for map parameter ==
{{for|a tabulated list of many of the pictograms available for railway routemaps|commons:BSicon/Catalogue}}
{{hatnote|If you've already read this section, you may want to skip to [[#Syntax overview|§ Syntax overview]].}}
The markup for composing the diagram in the {{para|map}} parameter is different to the {{tl|BSrow}}-based templates. The major differences are the separators in each row. Subtemplates are not necessary, since a new row in the table is simply created by a [[carriage return]] (newline).
{{pre|{{blue|1={{Routemap
<var style="font-family:sans-serif;color:#252525"><small>Add other parameters like {{para|title}} here.</small></var>
|map=
<var style="font-family:sans-serif;color:#252525"><small>Map markup goes here!</small></var>
}}}}}}
=== Basic ===
{{Routemap|title=Example 1.1|legend=0|collapsible=0|map=
exCONTg~~ ~~ ~~{{mono|exCONTg}}
ENDExa~~ ~~ ~~{{mono|ENDExa}}
CONTgq\KRZu\CONTfq~~ ~~ ~~{{mono|CONTgq{{blue|\}}KRZu{{blue|\}}CONTfq}}
BHF~~ ~~ ~~{{mono|BHF}}
\ABZgl\CONTfq~~ ~~ ~~{{mono|{{blue|\}}ABZgl{{blue|\}}CONTfq}}
CONTf~~ ~~ ~~{{mono|CONTf}}
}}
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>}}}}
* Icons are separated by the [[backslash]] <code>\</code>.
* Each group of icons is centered in its row. The nameless icon (at the start of row 5 in the diagram) can be used as a spacer.
* The ID of each icon can be seen in its [[tooltip]]. Move your cursor over the icons to see them.
==== Sidebar text ====
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|dist./time}}</var>~~<var>{{color|#252525|main text}}</var>~~<var>{{color|#252525|remark}}</var>~~<var>{{color|#252525|right remark}}</var>}}}}
or
{{pre|{{blue|<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>\<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|main text}}</var>}}}}
{|
|<pre><nowiki>{{Routemap
|title=Example 1.2
|map=
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 1.2
|map=
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
|}
* The third and fourth pairs of tildes can be omitted if there is no content following either of them.
* After the last icon ID, if there is only one set of "[[tilde]]-tilde" (<code>~~</code>), the following text will be displayed in the '''main text''' cell instead of '''dist./time'''.
* Separating text cells requires at least one empty space; otherwise the tildes will be treated as a [[Wikipedia:signature|signature]].
==== Text cells in icon rows ====
{{pre|{{blue|*<var>{{color|#252525|text}}</var>\d*<var>{{color|#252525|text}}</var>\cd*<var>{{color|#252525|text}}</var>~~<var>{{color|#252525|main text}}</var>}}}}
{|
|<syntaxhighlight lang="moin">{{Routemap
|title=Example 1.3
|map=
ENDEa~~ ~~ ~~Reversing siding
SPLa
cBS\vSTR\cBS~~Station
d*1\cBS\vSTR\cBS\d*2~~ ~~ ~~Platform numbers
cBS\vSTR\cBS
vCONTfge~~ ~~ ~~''to City''
}}</syntaxhighlight>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 1.3
|map=
ENDEa~~ ~~ ~~Reversing siding
SPLa
cBS\vSTR\cBS~~Station
d*1\cBS\vSTR\cBS\d*2~~ ~~ ~~Platform numbers
cBS\vSTR\cBS
vCONTfge~~ ~~ ~~''to City''
}}
|}
The asterisk indicating a text cell can be preceded by one of the BSicons' width prefixes. (Normal BSicons are square.)
{| class="wikitable" style="text-align:center;"
|-
!scope="row" style="text-align:right;"| Letters
| <code>o</code> || <code>c</code> || <code>d</code> || <code>cd</code> || {{CNone|''none''}} || <code>b</code> || <code>s</code> || <code>bs</code> || <code>w</code>
|-
!scope="row" style="text-align:right;"| Width
| {{frac|1|8}} || {{frac|1|4}} || {{frac|1|2}} || {{frac|3|4}} || '''1''' || 2 || 4 || 6 || 8
|}
=== Icon overlay, icon link, background color and colspan ===
{|
|<syntaxhighlight lang="moin">{{Routemap
|title=Example 2.1
|map=
-colspan-1
Icon overlay
uSTRq!~STR2!~BHF!~lHUB\\dSTR!~uSTRq\dSTR!~dNULf
-colspan-2-style=border-bottom:5px solid red;
----
icon link
utBHF!@Superhub
-colspan
----
background color
-colspan-end
utSTR~~ ~~ ~~ ~~ ~~bg=#7af
}}</syntaxhighlight>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 2.1
|map=
-colspan-1
Icon overlay
uSTRq!~STR2!~BHF!~lHUB\\dSTR!~uSTRq\dSTR!~dNULf
-colspan-2-style=border-bottom:5px solid red;
----
icon link
utBHF!@Superhub
-colspan
----
background color
-colspan-end
utSTR~~ ~~ ~~ ~~ ~~bg=#7af
}}
|}
* Overlay separator "exclamation mark-tilde" (<code>!~</code>) must follow the icon ID which is to be overlaid.
* Overlay is practically unlimited, but legibility should be taken into account.
* The width of the underlying icon determines the width of the combination, even if less than the overlay. The icons are aligned with their left edges together, so that they will not be centered on each other if they differ in width. If the overlay extends past the underlying icon, it will overlay the following icon (but not the following icon's overlay).
* When using icon overlay and icon link for the same icon cell, the icon link separator (<code>!@</code>) must follow the last (top) overlaying icon ID.
* The background color parameter (<code>bg=</code>) requires 5 sets of preceding text separators to be recognizable even if there is no text on that row whatsoever.
=== Other formatting options ===
==== Rows ====
{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 2.2
|map=
utSTR~~ ~~ ~~{{mono|1=bg=<abbr title="This is the normal BSicon color for watercourses.">#007CC3</abbr>}}~~ ~~bg=#007CC3
*1\*2\*3~~ ~~ ~~{{mono|1=color=red,bold=yes}}~~ ~~color=red,bold=yes
*A\*C\*E~~ ~~ ~~{{mono|1=align=l,b=1,fontsize=cmt}}~~ ~~align=left,b=1,fontsize=cmt
*B\*D\*F~~ ~~ ~~{{mono|1=colour=orange, align=b, i=y}}~~ ~~colour=orange, align=b, i=y
}}
Aside from <code>bg=</code>, there are several other parameters, separated by commas (<code>,</code>), which can be used to customize the display of a row. Only <code>bg=</code> can be used to change the display of icons; all others only affect text cells.
{| class="wikitable mw-collapsible mw-collapsed" style="font-size:small; min-width:75%"
! colspan="3" |Row parameters
|-
!Parameter name
!Values
!Result
|-
|<code>bg=</code>, <code>background=</code> ''or'' <code>bgcolor=</code>
|Any [[X11 color names|X11 color name]], [[RGB hex triplet]] or other valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/background background] property
|Row background is colored
|-
|<code>color=</code> ''or'' <code>colour=</code>
|Any [[X11 color names|X11 color name]] or [[RGB hex triplet]]
|Text cells in a row are colored
|-
|<code>b=</code> ''or'' <code>bold=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
|Text cells in a row are '''emboldened'''
|-
|<code>i=</code>, <code>it=</code> ''or'' <code>italic=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
|Text cells in a row are ''italicized''
|-
| rowspan="9" |<code>align=</code>
|No or invalid value
|Text in cells is centered horizontally and vertically
|-
|<code>l</code> ''or'' <code>left</code>
|Text in cells is aligned to the left
|-
|<code>r</code> ''or'' <code>right</code>
|Text in cells is aligned to the right
|-
|<code>a</code>, <code>t</code> ''or'' <code>top</code>
|Text in cells is aligned to the top
|-
|<code>e</code>, <code>b</code> ''or'' <code>bottom</code>
|Text in cells is aligned to the bottom
|-
|<code>la</code>, <code>tl</code>, <code>c4</code>, <code>nw</code>, <code>top-left</code> ''or'' <code>topleft</code>
|Text in cells is aligned to the top-left corner
|-
|<code>ra</code>, <code>tr</code>, <code>c1</code>, <code>ne</code>, <code>top-right</code> ''or'' <code>topright</code>
|Text in cells is aligned to the top-right corner
|-
|<code>le</code>, <code>bl</code>, <code>c3</code>, <code>sw</code>, <code>bottom-left</code> ''or'' <code>bottomleft</code>
|Text in cells is aligned to the bottom-left corner
|-
|<code>re</code>, <code>br</code>, <code>c2</code>, <code>se</code>, <code>bottom-right</code> ''or'' <code>bottomright</code>
|Text in cells is aligned to the bottom-right corner
|-
| rowspan="4" |<code>fontsize=</code>
|No value
|Text in cells is <code>10px</code> high and is transformed to be narrower <span style="font-size:10px;transform:scaleX(.9)">(example)</span>
|-
|<code>info</code> ''or'' <code>main</code>
|Text in cells is the same size as the large sidebar text (second column from center)
|-
|<code>cmt</code> ''or'' <code>comment</code>
|Text in cells is the same size as the <span style="font-size:90%">small sidebar text</span> (other columns)
|-
|Any valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/font-size font-size] property
|Text in cells is a different size (percentages are relative to the large sidebar text)
|}
==== Individual cells/icons ====
{{pre|{{blue|1=<var>{{color|#252525|icon}}</var>!_bg=<span style="background:purple;border-radius:0.15em;color:white">purple</span>\*<var>{{color|#252525|text}}</var>__align=l!~*<var>{{color|#252525|more text}}</var>__align=r,b='''yes'''}}}}
* Parameters for ''a single icon or text cell'' (e.g. <code>BHF</code>, <code>*Text</code>) are preceded by two underscores (<code>__</code>).
* Parameters for ''the contents of a table cell'' (a stack of overlaid objects, or a single icon or text box with no overlays) are preceded by an exclamation mark and an [[underscore]] (<code>!_</code>). This must follow the link (if any).
* For the last overlaid item in a stack, the individual item parameters (if any) must precede the stack parameters.
* Most of the parameters are the same as those for rows, but there are a few additional ones. Additionally, the values for <code>align=</code>, <code>bg=</code> and <code>color=</code> will override the row parameter values.
{| class="wikitable mw-collapsible mw-collapsed" style="font-size:small; min-width:75%"
! colspan="5" |Icon, text box and overlay stack parameters
|-
!Parameter name
!Values
! colspan="3" |Result
|-
|<code>bg=</code>, <code>background=</code> ''or'' <code>bgcolor=</code>
|Any [[X11 color names|X11 color name]], [[RGB hex triplet]] or other valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/background background] property
| colspan="3" |Background is colored<br/>''This should not be used with overlays above icons.''
|-
|<code>color=</code> ''or'' <code>colour=</code>
|Any [[X11 color names|X11 color name]] or [[RGB hex triplet]]
| colspan="3" |All the text of a cell, or the text of an individual text box, is colored
|-
|<code>b=</code> ''or'' <code>bold=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
| colspan="3" |'''Boldfaced''' text
|-
|<code>i=</code>, <code>it=</code> ''or'' <code>italic=</code>
|<code>1</code>, <code>yes</code>, <code>y</code> ''or'' <code>true</code>
| colspan="3" |''Italicized'' text
|-
| rowspan="16" |<code>align=</code>
|No or invalid value
| colspan="3" |Text is aligned per parameters of its parent (default: centered vertically and horizontally)
|-
|<code>l</code> ''or'' <code>left</code>
| rowspan="15" |Text is aligned to… (vertical / horizontal)<br/>''"Inherit" indicates that the cell will inherit its parent's value for that axis.''
|''inherit''
|left
|-
|<code>r</code> ''or'' <code>right</code>
|''inherit''
|right
|-
|<code>a</code>, <code>t</code> ''or'' <code>top</code>
|top
|''inherit''
|-
|<code>e</code>, <code>b</code> ''or'' <code>bottom</code>
|bottom
|''inherit''
|-
|<code>la</code>, <code>tl</code>, <code>c4</code>, <code>nw</code>, <code>top-left</code> ''or'' <code>topleft</code>
|top
|left
|-
|<code>ra</code>, <code>tr</code>, <code>c1</code>, <code>ne</code>, <code>top-right</code> ''or'' <code>topright</code>
|top
|right
|-
|<code>le</code>, <code>bl</code>, <code>c3</code>, <code>sw</code>, <code>bottom-left</code> ''or'' <code>bottomleft</code>
|bottom
|left
|-
|<code>re</code>, <code>br</code>, <code>c2</code>, <code>se</code>, <code>bottom-right</code> ''or'' <code>bottomright</code>
|bottom
|right
|-
|<code>c</code>, <code>center</code> ''or'' <code>centre</code>
|''inherit''
|center
|-
|<code>m</code> ''or'' <code>middle</code>
|middle
|''inherit''
|-
|<code>ma</code>, <code>tc</code>, <code>top-center</code>, <code>top-centre</code>, <code>topcenter</code> ''or'' <code>topcentre</code>
|top
|center
|-
|<code>me</code>, <code>bc</code>, <code>bottom-center</code>, <code>bottom-centre</code>, <code>bottomcenter</code> ''or'' <code>bottomcentre</code>
|bottom
|center
|-
|<code>lm</code>, <code>ml</code>, <code>middle-left</code> ''or'' <code>middleleft</code>
|middle
|left
|-
|<code>rm</code>, <code>mr</code>, <code>middle-right</code> ''or'' <code>middleright</code>
|middle
|right
|-
|<code>cm</code>, <code>mc</code>, <code>middle-center</code>, <code>middle-centre</code>, <code>middlecenter</code> ''or'' <code>middlecentre</code>
|middle
|center
|-
| rowspan="4" |<code>fontsize=</code>
|No value
| colspan="3" |Text is <code>10px</code> high and is transformed to be narrower <span style="font-size:10px;transform:scaleX(.9)">(example)</span>
|-
|<code>info</code> ''or'' <code>main</code>
| colspan="3" |Text is the same size as the large sidebar text (second column from center)
|-
|<code>cmt</code> ''or'' <code>comment</code>
| colspan="3" |Text is the same size as the <span style="font-size:90%">small sidebar text</span> (other columns)
|-
|Any valid values of the CSS [https://developer.mozilla.org/en-US/docs/Web/CSS/font-size font-size] property
| colspan="3" |Text is a different size (percentages are relative to the large sidebar text)
|-
|<code>abbr=</code>
|Pretty much anything that doesn't mess up the MediaWiki markup
| colspan="3" |Text has dotted underline and a tooltip containing the text after <code>abbr=</code><br/>''This will not have any effect if used on an overlay stack.''
|}
=== Collapsible ===
{|
|<pre><nowiki>{{Routemap
|title=Example 3.1: Basic collapsible
|text-width=80
|map=
-startCollapsible-collapsed
\KBHFa\~~terminus
hSTRa@g
WASSERq\hKRZW\WASSERq~~ ~~ ~~ ~~bridge
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 3.1: Basic collapsible
|text-width=80
|map=
-startCollapsible-collapsed
\KBHFa\~~terminus
hSTRag
WASSERq\hKRZW\WASSERq~~ ~~ ~~ ~~bridge
hSTRef
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
|}
{|
|<pre><nowiki>{{Routemap
|title=Example 3.2:<br/>Mixed odd and even rows
|tw=70
|map=
-startCollapsible-collapsed
d\KBHFa\d~~terminus
hKRZWae~~ ~~ ~~bridge
-endCollapsible-
BS2+l\BS2+r~~junction
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 3.2:<br/>Mixed odd and even rows
|tw=70
|map=
-startCollapsible-collapsed
d\KBHFa\d~~terminus
hKRZWae~~ ~~ ~~bridge
-endCollapsible-
BS2+l\BS2+r~~junction
}}
|}
* Adjust {{para|text-width}} (or {{para|tw}}) parameter until there is no break.
** Unit is "px" by default, but other units such as "em" are acceptable.
** Check the map in different browser and in mobile view, and increase text-width if it breaks.
* The icon number of the first row of collapsible section must be equal to or greater than the icon number of the widest non-collapsible row.
** As in example 3.2, use half-width empty icon {{bsq|d}} as filler when you are mixing both odd and even rows in the same map.
* Changing "''collapsed''" to "''nil''" will change the default state of the collapible section to uncollapsed.
==== Collapsible replacement ====
{|
|<pre><nowiki>{{Routemap
|title=Example 4.1
|text-width=150
|map=
KBHFa~~terminus
-startCollapsible-collapsed-replace
\LSTR\~~hidden section
\hSTRa@g\
WASSERq\hKRZW\WASSERq~~ ~~ ~~viaduct
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}</nowiki></pre>
|style="vertical-align:top;"| {{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 4.1
|text-width=150
|map=
KBHFa~~terminus
-startCollapsible-collapsed-replace
\LSTR\~~hidden section
\hSTRag\
WASSERq\hKRZW\WASSERq~~ ~~ ~~viaduct
hSTRef
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
|-
|<pre><nowiki>{{Routemap
|title=Example 4.2: Empty filler
|text-width=150
|map=
-startCollapsible-collapsed-replace
exCONTg~~under construction
leer
exKBHFa~~future terminus
exBHF~~future station
-endCollapsible
KBHFxa~~terminus
KBHFe~~terminus
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|title=Example 4.2: Empty filler
|text-width=150
|map=
-startCollapsible-collapsed-replace
exCONTg~~under construction
leer
exKBHFa~~future terminus
exBHF~~future station
-endCollapsible
KBHFxa~~terminus
KBHFe~~terminus
}}
|}
* Both replacement and replaced rows must be as wide as the widest non-collapsible row in the diagram.
* If you want to hide the replaced row after expanding the collapsible, use icon {{bsq|leer}} as empty filler as in example 4.2.
* In any case, mind to provide a sufficient text-width. Here, using text-width=120 would break the alignment of the icons.
* Collapsible elements are intentionally disabled in mobile view, so the replaced row will never be visible. Keep this in mind while creating a diagram.
=== Dual text sidebar ===
For larger and more complicated diagrams, it often helps to have a text sidebar on the left as well as the right.
{{pre|{{blue|<var>{{color|#252525|left-left remark}}</var>~~<var>{{color|#252525|left remark}}</var>~~<var>{{color|#252525|left main text}}</var>~~<var>{{color|#252525|left dist./time}}</var>! !<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|right dist./time}}</var>~~<var>{{color|#252525|right main text}}</var>~~<var>{{color|#252525|right remark}}</var>~~<var>{{color|#252525|right-right remark}}</var>}}}}
or
{{pre|{{blue|<var>{{color|#252525|left main text}}</var>! !<var>{{color|#252525|icon ID}}</var>~~<var>{{color|#252525|right main text}}</var>}}}}
{|
|<pre><nowiki>{{Routemap
|title=Example 5
|map=
~~km! !~~km~~
commuter terminus~~0! !uKBHFa\\KBHFa~~0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~ ~~ ~~bridge
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2! !uKBHFe\\KBHFe~~2~~regional terminus
}}</nowiki></pre>
|style="vertical-align:top;"|{{ {{PAGENAMETDOC}}
|collapsible=0
|legend=0
|width=300px
|title=Example 5
|text-width=
|map=
~~km! !~~km~~
commuter terminus~~0! !uKBHFa\\KBHFa~~0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~ ~~ ~~bridge
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2! !uKBHFe\\KBHFe~~2~~regional terminus
}}
|}
* Left text cells require "exclamation mark-space-exclamation mark" (<code>! !</code>) separating them from icon cells.
* If there is no "tilde-tilde" (<code>~~</code>) separator to the left of "exclamation mark-space-exclamation mark", the text to the left of the separator will be displayed in the '''left main text''' cell.
==== Dual text sidebar collapsible ====
{|class="wikitable"
|-
! Code !! Result
|-
|
{{demo|<nowiki>{{Routemap
|title=Example 6.1: All text cells applied
|text-width=,130,,,110,
|map=
~~km! !\\~~km~~
-startCollapsible
commuter terminus~~0{{0|00}}! !uKBHFa\leer\KBHFa~~{{0|00}}0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~~~ ~~bridge
-endCollapsible
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2{{0|00}}! !uKBHFe\\KBHFe~~{{0|00}}2~~regional terminus
}}</nowiki>
|br=<td>
}}
</td>
|-
|
{{demo|<nowiki>{{Routemap
|title=Example 6.2: Only main text cell applied
|style=width:380px
|text-width=,120,,,120,
|map=
-startCollapsible
commuter terminus! !uKBHFa\\KBHFa~~regional terminus
River Boris! !uhKRZWae\WASSERq\hKRZWae~~bridge
-endCollapsible
station! !uINT\LDER\LSTR
commuter terminus! !uKBHFe\\KBHFe~~regional terminus
}}</nowiki>
|br=<td>
}}
</td>
|}
* Apply {{para|text-width}} to eliminate the break:
** Only 1 value: <code>'''right main text+right remark'''</code>
** 3 values, separated by commas: <code>'''right dist./time''','''right main text+right remark''','''right-right remark'''</code>
** 6 values: <code>'''Left-left remark''','''left remark+left main text''','''left dist./time''','''right dist./time''','''right main text+right remark''','''right-right remark'''</code>
** If the number of values is not equal to 1, 3 or 6, the entire parameter will be ignored.
* If the text width of '''right-right remark''' is smaller than needed, its width definition can be omitted, as in example 6.1.
* If a specific text cell is not used anywhere on the map, that width definition can be omitted, as in example 6.2.
* Define the general table width with the {{param|style}} parameter if {{param|text-width}} alone cannot prevent a break.
* If the empty icon cell of the collapsible row is being squashed, use empty icon {{bsq|leer}} to correct the icon columns.
=== Syntax overview ===
{| class="wikitable"
! Syntax !! Purpose
|-
| <code>\</code> || Icon separator
|-
| <code>!~</code> || Icon overlay
|-
| <code>!@</code> || Icon link
|-
| <code>!_</code> || Precedes icon stack formatting parameters
|-
| <code>__</code> || Precedes icon formatting parameters
|-
| <code>~~</code> || Text separator
|-
| <code>! !</code> || Separator between icons and left-column text
|-
| <code><var>key</var>=<var>value</var>,<var>...</var></code> || Formatting parameters
|-
| <code>-startCollapsible</code> || Start of collapsing section<!-- (collapsed on page load)
|-
| <code>-startCollapsible- -</code> || Start of collapsing section (expanded on page load)
|-
| <code>-startCollapsible--replace</code> || Start of collapsing section (collapsed on page load; first row hidden upon expanding)
|-
| <code>-startCollapsible- -replace</code> || Start of collapsing section (expanded on page load; first row hidden upon expanding)-->
|-
| <code>-endCollapsible</code> || End of collapsing section
|-
| <code>-colspan</code> || Start of non-diagram table cell
|-
| <code>-colspan-end</code> || End of non-diagram table cell
|-
| <code>-colspan-<var>n</var></code> || Start of non-diagram table cell; next <var>n</var> lines of code are in that cell (<var>n</var> can be any positive whole number)
|}
==Transition from legacy BS row template to Routemap markup==
===Conversion policies===
Many contributors of the English Route Diagram Template project during the implementation of Routemap have conflicting opinions about the justification of replacing all maps of legacy BS row templates by the Lua-based Routemap. Opponents deem the map markups of Routemap to be too esoteric for editors unfamiliar with Routemap markup to modify. While proponents support a complete conversion for better performance. There is no consensus reached at the moment so any transition without massively updating the map appearance for reflecting service and/or structural change in reality should only be done with the following considerations:
*The map of the legacy BS row template design has exceeded [[Wikipedia:Template limits|template size limit]] in the transcluding page, which means the template does not expand into its intended appearance but only the link to the template page is shown, so there is an imminent need to translate the map into Routemap design to reduce post-expand include size.
*If there is no template size issue, respect the preference of the initial contributor of the first completed version of the diagram. If that contributor contests the change to Routemap, retain the BS row template design.
===Technical options===
All [[:Category:Route diagram templates|BS row templates]] have had substitutable counterparts created; hence conversion can be easily done by prepending <code>subst:</code> and appending <code>/safesubst</code> to every BS row template name in the map. For example, change <code><nowiki>{{BS2|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code> in the map to <code><nowiki>{{subst:BS2/safesubst|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code>, then publish changes; it will produce <code><nowiki>STR!~uSTRq\BHF~~0~~1~~2~~3</nowiki></code>. The process can be sped up by using the "replace all" function of advanced edit tool or separate text editor such as [[Microsoft Notepad|Notepad]] or [[Notepad++]], but the search rule for the BS row templates should ideally be a [[regular expression]], like <code>\{\{(BS\d*(\-2)?)\{{!}}</code> → <code>{{((}}subst:$1/safesubst{{!}}</code>, in order to avoid templates with similar names such as BSto and BSsplit in case they are present in the map.
"Column mode editing" can avoid the trouble of find and replace to add <code>safesubst:</code> on all rows efficiently. This function is common in advanced text editors like [[Geany]],<sup>[https://www.geany.org/manual/current/index.html#column-mode-editing-rectangular-selections]</sup> Notepad++<sup>[https://notepad-plus-plus.org/features/column-mode-editing.html]</sup> and [[Sublime Text]]<sup>[https://www.sublimetext.com/docs/2/column_selection.html]</sup>.
You can also use the "convertbs" function of Module:Routemap.
====Function convertbs====
Copy and paste the following code to any edit area of this wiki, maybe the map page you are working on:
<pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki>
</nowiki></nowiki><nowiki>}}</nowiki></pre>
Then copy and paste the original BS-map or BS-table map code between the <code><nowiki><nowiki></nowiki></code> tags (alternatively paste the invoke convertbs header before the original map code and the <code></nowiki>}}</code> ending after the map code) and '''show preview'''. It will generate the safesubst version and show the original versions (for comparison) of the map code. You copy the safesubst code from the preview area back to the edit area, and you should remove everything of <code>#invoke:Routemap|convertbs</code> if the preview of the new code works properly.
On the English Wikipedia, the template {{tls|convertbs}} can be used as a shortcut:
<pre><nowiki>{{subst:convertbs|1=
}}</nowiki></pre>
If it doesn't work, it's possible that you haven't copied some of the relevant code, such as table markup for BS-table diagrams, or that you've copied code which actually belongs to something else.
{|class="wikitable mw-collapsible mw-collapsed" style="min-width:75%"
!Example
|-
|<pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki>
{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
</nowiki></nowiki><nowiki>}}</nowiki></pre>
|-
!Result
|-
|{{#invoke:Routemap|convertbs|<nowiki>
{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
</nowiki>}}
|-
!Copy safe substitution markup for actual usage
|-
|{{ {{PAGENAMETDOC}}
|title=Demonstration
|map=
KBHFa~~0 km~~A station~~Shuttle bus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~{{BSsplit|Suburb|Capital}}
KINTe~~10 km~~B station~~City hub
-colspan-2
----
Not to scale
}}
|}
== Embedding into infobox ==
* Use {{{inline}}} to remove title bar and table border. If creating a separate template which will be embedded into an infobox, wrap inline=1 in {{tag|includeonly|p}} tags. Also {{{navbar pos}}} is helpful to locate the {{tl|Navbar}} better.
{|
|style="vertical-align:top;"|<pre><nowiki>{{Infobox station
| name = {{color box|orange}} Station layout
| image = Placeholder.png
| image_upright = 0.5
| image_caption = Platform level
| opened = {{Start date|1935|05|15|df=y}}
| tracks = 2
| route_map =
{{routemap|inline=1|navbar=asd|navbar pos=2|
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
}}</nowiki></pre>
|style="vertical-align:top;"|{{Infobox station
| name = {{color box|orange}} Station layout
| image = Placeholder.png
| image_upright = 0.5
| image_caption = Platform level
| opened = {{Start date|1935|05|15|df=y}}
| tracks = 2
| route_map =
{{ {{PAGENAMETDOC}}|inline=1|navbar=asd|navbar pos=2|
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
}}
|}
== Template data ==
{{TemplateData header}}
<templatedata>
{
"description": "Template for displaying diagram composed of icon images and text labels in uniform style.",
"params": {
"inline": {
"label": "Inline state",
"type": "string",
"required": false,
"description": "Remove title bar and border for transclusion in infobox"
},
"title": {
"label": "Table title",
"type": "string",
"required": false,
"description": "Official title of the system. Value «no» will remove the table title row, but this will also disable the table collapsible switch as well"
},
"title color": {
"label": "Title font color",
"type": "string",
"required": false,
"default": "#FFF or #252525; depends",
"description": "Color of the title's text; automatically black or white to contrast with the title background color. Only use colors that contrast well with the background color",
"aliases": [
"title-color"
]
},
"title bg color": {
"label": "Title background color",
"type": "string",
"required": false,
"default": "#27404E",
"description": "Background color of the title",
"aliases": [
"title-bg"
]
},
"collapsible": {
"label": "Collapsibility",
"type": "string",
"required": false,
"description": "Whether the whole infobox is collapsible or not"
},
"collapse": {
"label": "Collapsing state",
"type": "string",
"required": false,
"description": "Collapsing state. Shown by default. Any value will make the table collapse by default",
"aliases": [
"collapsed"
]
},
"navbar": {
"label": "Template name for Navbar",
"type": "string",
"required": false,
"description": "This must exactly match the diagram template page name so the Navbar template will appear and link to the template page"
},
"navbar pos": {
"label": "Position of the Navbar",
"type": "string",
"required": false,
"description": "Position of the Navbar template. Float to left in the title bar by default; «1» for top-right corner of the map (just under the title bar); «2» for the middle bottom of the map"
},
"legend": {
"label": "Legend appearance",
"type": "wiki-page-name",
"required": false,
"default": "Template:Railway line legend",
"description": "Alias of the legend link. It can be «bus», «canal», «footpath» or «track». «0» or «no» for no legend at all"
},
"legend alt": {
"label": "Legend link text",
"type": "string",
"required": false,
"default": "Legend",
"description": "Different link name in place of «Legend» if desirable"
},
"float": {
"label": "Floating state",
"type": "string",
"required": false,
"default": "right",
"description": "Floating state of the whole box: «right» by default; optionally «left» or «none»"
},
"bg": {
"label": "Background color",
"type": "string",
"required": false,
"default": "#F9F9F9",
"description": "Background color of the whole map area"
},
"style": {
"label": "CSS style values",
"type": "string",
"required": false,
"description": "Additional CSS style definition of the whole infobox"
},
"top": {
"label": "Top note",
"type": "string",
"required": false,
"description": "Space for optional note or infobox above the map",
"aliases": [
"on top"
]
},
"footnote": {
"label": "Bottom note",
"type": "string",
"required": false,
"description": "Space for optional note or infobox below the map",
"aliases": [
"bottom"
]
},
"text-width": {
"label": "Width of map text cell",
"type": "string",
"required": false,
"description": "Extend the width of the map text cell so the collapsible section within the map does not break",
"aliases": [
"tw"
]
},
"map": {
"label": "Map markups",
"description": "Map data which uses specific markup/separators to load icon image and arrange the text in the uniform style",
"required": true,
"type": "string",
"aliases": [
"1"
]
},
"navbar mini": {
"label": "Small navbar",
"description": "If the navbar is not in default position, then this changes whether the navbar displays as \"V · T · E\" (default for navbar pos 1; values: «1», «y», «yes», «true») or \"This diagram: view · talk · edit\" (default for navbar pos 2; values: «0», «n», «no», «false»).",
"type": "string"
}
},
"format": "block",
"paramOrder": [
"inline",
"title",
"title color",
"title bg color",
"collapsible",
"collapse",
"navbar",
"navbar pos",
"navbar mini",
"legend",
"legend alt",
"float",
"bg",
"style",
"top",
"footnote",
"text-width",
"map"
]
}
</templatedata>
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Route diagram templates]]
}}</includeonly>