Template:Script directionality/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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.

  • {{Script directionality|direction|historic=direction|traditional=direction|modern=direction|DirText|LableText|size=?px}}


Values for direction field

[edit source]

Direction and the named fields traditional, historic, or modern, should be one of the following values:

Text directions Input codes (case insensitive) and associated graphic
Word: Line: Down Up Left Right Alternate codes (matches * code)
Right-to-left RL-TB * File:Text direction RTLdown.svg RL-BT File:Text direction RTLup.svg RTL, R2L, right-to-left, or leftwards
Left-to-right LR-TB * File:Text direction LTRdown.svg LR-BT File:Text direction LTRup.svg LTR, L2R, left-to-right, or rightwards
Top-to-bottom TB-RL * File:Text direction TDleft.svg TB-LR File:Text direction TDright.svg Vertical
Bottom-to-top BT-RL File:Text direction BUleft.svg BT-LR File:Text direction BUright.svg
Boustrophedon (RL,LR) RLR-TB * File:Text direction BousRdown.svg RLR-BT File:Text direction BousRup.svg Boustrophedon
Boustrophedon (LR,RL) LRL-TB File:Text direction BousLdown.svg LRL-BT File:Text direction BousLup.svg
Vertical boustrophedon (TB,BT) TBT-RL File:Text direction BousTleft.svg TBT-LR File:Text direction BousTright.svg
Vertical boustrophedon (BT,TB) BTB-RL File:Text direction BousBleft.svg BTB-LR File:Text direction BousBright.svg
Variable direction H-TB File:Text direction RorLdown.svg H-BT File:Text direction RorLup.svg V-RL File:Text direction UorDleft.svg V-LR File:Text direction UorDright.svg
Swirls
Outwards Inwards Alternate codes (matches * code)
Clockwise Ck-Out * File:Text direction ClockOut.svg Ck-In * File:Text direction ClockIn.svg CW-Out, and CW-In
Withershins WS-Out * File:Text direction WitherOut.svg WS-In * File:Text direction WitherIn.svg AC-Out or CC-Out, and AC-In or CC-In
Other codes and display
Other Up-Right-Down: BTRB Error creating thumbnail:
Unsupported (ex. "Wave") ? Wave

* 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

[edit source]

DirText and LabelText can take one of the standard values or user-defined text:

Style direction DirText produces Script directionality|historic=LTR LabelText produces Script directionality|traditional=LTR LabelText produces Script directionality|modern=LTR LabelText produces
Full {{Script directionality|LTR|full}} File:Text direction LTRdown.svg Left-to-Right, down the page ||none|full Historic:File:Text direction LTRdown.svg ||none|full Traditional:File:Text direction LTRdown.svg ||none|full Modern:File:Text direction LTRdown.svg
Expanded {{Script directionality|LTR|exp}} File:Text direction LTRdown.svg Left-to-Right (down) ||none|exp Historic:File:Text direction LTRdown.svg ||none|exp Traditional:File:Text direction LTRdown.svg ||none|exp Modern:File:Text direction LTRdown.svg
Short {{Script directionality|LTR|short}} File:Text direction LTRdown.svg LTR (down) ||none|short (Hist)-File:Text direction LTRdown.svg ||none|short (Trad)-File:Text direction LTRdown.svg ||none|short (Mod)-File:Text direction LTRdown.svg
In-Line {{Script directionality|LTR|words}} File:Text direction LTRdown.svg left to right ||none|words historically,File:Text direction LTRdown.svg ||none|words traditionally,File:Text direction LTRdown.svg ||none|words modern,File:Text direction LTRdown.svg
Default {{Script directionality|LTR}} File:Text direction LTRdown.svg LTR ||none| Hist:File:Text direction LTRdown.svg ||none| Trad:File:Text direction LTRdown.svg ||none| Mod:File:Text direction LTRdown.svg
Custom {{Script directionality|LTR|Your text}} File:Text direction LTRdown.svg Your text ||none|Your text Your textFile:Text direction LTRdown.svg ||none|Your text Your textFile:Text direction LTRdown.svg ||none|Your text Your textFile:Text direction LTRdown.svg
Blank {{Script directionality|LTR|none}} File:Text direction LTRdown.svg ||none|none File:Text direction LTRdown.svg ||none|none File:Text direction LTRdown.svg ||none|none File:Text direction LTRdown.svg
Multiples {{Script directionality|RLR-TB|historic=LTR|modern=TB-LR|traditional=Ck-Out|words|words}} produces File:Text direction BousRdown.svg right-left, left-right, etc.,historically,File:Text direction LTRdown.svg left to right, traditionally,File:Text direction ClockOut.svg clockwise swirl, modern,File:Text direction TDright.svg top to bottom
  • Note that only the Full and Expanded styles fully differentiate all writing directions.

Size field

[edit source]

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: {{Script directionality|RLR-TB|full}} produces File:Text direction BousRdown.svg Boustrophedon (right-left, left-right), down the page

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: {{Script directionality|RTL|full}} produces Right-to-Left, down the page

Historic, Traditional, and Modern fields

[edit source]

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 direction field, above. A blank direction field should be included if the Values for DirText field and 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:
{{Script directionality|||traditional=BT-LR|modern=LR-TB|exp}}

produces

Trad:File:Text direction BUright.svg Bottom-Up (right), Mod:File:Text direction LTRdown.svg Left-to-Right (down)

Templates and files used

[edit source]

The workhorse of this template is a dependent file, /core, and most alterations to the function of the template need to be made there.

Images

File:Templatetools.svgTemplate Data [view] [edit] [history] [purge]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Script directionality in articles based on its TemplateData.

TemplateData for Script directionality

Template for displaying graphic and description of script directionality

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Direction1

Main script directionality

Suggested values
RTL LTR Vertical Boustrophedon
Example
RTL
Stringrequired
historichistoric

Historic script directionality

Suggested values
RTL LTR Vertical Boustrophedon
Example
RTL
Stringoptional
traditionaltraditional

Traditional script directionality

Suggested values
RTL LTR Vertical Boustrophedon
Example
RTL
Stringoptional
modernmodern

Modern script directionality

Suggested values
RTL LTR Vertical Boustrophedon
Example
RTL
Stringoptional
Dir-Text2

Text direction description

Suggested values
full exp short words none your custom text
Example
full
Stringoptional
Label Text3

Text directionality label

Suggested values
full exp short words none your custom text
Example
full
Stringoptional
Sizesize

Image size

Example
20px
Stringoptional


See also

[edit source]
c:Category:Script directionality -- has all these images