Content deleted Content added
No edit summary |
|||
Line 1:
==Usage==
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.
* <code>{{tlx|TextDir|<!--nocat{{=}}|-->direction|DirText|historic{{=}}direction|traditional{{=}}direction|modern{{=}}direction|LableText|size{{=}}?px}}</code>
<!--===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===
'''Direction''' and the named fields '''''traditional''''', '''''historic''''', or '''''modern''''', should be one of the following values:
{| class="wikitable"
!colspan="2"|Text Directions !!colspan="5"|Input codes (case insensitive) and associated graphic
|-
| '''Word:''' ||align=right| '''Line:''' || align=center| Down || align=center| Up || align=center| Left || align=center| Right || align=center| Alternate codes (matches '''*''' code)
|-
|colspan="2"| Right-to-left || '''''RL-TB'' *''' {{TextDir|RTL|none}} || '''''RL-BT''''' {{TextDir|RL-BT|none}}|| align=center| – || align=center| – || align=center| '''''RTL''''', '''''R2L''''', '''''right-to-left''''', or '''''leftwards'''''
|-
|colspan="2"| Left-to-right || '''''LR-TB'' *''' {{TextDir|LTR|none}} || '''''LR-BT''''' {{TextDir|LR-BT|none}}|| align=center| – || align=center| – || align=center| '''''LTR''''', '''''L2R''''', '''''left-to-right''''', or '''''rightwards'''''
|-
|colspan="2"| Top-to-bottom || align=center| – || align=center| – || '''''TB-RL'' *''' {{TextDir|TB-RL|none}} || '''''TB-LR''''' {{TextDir|TB-LR|none}} || align=center| '''''Vertical'''''
|-
|colspan="2"| Bottom-to-top || align=center| – || align=center| – || '''''BT-RL''''' {{TextDir|BT-RL|none}} || '''''BT-LR''''' {{TextDir|BT-LR|none}} || align=center|
|-
|colspan="2"| Boustrophedon (RL,LR) || '''''RLR-TB'' *''' {{TextDir|RLR-TB|none}} || '''''RLR-BT''''' {{TextDir|RLR-BT|none}}|| align=center| – || align=center| – || align=center| '''''Boustrophedon'''''
|-
|colspan="2"| Boustrophedon (LR,RL) || '''''LRL-TB''''' {{TextDir|LRL-TB|none}} || '''''LRL-BT''''' {{TextDir|LRL-BT|none}}|| align=center| – || align=center| – || align=center|
|-
|colspan="2"| Vertical boustrophedon (TB,BT) || align=center| – || align=center| – || '''''TBT-RL''''' {{TextDir|TBT-RL|none}}|| '''''TBT-LR''''' {{TextDir|TBT-LR|none}} || align=center|
|-
|colspan="2"| Vertical boustrophedon (BT,TB) || align=center| – || align=center| – || '''''BTB-RL''''' {{TextDir|BTB-RL|none}}|| '''''BTB-LR''''' {{TextDir|BTB-LR|none}} || align=center|
|-
|colspan="2"| Variable direction || '''''H-TB''''' {{TextDir|H-TB|none}} || '''''H-BT''''' {{TextDir|H-BT|none}}|| '''''V-RL''''' {{TextDir|V-RL|none}}|| '''''V-LR''''' {{TextDir|V-LR|none}} || align=center|
|-
!colspan="2"| !! colspan="4"| Swirls
|-
|colspan="2"| || colspan="2" align=center| Outwards || colspan="2" align=center| Inwards || align=center| Alternate codes (matches '''*''' code)
|-
|colspan="2"| Clockwise || colspan="2" align=center| '''''Ck-Out'' *''' {{TextDir|Ck-Out|none}} || colspan="2" align=center| '''''Ck-In'' *''' {{TextDir|Ck-In|none}} || align=center| '''''CW-Out''''', and '''''CW-In'''''
|-
|colspan="2"| Withershins || colspan="2" align=center| '''''WS-Out'' *''' {{TextDir|WS-Out|none}} || colspan="2" align=center| '''''WS-In'' *''' {{TextDir|WS-In|none}} || align=center| '''''AC-Out''''' or '''''CC-Out''''', and '''''AC-In''''' or '''''CC-In'''''
|-
!colspan="2"| !! colspan="5" align=center | Other codes and display
|-
|colspan="2"| Other || colspan="5"| Up-Right-Down: '''''BTRB''''' {{TextDir|BTRB|none}}
|-
|colspan="2"| Unsupported (ex. "Wave") || colspan="5"| {{TextDir|Wave|}}
|}
<nowiki>*</nowiki> Codes marked with an asterisk have alternate codes, displayed in the last column.
* Note that many of the alternate codes resolve to the most common writing directions, and may not be universally applicable (eg, not all vertical writing systems are written Top to Bottom, in lines from Right to Left).
===Values for DirText and LabelText fields===
Line 45 ⟶ 100:
* Note that only the Full and Expanded styles fully differentiate all writing directions.
===Size field===
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: {{tlx|TextDir||RLR-TB|full|size=50px}} produces {{TextDir|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: {{tlx|TextDir||RTL|full|size=0}} produces {{TextDir|RTL|full|size=0}}
===Historic, Traditional, and Modern fields===
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: {{tlx|TextDir|||traditional=BT-LR|modern=LR-TB|exp}} produces {{TextDir||traditional=BT-LR|modern=LR-TB|exp}}
==Dependent files==
The workhorse of this template is a dependent file, [[template:TextDir/main|/main]], and most alterations to the function of the template need to be made there.
|