Template:Script directionality/doc: Difference between revisions

Content deleted Content added
Usage: moving testing to /main documentation
Usage: added commented out documentation of the currently unimplemented ''nocat'' field, and added ''nocat=yes'' to the template calls on the documentation page.
Line 2:
The template looks for a text-direction image that matches the directionality provided in the template call. It also provides standard abbreviations or descriptions for the given directionality.
 
* <nowiki>{{TextDir||<!--nocat=|-->direction|DirText|historic=direction|traditional=direction|modern=direction|LableText|size=}}</nowiki>
 
<!--===Automatic script direction categories and ''nocat'' field===
 
The template automatically assigns script direction categories based on the input to the ''direction'', ''traditional'', ''historic'', and ''modern'' fields. This can be overridden by setting ''nocat=yes''. Any input besides ''yes'' will retain the automatic categorization.-->
 
===Values for Direction field===
Line 13 ⟶ 17:
| '''Direction''' || align=center| Down || align=center| Up || align=center| Left || align=center| Right || align=center| Alternate codes (matches '''*''' code)
|-
| Right-to-left || '''''RL-TB'' *''' {{TextDir|nocat=yes|RTL|none|nocat=yes}} || '''''RL-BT''''' {{TextDir|nocat=yes|RL-BT|none}}|| align=center| &ndash; || align=center| &ndash; || align=center| '''''RTL''''', '''''R2L''''', '''''right-to-left''''', or '''''leftwards'''''
|-
| Left-to-right || '''''LR-TB'' *''' {{TextDir|nocat=yes|LTR|none}} || '''''LR-BT''''' {{TextDir|nocat=yes|LR-BT|none}}|| align=center| &ndash; || align=center| &ndash; || align=center| '''''LTR''''', '''''L2R''''', '''''left-to-right''''', or '''''rightwards'''''
|-
| Top-to-bottom || align=center| &ndash; || align=center| &ndash; || '''''TB-RL'' *''' {{TextDir|nocat=yes|TB-RL|none}} || '''''TB-LR''''' {{TextDir|nocat=yes|TB-LR|none}} || align=center| '''''Vertical'''''
|-
| Bottom-to-top || align=center| &ndash; || align=center| &ndash; || '''''BT-RL''''' {{TextDir|nocat=yes|BT-RL|none}} || '''''BT-LR''''' {{TextDir|nocat=yes|BT-LR|none}} || align=center|
|-
| Boustrophedon (RL,LR) || '''''RLR-TB'' *''' {{TextDir|nocat=yes|RLR-TB|none}} || '''''RLR-BT''''' {{TextDir|nocat=yes|RLR-BT|none}}|| align=center| &ndash; || align=center| &ndash; || align=center| '''''Boustrophedon'''''
|-
| Boustrophedon (LR,RL) || '''''LRL-TB''''' {{TextDir|nocat=yes|LRL-TB|none}} || '''''LRL-BT''''' {{TextDir|nocat=yes|LRL-BT|none}}|| align=center| &ndash; || align=center| &ndash; || align=center|
|-
| Vertical boustrophedon (TB,BT) || align=center| &ndash; || align=center| &ndash; || '''''TBT-RL''''' {{TextDir|nocat=yes|TBT-RL|none}}|| '''''TBT-LR''''' {{TextDir|nocat=yes|TBT-LR|none}} || align=center|
|-
| Vertical boustrophedon (BT,TB) || align=center| &ndash; || align=center| &ndash; || '''''BTB-RL''''' {{TextDir|nocat=yes|BTB-RL|none}}|| '''''BTB-LR''''' {{TextDir|nocat=yes|BTB-LR|none}} || align=center|
|-
| Variable direction || '''''H-TB''''' {{TextDir|nocat=yes|H-TB|none}} || '''''H-BT''''' {{TextDir|nocat=yes|H-BT|none}}|| '''''V-RL''''' {{TextDir|nocat=yes|V-RL|none}}|| '''''V-LR''''' {{TextDir|nocat=yes|V-LR|none}} || align=center|
|-
! !! colspan="4"| Swirls
Line 35 ⟶ 39:
| || colspan="2" align=center| Outwards || colspan="2" align=center| Inwards || align=center| Alternate codes (matches '''*''' code)
|-
| Clockwise || colspan="2" align=center| '''''Ck-Out'' *''' {{TextDir|nocat=yes|Ck-Out|none}} || colspan="2" align=center| '''''Ck-In'' *''' {{TextDir|nocat=yes|Ck-In|none}} || align=center| '''''CW-Out''''', and '''''CW-In'''''
|-
| Withershins || colspan="2" align=center| '''''WS-Out'' *''' {{TextDir|nocat=yes|WS-Out|none}} || colspan="2" align=center| '''''WS-In'' *''' {{TextDir|nocat=yes|WS-In|none}} || align=center| '''''AC-Out''''' or '''''CC-Out''''', and '''''AC-In''''' or '''''CC-In'''''
|-
! !! colspan="5" align=center | Other codes and display
|-
| Other || colspan="5"| Up-Right-Down: '''''BTRB''''' {{TextDir|nocat=yes|BTRB|none}}
|-
| Unsupported (ex. "Wave") || colspan="5"| {{TextDir|nocat=yes|Wave|}}
|}
 
