Jump to content

Template:Script directionality/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Vanisaac (talk | contribs) at 14:43, 22 December 2011 (Undid revision 467190717 by Vanisaac (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.

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


Values for Direction field

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 * RL-BT RTL, R2L, right-to-left, or leftwards
Left-to-right LR-TB * LR-BT LTR, L2R, left-to-right, or rightwards
Top-to-bottom TB-RL * TB-LR Vertical
Bottom-to-top BT-RL BT-LR
Boustrophedon (RL,LR) RLR-TB * RLR-BT Boustrophedon
Boustrophedon (LR,RL) LRL-TB LRL-BT
Vertical boustrophedon (TB,BT) TBT-RL TBT-LR
Vertical boustrophedon (BT,TB) BTB-RL BTB-LR
Variable direction H-TB H-BT V-RL V-LR
Swirls
Outwards Inwards Alternate codes (matches * code)
Clockwise Ck-Out * Ck-In * CW-Out, and CW-In
Withershins WS-Out * WS-In * AC-Out or CC-Out, and AC-In or CC-In
Other codes and display
Other Up-Right-Down: BTRB
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 (eg, not all vertical writing systems are written Top to Bottom, in lines from Right to Left).

Values for DirText and LabelText fields

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

Style direction DirText produces TextDir||historic= LabelText produces TextDir||traditional= LabelText produces TextDir||modern= LabelText produces
Full {{TextDir|LTR|full}} Left-to-Right, down the page LTR|full Hist: Left-to-Right, down the page LTR|full Trad: Left-to-Right, down the page LTR|full Mod: Left-to-Right, down the page
Expanded {{TextDir|LTR|exp}} Left-to-Right (down) LTR|exp Hist: Left-to-Right (down) LTR|exp Trad: Left-to-Right (down) LTR|exp Mod: Left-to-Right (down)
Short {{TextDir|LTR|short}} LTR (down) LTR|short Hist: LTR (down) LTR|short Trad: LTR (down) LTR|short Mod: LTR (down)
In-Line {{TextDir|LTR|words}} left to right LTR|words Hist: left to right LTR|words Trad: left to right LTR|words Mod: left to right
Default {{TextDir|LTR}} LTR LTR| Hist: LTR LTR| Trad: LTR LTR| Mod: LTR
Custom {{TextDir|LTR|Your text}} Your text LTR|Your text Hist: Your text LTR|Your text Trad: Your text LTR|Your text Mod: Your text
Blank {{TextDir|LTR|none}} LTR|none Hist: LTR|none Trad: LTR|none Mod:
Multiples {{TextDir|RLR-TB|historic=LTR|modern=TB-LR|traditional=Ck-Out|words}} produces right-left, left-right, etc.,Hist: left to right, Trad: clockwise swirl, Mod: top to bottom
  • 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: {{TextDir|RLR-TB|full}} produces 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: {{TextDir|RTL|full}} produces Right-to-Left, down the page

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 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: {{TextDir|exp}} produces Trad: Bottom-Up (right), Mod: Left-to-Right (down)

Dependent files

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