Textile Markup Language Documentation

GaryBluto1 pts0 comments

Textile Markup Language Documentation

Textile is a markup language (like Markdown) for formatting text in a blog or a content management system (CMS). Textile has been around since 2002, and implementations exist for many major CMS.

Try Textile (editable)

h2. Textile

* is a _shorthand syntax_ used to generate valid HTML<br>* is *easy* to read and *easy* to write<br>* can generate complex pages, including: headings, quotes, lists, tables and figures

Textile integrations are available for "a wide range of platforms":/article/.

Browser output

HTML output

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 … 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" &#8220; and &#8221;

'Apostrophes' translate into curly ‘Apostrophes’ &#8216; and &#8217;

Ampersand (&amp;) automatically escaped into &amp;

Angle brackets (&lt; or &gt;) 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. 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<br>* list example

Translates into:

A bulleted

list example

# A numbered<br># list example

Translates into:

A numbered

list example

- A definition list item := An example definition

Translates into:

A definition list item<br>An example definition

Other elements

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

Tools

Blank Textile input form

Table data converter

Report issues

Issues on PHP Textile (GitHub)

Issues on this website (GitHub)

Further information and resources

Textile in IDEs and text editors

Textile implementations in programming languages

Textile markup language support in CMS

Third-party Textile markup language tools

Social channels

Twitter

GitHub

Host details

Kindly hosted by

DigitalOcean

JavaScript is currently disabled in your browser...

text textile translates block formatting language

Related Articles