Line 57 ⟶ 61:
!Style!!direction!!DirText produces!!<nowiki>TextDir|historic=</nowiki>!!LabelText produces!!<nowiki>TextDir|traditional=</nowiki>!!LabelText produces!!<nowiki>TextDir|modern=</nowiki>!!LabelText produces
|-
|Full||<nowiki>{{TextDir||LTR|full}}</nowiki>||{{TextDir|nocat=yes|LTR|full}}
|<nowiki>LTR||none|full</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|full}}
|<nowiki>LTR||none|full</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|full}}
|<nowiki>LTR||none|full</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|full}}
|-
|Expanded||<nowiki>{{TextDir||LTR|exp}}</nowiki>||{{TextDir|nocat=yes|LTR|exp}}
|<nowiki>LTR||none|exp</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|exp}}
|<nowiki>LTR||none|exp</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|exp}}
|<nowiki>LTR||none|exp</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|exp}}
|-
|''Short''||<nowiki>{{TextDir||LTR|short}}</nowiki>||{{TextDir|nocat=yes|LTR|short}}
|<nowiki>LTR||none|short</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|short}}
|<nowiki>LTR||none|short</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|short}}
|<nowiki>LTR||none|short</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|short}}
|-
|''In-Line''||<nowiki>{{TextDir||LTR|words}}</nowiki>||{{TextDir|nocat=yes|LTR|words}}
|<nowiki>LTR||none|words</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|words}}
|<nowiki>LTR||none|words</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|words}}
|<nowiki>LTR||none|words</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|words}}
|-
|''Default''||<nowiki>{{TextDir||LTR|}}</nowiki>||{{TextDir|nocat=yes|LTR|}}
|<nowiki>LTR||none|</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|}}
|<nowiki>LTR||none|</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|}}
|<nowiki>LTR||none|</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|}}
|-
|Custom||<nowiki>{{TextDir||LTR|Your text}}</nowiki>||{{TextDir|nocat=yes|LTR|Your text}}
|<nowiki>LTR||none|Your text</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|Your text}}
|<nowiki>LTR||none|Your text</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|Your text}}
|<nowiki>LTR||none|Your text</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|Your text}}
|-
|Blank||<nowiki>{{TextDir||LTR|none}}</nowiki>||{{TextDir|nocat=yes|LTR|none}}
|<nowiki>LTR||none|none</nowiki>||{{TextDir|nocat=yes|historic=LTR||none|none}}
|<nowiki>LTR||none|none</nowiki>||{{TextDir|nocat=yes|traditional=LTR||none|none}}
|<nowiki>LTR||none|none</nowiki>||{{TextDir|nocat=yes|modern=LTR||none|none}}
|-
|'''Multiples'''||colspan=8|<nowiki>{{TextDir||historic=LTR|modern=TB-LR|traditional=Ck-Out|words|words}}</nowiki> produces {{TextDir|nocat=yes|historic=LTR|modern=TB-LR|traditional=Ck-Out|words|words}}
|}
 
Line 101 ⟶ 105:
The size of the graphic can be controlled using the ''size'' field. Unlike ''direction'' and ''text'', the size field must be explicitly called with "size=". Since the icons are square, the image size can be set to a one-dimensional pixel value that corresponds to both the width and height. The size parameter does not effect the "?" of undefined text directions, except size=0 (see below). The default value is size=20px, for use in running text.
 
Example: <nowiki>{{TextDir||RLR-TB|full|size=50px}}</nowiki> produces {{TextDir|nocat=yes|RLR-TB|full|size=50px}}
 
The size field can also be set to "0" (zero) or "0px" in order to render only the directional text. This will also blank the "?" of an undefined text direction.
 
Example: <nowiki>{{TextDir||RTL|full|size=0}}</nowiki> produces {{TextDir|nocat=yes|RTL|full|size=0}}
 
===Historic, Traditional, and Modern fields===
Line 111 ⟶ 115:
The fields ''historic, traditional,'' and ''modern'' can be used to generate multiple labeled directionalities in addition to a single unlabeled one. ''Historic, traditional,'' and ''modern'' take the same values as the [[#Values for Direction field|direction field, above]]. A blank direction field should be included if the [[#Values for DirText and LabelText fields|Values for DirText field]] and [[#Values for DirText and LabelText fields|Values for LabelText field]], above are used, as the first unlabeled field will not be interpreted as those fields. Unless the ''historic, traditional,'' and ''modern'' fields are defined, the third unlabeled field will not be interpreted.
 
Example: <nowiki>{{TextDir|||traditional=BT-LR|modern=LR-TB|exp}}</nowiki> produces {{TextDir|nocat=yes||traditional=BT-LR|modern=LR-TB|exp}}
 
==Dependent files==