Template:Script directionality/doc: Difference between revisions

Content deleted Content added
Category:Direction-related icon templates
 
(26 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.
 
* <nowikicode>{{TextDirtlx|Script directionality|</nowiki><!--nocat{{=}}|--><nowiki>direction|DirText|historic{{=}}direction|traditional{{=}}direction|modern{{=}}direction|DirText|LableText|size{{=}}?px}}</nowikicode>
 
<!--===Automatic script direction categories and ''nocat'' field===
Line 8 ⟶ 9:
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 Directiondirection field===
 
'''Direction''', orand the named fields '''''traditional''''', '''''historic''''', or '''''modern''''', should be one of the following values:
 
{| class="wikitable"
!colspan="2"|Text Directionsdirections !!colspan="5"|Input codes (case insensitive) and associated graphic
|-
| '''Word:''' ||align style="text-align:right;" | '''Line:''' || alignstyle="text-align:center;" | Down || alignstyle="text-align:center;" | Up || alignstyle="text-align:center;" | Left || alignstyle="text-align:center;" | Right || alignstyle="text-align:center;" | Alternate codes (matches '''*''' code)
|-
|colspan="2"| Right-to-left || '''''RL-TB'' *''' {{TextDir|nocat=yesScript directionality|RTL|none|nocat=yes}} || '''''RL-BT''''' {{TextDir|nocat=yesScript directionality|RL-BT|none}}|| alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | '''''RTL''''', '''''R2L''''', '''''right-to-left''''', or '''''leftwards'''''
|-
|colspan="2"| Left-to-right || '''''LR-TB'' *''' {{TextDir|nocat=yesScript directionality|LTR|none}} || '''''LR-BT''''' {{TextDir|nocat=yesScript directionality|LR-BT|none}}|| alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | '''''LTR''''', '''''L2R''''', '''''left-to-right''''', or '''''rightwards'''''
|-
|colspan="2"| Top-to-bottom || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || '''''TB-RL'' *''' {{TextDir|nocat=yesScript directionality|TB-RL|none}} || '''''TB-LR''''' {{TextDir|nocat=yesScript directionality|TB-LR|none}} || alignstyle="text-align:center;" | '''''Vertical'''''
|-
|colspan="2"| Bottom-to-top || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || '''''BT-RL''''' {{TextDir|nocat=yesScript directionality|BT-RL|none}} || '''''BT-LR''''' {{TextDir|nocat=yesScript directionality|BT-LR|none}} || alignstyle="text-align:center;" |
|-
|colspan="2"| Boustrophedon (RL,LR) || '''''RLR-TB'' *''' {{TextDir|nocat=yesScript directionality|RLR-TB|none}} || '''''RLR-BT''''' {{TextDir|nocat=yesScript directionality|RLR-BT|none}}|| alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | '''''Boustrophedon'''''
|-
|colspan="2"| Boustrophedon (LR,RL) || '''''LRL-TB''''' {{TextDir|nocat=yesScript directionality|LRL-TB|none}} || '''''LRL-BT''''' {{TextDir|nocat=yesScript directionality|LRL-BT|none}}|| alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" |
|-
|colspan="2"| Vertical boustrophedon (TB,BT) || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || '''''TBT-RL''''' {{TextDir|nocat=yesScript directionality|TBT-RL|none}}|| '''''TBT-LR''''' {{TextDir|nocat=yesScript directionality|TBT-LR|none}} || alignstyle="text-align:center;" |
|-
|colspan="2"| Vertical boustrophedon (BT,TB) || alignstyle="text-align:center;" | &ndash; || alignstyle="text-align:center;" | &ndash; || '''''BTB-RL''''' {{TextDir|nocat=yesScript directionality|BTB-RL|none}}|| '''''BTB-LR''''' {{TextDir|nocat=yesScript directionality|BTB-LR|none}} || alignstyle="text-align:center;" |
|-
|colspan="2"| Variable direction || '''''H-TB''''' {{TextDir|nocat=yesScript directionality|H-TB|none}} || '''''H-BT''''' {{TextDir|nocat=yesScript directionality|H-BT|none}}|| '''''V-RL''''' {{TextDir|nocat=yesScript directionality|V-RL|none}}|| '''''V-LR''''' {{TextDir|nocat=yesScript directionality|V-LR|none}} || alignstyle="text-align:center;" |
|-
!colspan="2"| !! colspan="45"| Swirls
|-
|colspan="2"| || colspan="2" align=center| Outwards || colspan="2" align=center| Inwards || alignstyle="text-align:center;" | Alternate codes (matches '''*''' code)
|-
|colspan="2"| Clockwise || colspan="2" align=center| '''''Ck-Out'' *''' {{TextDir|nocat=yesScript directionality|Ck-Out|none}} || colspan="2" align=center| '''''Ck-In'' *''' {{TextDir|nocat=yesScript directionality|Ck-In|none}} || alignstyle="text-align:center;" | '''''CW-Out''''', and '''''CW-In'''''
|-
|colspan="2"| Withershins || colspan="2" align=center| '''''WS-Out'' *''' {{TextDir|nocat=yesScript directionality|WS-Out|none}} || colspan="2" align=center| '''''WS-In'' *''' {{TextDir|nocat=yesScript directionality|WS-In|none}} || alignstyle="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''''' {{TextDir|nocat=yesScript directionality|BTRB|none}}
|-
|colspan="2"| Unsupported (ex. "Wave") || colspan="5"| {{TextDir|nocat=yesScript 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 (eg,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 59 ⟶ 60:
 
{| class="wikitable"
!Style!!direction!!DirText produces!!<nowiki>TextDirScript directionality|historic=LTR</nowiki>!!LabelText produces!!<nowiki>TextDirScript directionality|traditional=LTR</nowiki>!!LabelText produces!!<nowiki>TextDirScript directionality|modern=LTR</nowiki>!!LabelText produces
|-
|Full||<nowiki>{{TextDirtlx|Script directionality|LTR|full}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|full}}
|<code><nowiki>LTR||none|full</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|full}}
|-
|Expanded||<nowiki>{{TextDirtlx|Script directionality|LTR|exp}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|exp}}
|<code><nowiki>LTR||none|exp</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|exp}}
|-
|''Short''||<nowiki>{{TextDirtlx|Script directionality|LTR|short}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|short}}
|<code><nowiki>LTR||none|short</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|short}}
|-
|''In-Line''||<nowiki>{{TextDirtlx|Script directionality|LTR|words}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|words}}
|<code><nowiki>LTR||none|words</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|words}}
|-
|''Default''||<nowiki>{{TextDirtlx|Script directionality|LTR|}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|}}
|<code><nowiki>LTR||none|</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|}}
|-
|Custom||<nowiki>{{TextDirtlx|Script directionality|LTR|Your text}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|Your text}}
|<code><nowiki>LTR||none|Your text</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|Your text}}
|-
|Blank||<nowiki>{{TextDirtlx|Script directionality|LTR|none}}</nowiki>||{{TextDir|nocat=yesScript directionality|LTR|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|nocat=yesScript directionality|historic=LTR||none|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|nocat=yesScript directionality|traditional=LTR||none|none}}
|<code><nowiki>LTR||none|none</nowiki></code>||{{TextDir|nocat=yesScript directionality|modern=LTR||none|none}}
|-
|'''Multiples'''||colspan=8|<nowiki>{{TextDirtlx|Script directionality|RLR-TB|historic{{=}}LTR|modern{{=}}TB-LR|traditional{{=}}Ck-Out|words|words}}</nowiki> produces {{TextDir|nocat=yesScript directionality|RLR-TB|historic=LTR|modern=TB-LR|traditional=Ck-Out|words|words}}
|}
 
* Note that only the Short, In-Line,Full and DefaultExpanded styles mayfully under-differentiate the possibleall writing directions.
 
===Size field===
Line 105 ⟶ 106:
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>{{TextDirtlx|Script directionality||RLR-TB|full|size=50px}}</nowiki> produces {{TextDir|nocat=yesScript 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: <nowiki>{{TextDirtlx|Script directionality||RTL|full|size=0}}</nowiki> produces {{TextDir|nocat=yesScript directionality|RTL|full|size=0}}
 
===Historic, Traditional, and Modern fields===
Line 115 ⟶ 116:
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>{{TextDirScript directionality|||traditional=BT-LR|modern=LR-TB|exp}}</nowiki></code><br />
:produces<br />
{{TextDir|nocat=yesScript directionality||traditional=BT-LR|modern=LR-TB|exp}}
 
==DependentTemplates and files used==
The workhorse of this template is a dependent file, [[template:TextDirScript directionality/maincore|/maincore]], 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>