Textile · An overview of the Textile syntax

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:

p.
a paragraph (default)
bc.
a block of lines of code
bq.
a quotation block
pre.
Pre-formatted text
div.
Divisions (not implemented in PHP Textile)
h1. h2. h3. …
Headline signatures
###.
a comment block
notextile.
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.
[language]
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:

*strong*
Translates into <strong>strong </strong>.
_emphasis_
Translates into <em>emphasis </em>.
**bold**
Translates into <b>bold </b>.
__italics__
Translates into <i>italics </i>.
-deleted text-
Translates into <del>deleted text </del>.
+inserted text+
Translates into <ins>inserted text </ins>.
^superscript^
Translates into <sup>superscript </sup>.
~subscript~
Translates into <sub>subscript </sub>.
??citation??
Translates into <cite>citation </cite>.
%span%
Translates into <span>span </span>.
@code@
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” (&#8220; and &#8221;)
'Apostrophes'
Translate into curly ‘Apostrophes’ (&#8216; and &#8217;)
Ampersand (&)
Automatically escaped into &amp;
Angle brackets (< or >)
Automatically escaped into &lt; or &gt;
A hyphen between whitespaces ( - )
Translates into a short dash (–) (&#8211;)
Double hyphens ( -- )
Translates into a long dash (—) (&#8212;)
The lowercase letter x
Translates into a dimension sign (×) when placed between numbers (&#215;)
Three periods (...)
Translates into an ellipsis character (…) (&#8230;)

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: (+/-)
±

Lists

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.

Credits

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




PHP Textile v3.5.5


Donate Textpattern developers.