Block formatting

Textile processes text in units of blocks of text, which are separated by a blank line. Paragraphs are the default block type, therefore

…

tags are added to plain text blocks. In order to identify special types of text blocks, a block signature is used. Block signatures are one to three characters terminated by a period, and are placed at the beginning of a text block. They include:

  • p. a paragraph (default)
  • h1. – h6. a heading from level 1 to 6
  • pre. pre-formatted text
  • bc. a block of lines of code
  • bq. a quotation block
  • ###. a comment block
  • notextile. no formatting (override Textile)

Extended blocks (with empty lines), are marked by two periods, e.g. bc.. or bq.. and are terminated with any other text block signature—usually p.—to start a normal paragraph.

Formatting modifiers

Some block signatures accept formatting modifiers, also for CSS or language specification. They include:

  • ( adds 1em of padding to the left for each ( character used
  • ) adds 1em of padding to the right for each ) character used
  • < aligns to the left (floats to left for tables if combined with the ) modifier)
  • > aligns to the right (floats to right for tables if combined with the ( modifier)
  • = aligns to center (sets left, right margins to auto for tables)
  • <> justifies text alignment
  • {style rule} a CSS style rule
  • [language] a language identifier (for a lang attribute)
  • (class) or (#id) or (class#id) for CSS class and/or id attributes

The formatting modifiers can be combined. For example in order to right align a paragraph and set it in small type you would write:

p>{font-size:0.8em}. This is the documentation for Textile markup language.

Inline formatting

Within a text block, any portion of the text can be modified by inline formatting signatures. They include:

  • *strong* translates into strong
  • _emphasis_ translates into emphasis
  • **bold** translates into bold
  • __italics__ translates into italics
  • -deleted text- translates into deleted text
  • +inserted text+ translates into inserted text
  • ^superscript^ translates into superscript
  • ~subscript~ translates into subscript
  • ??citation?? translates into citation
  • %span% translates into span
  • @code@ translates into code

Textile processing can also be omitted inline, then == signature is used to enclose the text portion to be left out. Any combination of inline formatting is permitted. For example:

_**-deleted bold emphasized text-**_

Results in: deleted bold emphasized text

Automatic conversions

Some text elements, like special characters or apostrophes, are automatically converted to their HTML or unicode equivalent. They include:

  • "quotation marks" translate into curly “quotation marks” “ and ”
  • 'Apostrophes' translate into curly ‘Apostrophes’ ‘ and ’
  • Ampersand (&) automatically escaped into &
  • Angle brackets (< or >) automatically escaped into < or >
  • A hyphen between whitespaces ( - ) translates into a short dash (–) –
  • Double hyphens ( -- ) translates into a long dash (—) —
  • The lowercase letter x translates into a dimension sign (×) when placed between numbers ×
  • Three periods (...) translates into an ellipsis character (…) …

Special symbols can be created easily by the letters in parentheses or square brackets. They include:

  • (tm) trademark: ™
  • (R) registered: ®
  • (C) copyright: ©
  • (1/4) one quarter: ¼
  • (1/2) one half: ½
  • (3/4) three quarters: ¾
  • (o) degree: °
  • (+/-) plus/minus: ±

Lists

Different kinds of lists are supported, and can be mixed together.

* A bulleted
* list example

Translates into:

  • A bulleted
  • list example
# A numbered
# list example

Translates into:

  1. A numbered
  2. list example
- A definition list item := An example definition

Translates into:

A definition list item
An example definition

Other elements

In addition to the above, Textile supports formatting for tables, footnotes, links, images and many other elements.