TxStyle · Textile Documentation

The Textile Markup Reference for Textpattern

An overview of the Textile syntax

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 <p> </p> 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:

a paragraph (default)
a block of lines of code
a quotation block
Pre-formatted text
Divisions (not implemented in PHP Textile)
h1. h2. h3. …
Headline signatures
a comment block
No textile formatting

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.

Adds 1em of padding to the left for each ‘(’ character.
Adds 1em of padding to the right for each ‘)’ character.
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.
{style rule}
A CSS style rule.
A language identifier (for a “lang” attribute).
(class) or (#id) or (class#id)
For CSS class and 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}. TxStyle is a documentation project for the Textile markup language.

Inline formatting

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

Translates into <strong>strong </strong>.
Translates into <em>emphasis </em>.
Translates into <b>bold </b>.
Translates into <i>italics </i>.
-deleted text-
Translates into <del>deleted text </del>.
+inserted text+
Translates into <ins>inserted text </ins>.
Translates into <sup>superscript </sup>.
Translates into <sub>subscript </sub>.
Translates into <cite>citation </cite>.
Translates into <span>span </span>.
Translates into <code>code </code>.

Textile processing can be omitted also inline, then the == 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. This includes:

"quotation marks"
Translate into curly “quotation marks” ( and )
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:

Trademark: (tm)
Registered: (R)
Copyright: (C)
One quarter: (1/4)
One half: (1/2)
Three quarters: (3/4)
Degree: (o)
Plus/minus: (+/-)


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

Bulleted lists:

* A bulleted
* list example

translates into:

  • A bulleted
  • list example

Numbered lists:

# A numbered
# list example

translates into:

  1. A numbered
  2. list example

Definition lists:

- A definition list item := An example definition

translates into:

A definition list item
An example definition

Other elements

In addition to this, Textile supports formatting for Tables, Footnotes, Links and Images, and other elements.


Some portions of this text have been adapted from the Textile documentation for Movable Type by Brad Choate.

Further Information
PHP Textile versions
Textile related linklists

Blank input form
Table Data Converter

Report Issues
Issues on PHP Textile (GitHub)

PHP Textile v3.6.0