The Textile text formatting option takes a lot of the pain out of HTML composition.
Textile works by looking at your text in terms of lines and paragraphs. Paragraphs are composed of one or more lines, separated by a single new-line character. Paragraphs are separated by one or more blank lines.
For each new paragraph, you may begin the paragraph with one of the following markers:
<pre><code>...</code></pre>
block since <blockcode>
is just an announced tag for the future XHTML 2 specification).All these markers must be at the beginning of the new paragraph, without any leading spaces. If line breaks exist within the block, they will be translated into <br />
tags automatically. And optionally, you may add a CSS class name in parenthesis preceding the period of the heading, blockquote or paragraph markers. If a CSS class name is given in this way, it will be assigned to the block tag.
With the exception of the '==' marker, each of these can include a CSS class and/or id assignment in one of these forms:
For example:
p(first). First paragraph.
The '#' and '*' markers can have a CSS class/id prefix as well as a suffix. If a prefix is used like this: (class#id)#
, then the class and/or id are assigned to the <ol>
tag. If the class/id appears after the '#' or '*' characters, then it is assigned to the <li>
tag. You can combine them as well (the prefix is only valid for the first item on a given level. Multi-level lists are supported, like this:
* Item one
* Item two
** Sub item 1
** Sub item 2
### Point 1
### Point 2
* Item two
You may also use regular block formatting HTML tags if you prefer.
Within each block, the following inline formatting shortcuts are provided:
code
@ Text surrounded by '@' characters will be formatted using the <code> tag."Link (Title)":url
"(class)Link":url
"(#id)Link":url
"(class#id)Link":url
"E-mail me":me@mydomain.com
"FTP Site":ftp://ftp.domain.com/directory
!image_url(alt text)!
. Finally, a CSS class and/or id can be specified following the opening '!' character. Other options available:
!image_url (This is my image)!
!(imgright)image_url!
!(#figure3)image_url!
!(imgright#figure3)image_url!
!image_url widthxheight!
!image_url widthw heighth!
!image_url 50%!
!image_url 20%x30%!
A series of two or more uppercase alpha-numeric characters will be wrapped with a <span> tag and assigned the 'caps' class.
You can also use regular HTML tags when composing your entries. Also, special characters within your entry text such as <, >, &, international and symbol characters will automatically be escaped into equivalent HTML entities.
If you use a <pre>
tag, it isn't necessary to escape special characters within it-- they will be automatically escaped, until the closing </pre>
tag is reached.
Additionally, the raw symbols for ™, © and ® will be escaped to HTML entities. Most international characters and symbols will also be escaped to HTML entities.
Unescaped & characters within tag attributes will be escaped automatically.
If you have the Smarty Pants Movable Type plugin installed, it will automatically be used to 'educate' your quotes, ellipsis and dashes to their typographic counterparts.
Tables can be easily composed with MT-Textile markup. Here's a simple table as an example:
|_ Name|_ Age|
|Savannah|4|
|Seth|1|
Whitespace on the left and right within cells are ignored, so you can use extra spaces to visually line up your table to your liking. The '_' character next to the '|' character identifies that cell as a header cell.
CSS class/ids can also be assigned to table, row and cell elements. To assign a table class and/or id, you must use the "table." block prefix like this:
table(scores). |_ Team |_> Score |
(winner)| Red Sox |(rec) 240 |
| Mets | 4 |
The class marker "winner" on the second line assigns the "winner" class to the <tr> tag for that row. The class marker "rec" assigns the "rec" class to the <td> tag for that cell. This example also demonstrates the right-alignment flag '>'. All cell attributes must be placed just to the right of the opening '|' character for that cell. Here are the available cell attribute flags:
MT-Textile also allows for multiple filters to be used using the '==' sections. Here's an example:
==|fudd|Where is that rascally rabbit?==
If you have the MovableJive plugin installed, this will use it to format that sentence using it's "fudd" filter. The output would look like this:
<p>Whewe is dat wascawwy wabbit?</p>
The Textile text formatting code for Movable Type was written by Brad Choate. The Textile formatting syntax was developed by Dean Allen. Many thanks to Dean for his permission to adapt Textile for use in Movable Type.