The official reference manual for Textile 2. Textile is the lightweight, humane web text generator included in Textpattern and many other web applications.
Blocks of text are indicated by placing a special modifier at the beginning of a paragraph, such as h4. Heading or bq. Block Quote. The block ends with a blank line.
Headers are represented by h1., h2., … h6..
h1. Heading 1 | Heading 1 |
<h1>Heading 1</h1> |
h2. Heading 2 | Heading 2 |
<h2>Heading 2</h2> |
h6. Heading 6 | Heading 6 |
<h6>Heading 6</h6> |
Paragraph p text is represented by p.. This is the default block type: any paragraph without a block modifier will automatically be enclosed with p tags.
p. A paragraph. Continued. Also a paragraph. | A paragraph. Also a paragraph. |
<p>A paragraph.<br /> Continued.</p> <p>Also a paragraph.</p> |
bq. indicates a quoted block of text.
bq. A quotation. Continued. Regular paragraph. |
Regular paragraph. |
<blockquote> <p>A quotation.<br /> Continued.</p> </blockquote> <p>Regular paragraph.</p> |
Block quotes may include a citation URL immediately following the period.
bq.:http://thresholdstate.com/ A cited quotation. |
|
<blockquote cite="http://thresholdstate.com/"> <p>A cited quotation.</p> </blockquote> |
Footnotes are represented by the fn1., fn2., … block modifiers.
A footnote reference[1]. fn1. The footnote. | A footnote reference1. 1 The footnote. |
<p>A footnote reference<sup class="footnote"><a href="#fn1216642796463b1223ae29d">1</a></sup>.</p> <p id="fn1216642796463b1223ae29d" class="footnote"><sup>1</sup> The footnote.</p> |
Code such as XHTML, Javascript or PHP may be displayed using the bc. “block code” modifier. XHTML significant characters such as < and > will be escaped within code blocks – bc is used for displaying code to the reader, not for executing it.
bc. <script> // a Javascript example alert("Hello World"); </script> |
|
<pre><code><script> // a Javascript example alert("Hello World"); </script> </code></pre> |
Note that Textile will interpret any blank lines within the code as indicating the end of the code block. See Extended Blocks below for an explanation of how to display longer blocks of code.
Use the pre. block modifier for pre-formatted text. XHTML significant characters within the block will be escaped.
pre. Pre-formatted text | Pre-formatted text |
<pre>Pre-formatted text </pre> |
pre. is almost identical to bc., with the exception that <code>...</code> tags are not used within the <pre> block.
The notextile. block modifier applies no Textile processing at all to a block. Raw XHTML characters are passed through untouched, so this may be used to insert explicit XHTML markup, or execute Javascript or PHP code.
notextile. <script type="text/javascript"> document.write("Hello World!"); </script> <noscript>Your browser doesn't support Javascript</noscript> | |
<script type="text/javascript"> document.write("Hello World!"); </script> <noscript>Your browser doesn't support Javascript</noscript> |
Attributes may be applied to both phrase and block modifiers, to apply CSS classes, styles and IDs, or identify a language.
CSS classes and IDs are specified with () parentheses.
p(myclass). My classy paragraph. | My classy paragraph. |
<p class="myclass">My classy paragraph.</p> |
p(#myid). My ID paragraph. | My ID paragraph. |
<p id="myid">My ID paragraph.</p> |
CSS styles are specified with {} braces.
p{color:red}. Red rum. | Red rum. |
<p style="color:red;">Red rum.</p> |
Languages are specified with [] brackets.
p[fr-fr]. En français. | En français. |
<p lang="fr-fr">En français.</p> |
The same syntax may be applied to phrase modifiers.
A *(myclass)classy* phrase. | A classy phrase. |
<p>A <strong class="myclass">classy</strong> phrase.</p> |
An _(#myid2)ID_ phrase. | An ID phrase. |
<p>An <em id="myid2">ID</em> phrase.</p> |
The %{color:blue}blue% room. | The blue room. |
<p>The <span style="color:blue;">blue</span> room.</p> |
Block and phrase attributes may be combined.
p(myclass#myid3){color:green}[de-de]. A complex paragraph. | A complex paragraph. |
<p style="color:green;" class="myclass" lang="de-de" id="myid3">A complex paragraph.</p> |
A ??(myclass#myid4){color:green}[de-de]complex?? phrase. | A complex phrase. |
<p>A <cite style="color:green;" class="myclass" lang="de-de" id="myid4">complex</cite> phrase.</p> |
Previous: Phrase modifiers Next: Extended blocks
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 #