The official reference manual for Textile 2. Textile is the lightweight, humane web text generator included in Textpattern and many other web applications.
The alignment of block modifiers may be controlled with special characters.
Left alignment is specified with a < less than symbol.
p<. Left-aligned paragraph. | Left-aligned paragraph. |
<p style="text-align:left;">Left-aligned paragraph.</p> |
Right alignment is specified with a > greater than symbol.
h3>. Right-aligned heading. | Right-aligned heading. |
<h3 style="text-align:right;">Right-aligned heading.</h3> |
Use both <> symbols for justified text.
p<>. Justified paragraph. | Justified paragraph. |
<p style="text-align:justify;">Justified paragraph.</p> |
An = equals symbol represents centered text.
h3=. Centered heading. | Centered heading. |
<h3 style="text-align:center;">Centered heading.</h3> |
Use empty ( and ) parentheses to add padding to blocks, in multiples of 1 em.
p(. Left pad 1em. | Left pad 1em. |
<p style="padding-left:1em;">Left pad 1em.</p> |
p)). Right pad 2em. | Right pad 2em. |
<p style="padding-right:2em;">Right pad 2em.</p> |
p(). Left and right pad 1em. | Left and right pad 1em. |
<p style="padding-left:1em;padding-right:1em;">Left and right pad 1em.</p> |
Numeric and bulleted lists are represented by lines beginning with # or * respectively.
# Item one # Item two # Item three |
|
<ol> <li>Item one</li> <li>Item two</li> <li>Item three</li> </ol> |
* Item A * Item B * Item C |
|
<ul> <li>Item A</li> <li>Item B</li> <li>Item C</li> </ul> |
Attributes applied to the first list item will apply to the list itself.
*{color:red} Item one * Item two * Item three |
|
<ul style="color:red;"> <li>Item one</li> <li>Item two</li> <li>Item three</li> </ul> |
Use multiple # or * symbols to create nested lists.
# Item one ## Item one-A ## Item one-B ### Item one-B-a # Item two |
|
<ol> <li>Item one <ol> <li>Item one-A</li> <li>Item one-B <ol> <li>Item one-B-a</li> </ol></li> </ol></li> <li>Item two</li> </ol> |
Tables can be constructed using | “pipe” symbols to separate cells.
|a|simple|table| |
| |||
<table> <tr> <td>a</td> <td>simple</td> <td>table</td> </tr> </table> |
Use _. to indicate table heading cells.
|_. a|_. table|_. heading| |a|table|row| |
| ||||||
<table> <tr> <th>a</th> <th>table</th> <th>heading</th> </tr> <tr> <td>a</td> <td>table</td> <td>row</td> </tr> </table> |
Attributes may be applied separately to individual cells, rows, and entire tables.
Cell attributes are placed within each cell.
|a|{color:red}. styled|cell| |
| |||
<table> <tr> <td>a</td> <td style="color:red;">styled</td> <td>cell</td> </tr> </table> |
Row attributes are placed at the beginning of a row, followed by a dot and a space.
(rowclass). |a|classy|row| |
| |||
<table> <tr class="rowclass"> <td>a</td> <td>classy</td> <td>row</td> </tr> </table> |
Table attributes are specified by placing the special table. block modifier immediately before the table.
table(tableclass). |a|classy|table| |a|classy|table| |
| ||||||
<table class="tableclass"> <tr> <td>a</td> <td>classy</td> <td>table</td> </tr> <tr> <td>a</td> <td>classy</td> <td>table</td> </tr> </table> |
Special alignment symbols are available for vertical alignment within table cells.
|^. top alignment| |
| |
<table> <tr> <td style="vertical-align:top;">top alignment</td> </tr> </table> |
|-. middle alignment| |
| |
<table> <tr> <td style="vertical-align:middle;">middle alignment</td> </tr> </table> |
|~. bottom alignment| |
| |
<table> <tr> <td style="vertical-align:bottom;">bottom alignment</td> </tr> </table> |
Cells may span multiple rows or columns.
Use a \ backslash to indicate a column span.
|\2. spans two cols | | col 1 | col 2 | |
| ||||
<table> <tr> <td colspan="2">spans two cols </td> </tr> <tr> <td> col 1 </td> <td> col 2 </td> </tr> </table> | |||||
Use a / forward slash to indicate a row span.
|/3. spans 3 rows | row a | | row b | | row c | |
| ||||
<table> <tr> <td rowspan="3">spans 3 rows </td> <td> row a </td> </tr> <tr> <td> row b </td> </tr> <tr> <td> row c </td> </tr> </table> |
Previous: Extended blocks Next: Miscellaneous
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 #