User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:aligner

Aligner markup

An aligner is a special single-line token which specifies the alignment of the subsequent text. It is essentially 'modal' - all text from the token onward (until another aligner is encountered) is wrapped in a <tw-align> element (or unwrapped in the case of left-alignment, as that is the default).

  • Right-alignment, resembling ==> is produced with 2 or more =s followed by a >.
  • Left-alignment, resembling <== is restored with a < followed by 2 or more =.
  • Justified alignment, resembling <==> is produced with <, 2 or more =, and a closing >.
  • Mixed alignment is 1 or more =, then ><, then 1 or more =. The ratio of quantity of left =s and right =s determines

the alignment: for instance, one = to the left and three =s to the right produces 25% left alignment.

Any amount of whitespace is permitted before or after each token, as long as it is on a single line.

Example usage:

==>
This is right-aligned
  =><=
This is centered
 <==>
This is justified
<==
This is left-aligned (undoes the above)
===><=
This has margins 3/4 left, 1/4 right
  =><=====
This has margins 1/6 left, 5/6 right.
harlowe/aligner.txt · Last modified: 2017/10/10 00:39 (external edit)