The official reference manual for Textile 2. Textile is the lightweight, humane web text generator included in Textpattern and many other web applications.
Textile is a lightweight, humane web text generator. It transforms simple plain text to valid XHTML. For example:
A sentence with *bold* text and "a link":http://thresholdstate.com/.
produces:
A sentence with bold text and a link.
It includes a “smart quotes” feature that transforms plain typewriter quotation marks and apostrophes (" and ') into typographically correct punctuation:
"A quotation containing 'another quotation'."
produces:
“A quotation containing ‘another quotation’.”
Textile offers benefits to authors, designers and developers.
Authors can stop worrying about difficult and technical markup syntax and get on with the job of writing text. Textile syntax often corresponds to commonly used ASCII shorthand such as *asterisks* for emphasis and (tm) for trademarks™.
Designers can use Textile’s standards-compliant XHTML output to display clean, well-formatted and typographically-rich text. Textile automatically produces valid XHTML with CSS classes for easy styling.
Developers can easily include Textile in any web application that accepts user input for display on web pages. Textile supports UTF-8 input, and produces valid XHTML. A “Restricted” mode is available for processing input from untrusted users, where invalid input and XSS attacks are a risk.
This guide describes the PHP version of Textile 2.0, as published at Threshold State. This is a direct descendent of Dean Allen’s original Textile code, as included in the Textpattern content management application. It is published and maintained as a standalone package by Alex Shiels, and included in recent Textpattern releases (4.0.4+).
There are several other versions of Textile available, including:
Other versions vary in syntax and capabilities. Not all of the syntax described in this guide will work on versions other than Textile 2.0.
Though both are written in PHP, Textile 2.0 and Textile PHP are entirely independent implementations. Textile 2.0 evolved from Dean Allen’s original code. Textile PHP was ported to PHP from Brad Choate’s Perl version. Internally it bears little resemblance to Dean’s version. Textile 2.0 is rather more compact: it’s about one-third of the code size of Textile PHP, excluding comments.
Textile markup is illustrated by example. Each example shows the original Textile input, the result as displayed in a web browser, and the raw output XHTML:
Textile input | Browser display |
<p>Raw XHTML</p> |
This reference guide is processed using Textile 2.0.0. All output examples are shown exactly as produced by Textile itself. This guide will be updated from time to time to reflect additions and changes to its syntax and output.
An online Textile preview application is maintained at http://textile.thresholdstate.com/. It uses the same version of Textile as is described in this document.
The Textile preview includes a bug reporting mechanism. If you believe you’ve found a bug in Textile, please try reproducing the problem there. If the problem does occur, follow the instructions to report it as a bug.
Regrettably, we are unable to respond to all bug reports. If you have an urgent problem or require commercial technical support, Threshold State offers priority support contracts for Textile and other web software.
Next: Paragraph text
29 April 2007, 11:49 by Alex ·
Commenting is closed for this article.
Awesome, thank you so much Alex for taking the time to do this. This is the Textile guide I’ve been waiting for.
— Robin Apr 29, 06:32 pm #
Great manual!
This is the “All you ever wanted to know about Textile but you were afraid to ask” guide!
I think I spot a typo error in the link alias explanation, in the [textile] code.
— Maniquà Apr 30, 02:26 pm #
Outstanding! This is a great guide to the new version. Just one small bug report — the canonical reference guide lacks some of the styles applied to examples in this blog post. It’s a little thing, but it really improves readability.
Thanks for the documentation. :-)
— Adam Messinger Apr 30, 03:14 pm #
Great manual!
A tiny note: when you click on Link to the latest Textile Reference, some of the formatting seems to be gone (esp. the light red & green boxes)
— Gerhard Apr 30, 11:48 pm #
Thanks for the manual! Could you also add a table of contents?
— Jon-Michael May 4, 03:14 am #
I’ve have to warn you i’ve seen quite a few links going here…
http://textile.thresholdstate.com/reference/
You may want to redirect those here until that one is ready.
— Robin May 11, 10:59 pm #
Thanks Robin – redirected.
— Alex May 12, 09:01 am #
Very timely. This is very useful, just as I am trying to learn Textpattern. Thank you.
P.S. Any chance of a PDF version? It is usable but a bit broken in Opera 9.20.
— David Hucklesby May 14, 03:16 pm #
Is it possible to make a link that opens up a new window? Any chance to add such a feature?
— Andreas Cahen May 27, 08:20 pm #