Template:Script directionality/doc: Difference between revisions

Content deleted Content added
No edit summary
Category:Direction-related icon templates
 
(16 intermediate revisions by 7 users not shown)
Line 1:
{{Documentation subpage}}
==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|Script directionality|<!--nocat{{=}}|-->direction|historic{{=}}direction|traditional{{=}}direction|modern{{=}}direction|DirText|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:''' || style="text-align:right;" | '''Line:''' || style="text-align:center;" | Down || style="text-align:center;" | Up || style="text-align:center;" | Left || style="text-align:center;" | Right || style="text-align:center;" | Alternate codes (matches '''*''' code)
|-
|colspan="2"| Right-to-left || '''''RL-TB'' *''' {{Script directionality|RTL|none}} || '''''RL-BT''''' {{Script directionality|RL-BT|none}}|| style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || style="text-align:center;" | '''''RTL''''', '''''R2L''''', '''''right-to-left''''', or '''''leftwards'''''
|-
|colspan="2"| Left-to-right || '''''LR-TB'' *''' {{Script directionality|LTR|none}} || '''''LR-BT''''' {{Script directionality|LR-BT|none}}|| style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || style="text-align:center;" | '''''LTR''''', '''''L2R''''', '''''left-to-right''''', or '''''rightwards'''''
|-
|colspan="2"| Top-to-bottom || style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || '''''TB-RL'' *''' {{Script directionality|TB-RL|none}} || '''''TB-LR''''' {{Script directionality|TB-LR|none}} || style="text-align:center;" | '''''Vertical'''''
|-
|colspan="2"| Bottom-to-top || style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || '''''BT-RL''''' {{Script directionality|BT-RL|none}} || '''''BT-LR''''' {{Script directionality|BT-LR|none}} || style="text-align:center;" |
|-
|colspan="2"| Boustrophedon (RL,LR) || '''''RLR-TB'' *''' {{Script directionality|RLR-TB|none}} || '''''RLR-BT''''' {{Script directionality|RLR-BT|none}}|| style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || style="text-align:center;" | '''''Boustrophedon'''''
|-
|colspan="2"| Boustrophedon (LR,RL) || '''''LRL-TB''''' {{Script directionality|LRL-TB|none}} || '''''LRL-BT''''' {{Script directionality|LRL-BT|none}}|| style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || style="text-align:center;" |
|-
|colspan="2"| Vertical boustrophedon (TB,BT) || style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || '''''TBT-RL''''' {{Script directionality|TBT-RL|none}}|| '''''TBT-LR''''' {{Script directionality|TBT-LR|none}} || style="text-align:center;" |
|-
|colspan="2"| Vertical boustrophedon (BT,TB) || style="text-align:center;" | &ndash; || style="text-align:center;" | &ndash; || '''''BTB-RL''''' {{Script directionality|BTB-RL|none}}|| '''''BTB-LR''''' {{Script directionality|BTB-LR|none}} || style="text-align:center;" |
|-
|colspan="2"| Variable direction || '''''H-TB''''' {{Script directionality|H-TB|none}} || '''''H-BT''''' {{Script directionality|H-BT|none}}|| '''''V-RL''''' {{Script directionality|V-RL|none}}|| '''''V-LR''''' {{Script directionality|V-LR|none}} || style="text-align:center;" |
|-
!colspan="2"| !! colspan="5"| Swirls
|-
|colspan="2"| || colspan="2" align=center| Outwards || colspan="2" align=center| Inwards || style="text-align:center;" | Alternate codes (matches '''*''' code)
|-
|colspan="2"| Clockwise || colspan="2" align=center| '''''Ck-Out'' *''' {{Script directionality|Ck-Out|none}} || colspan="2" align=center| '''''Ck-In'' *''' {{Script directionality|Ck-In|none}} || style="text-align:center;" | '''''CW-Out''''', and '''''CW-In'''''
|-
|colspan="2"| Withershins || colspan="2" align=center| '''''WS-Out'' *''' {{Script directionality|WS-Out|none}} || colspan="2" align=center| '''''WS-In'' *''' {{Script directionality|WS-In|none}} || style="text-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''''' {{Script directionality|BTRB|none}}
|-
|colspan="2"| Unsupported (ex. "Wave") || colspan="5"| {{Script directionality|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 (e.g. not all vertical writing systems are written Top to Bottom, in lines from Right to Left).
 
===Values for DirText and LabelText fields===
 
Line 4 ⟶ 60:
 
{| class="wikitable"
!Style!!direction!!DirText produces!!<nowiki>TextDir|Script directionality|historic=LTR</nowiki>!!LabelText produces!!<nowiki>TextDir|Script directionality|traditional=LTR</nowiki>!!LabelText produces!!<nowiki>TextDir|Script directionality|modern=LTR</nowiki>!!LabelText produces
|-
|Full||{{tlx|TextDirScript directionality|LTR|full}}||{{TextDirScript directionality|LTR|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|full}}
|-
|Expanded||{{tlx|TextDirScript directionality|LTR|exp}}||{{TextDirScript directionality|LTR|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|exp}}
|-
|''Short''||{{tlx|TextDirScript directionality|LTR|short}}||{{TextDirScript directionality|LTR|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|short}}
|-
|''In-Line''||{{tlx|TextDirScript directionality|LTR|words}}||{{TextDirScript directionality|LTR|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|words}}
|-
|''Default''||{{tlx|TextDirScript directionality|LTR|}}||{{TextDirScript directionality|LTR|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|}}
|-
|Custom||{{tlx|TextDirScript directionality|LTR|Your text}}||{{TextDirScript directionality|LTR|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|Your text}}
|-
|Blank||{{tlx|TextDirScript directionality|LTR|none}}||{{TextDirScript directionality|LTR|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|Script directionality|historic=LTR||none|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|Script directionality|traditional=LTR||none|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|Script directionality|modern=LTR||none|none}}
|-
|'''Multiples'''||colspan=8|{{tlx|TextDirScript directionality|RLR-TB|historic{{=}}LTR|modern{{=}}TB-LR|traditional{{=}}Ck-Out|words|words}} produces {{TextDirScript directionality|RLR-TB|historic=LTR|modern=TB-LR|traditional=Ck-Out|words|words}}
|}
 
* 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|Script directionality||RLR-TB|full|size=50px}} produces {{Script directionality|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|Script directionality||RTL|full|size=0}} produces {{Script directionality|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:<br /><code><nowiki>{{Script directionality|||traditional=BT-LR|modern=LR-TB|exp}}</nowiki></code><br />
:produces<br />
{{Script directionality||traditional=BT-LR|modern=LR-TB|exp}}
 
==Templates and files used==
The workhorse of this template is a dependent file, [[template:Script directionality/core|/core]], and most alterations to the function of the template need to be made there.
;Images:
 
<div class="skin-invert-image">
[[File:text_direction_WitherOut.svg|30px]]
[[File:text_direction_RorLdown.svg|30px]]
[[File:text_direction_RorLup.svg|30px]]
[[File:text_direction_UorDleft.svg|30px]]
[[File:text_direction_UorDright.svg|30px]]
[[File:text_direction_WitherIn.svg|30px]]
[[File:text_direction_BUleft.svg|30px]]
[[File:text_direction_BUright.svg|30px]]
[[File:text_direction_BousBleft.svg|30px]]
[[File:text_direction_BousBright.svg|30px]]
[[File:text_direction_BousLdown.svg|30px]]
[[File:text_direction_BousLup.svg|30px]]
[[File:text_direction_BousRdown.svg|30px]]
[[File:text_direction_BousRup.svg|30px]]
[[File:text_direction_BousTleft.svg|30px]]
[[File:text_direction_BousTright.svg|30px]]
[[File:text_direction_ClockIn.svg|30px]]
[[File:text_direction_ClockOut.svg|30px]]
[[File:text_direction_LTRdown.svg|30px]]
[[File:text_direction_LTRup.svg|30px]]
[[File:text_direction_RTLdown.svg|30px]]
[[File:text_direction_RTLup.svg|30px]]
[[File:text_direction_TDleft.svg|30px]]
[[File:text_direction_TDright.svg|30px]]
[[File:text_direction_URD.svg|30px]]
</div>
 
{{TemplateData}}
 
==See also==
:[[:c:Category:Script directionality]] -- has all these images
 
<includeonly>{{Sandbox other||
<!-- Categories below this line -->
[[Category:Direction-related icon templates]]
}}</includeonly>