Difference between revisions of "Advanced textile editing"
From Spiffy Stores Knowledge Base
(New page: <table> <tr><th colspan='3'><h1>A Textile Reference</h1></th></tr> <tr><td class='sections' colspan='3'>Sections: <a href='#writing-in-textile'>Writing in Textile</a> | <a hr...) |
|||
(199 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | Textile is a simple text markup. Simple symbols mark a word's emphasis. Blocks of text can be easily tagged as headers, quotes, or lists. A Textile document can then be converted to HTML (Hypertext Markup Language) for viewing on the web. | |
− | |||
− | |||
− | + | Texile makes it easy to mark up text for a web page without needing to have any knowledge about HTML. | |
− | |||
− | |||
− | |||
− | |||
− | + | You can try out Textile on the [http://www.textism.com/tools/textile/ Textile home page]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Reading the Examples === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | In each section below, examples are provided to help clearly illustrate how to use the markup. In each example, the Textile example is followed by the raw HTML that is generated. This is followed by an example of how the output will appear in a browser. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Textile example | |
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|Converted to HTML | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|Browser view | ||
+ | |} | ||
+ | == Writing in Textile == | ||
− | + | === Paragraphs in Textile === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|A single paragraph.<br /><br />Followed by another. | |
− | + | |→ | |
− | </ | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>A single paragraph.</p><br /><br /> <p>Followed by another.</p> |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>A single paragraph.</p><p>Followed by another.</p> | |
− | + | |} | |
− | + | === Using HTML in Textile === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it's found in a ''pre'' or ''code'' block. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I am <b>very</b> serious.<br /><br /><pre><br />I am <b>very</b> serious.<br /></pre> | |
− | + | |→ | |
− | </ | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I am <b>very</b> serious.</p><br /><br /><pre><br />I am &lt;b&gt;very&lt;/b&gt; serious.<br /></pre> |
− | < | + | |- |
− | < | + | | |
− | </ | + | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I am <b>very</b> serious.</p><p>I am <b>very</b> serious.</p> | |
− | <p> | + | |} |
− | + | === Line Breaks === | |
− | |||
− | |||
− | |||
− | + | Line breaks are converted to HTML breaks. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I spoke.<br />And none replied. | |
− | + | |→ | |
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I spoke.<br />And none replied.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I spoke.<br />And none replied.</p> | ||
+ | |} | ||
− | + | === Entities === | |
− | |||
− | |||
− | |||
− | |||
− | + | Single-quotes and double-quotes around words or phrases are converted to curly quotations, which are much easier on the eye. | |
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|"Observe!" | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>&#8220;Observe!&#8221;</p> | |
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>“Observe!”</p> | ||
+ | |} | ||
− | + | Double hyphens are replaced with an em-dash. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Observe -- very nice! | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>Observe &#8212; very nice!</p> | |
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>Observe — very nice!</p> | ||
+ | |} | ||
− | + | Single hyphens are replaced with en-dashes. | |
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Observe - tiny and brief. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>Observe &#8211; tiny and brief.</p> | |
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>Observe – tiny and brief.</p> | ||
+ | |} | ||
− | + | Triplets of periods become an ellipsis. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Observe... | |
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>Observe&#8230;</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>Observe…</p> | ||
+ | |} | ||
− | + | The letter ‘x’ becomes a dimension sign when used alone. | |
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Observe: 2x2. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>Observe: 2&#215;2.</p> | |
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>Observe: 2×2.</p> | ||
+ | |} | ||
− | + | Conversion of trademark and copyright symbols. | |
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|a(TM), b(R), c(C). | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>a&#8482;, b&#174;, c&#169;.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>a™, b®, c©.</p> | ||
+ | |} | ||
− | + | == Quick Block Modifiers == | |
− | |||
− | |||
− | |||
− | of | + | Blocks of text are treated as paragraphs by default. However, modifers can be prefixed to the beginning of a block to change its treatment. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Headers === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | To make an entire paragraph into a Header, place "h''n''" at its beginning, where ''n'' is a number from 1-6. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|h1. Header 1 | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<h1>Header 1</h1> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px; font-size: 30px; font-weight: bold"|Header 1 | ||
+ | |} | ||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|h2. Header 2 | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<h2>Header 2</h2> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px; font-size: 20px; font-weight: bold"|Header 2 | ||
+ | |} | ||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|h3. Header 3 | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<h3>Header 3</h3> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px; font-size: 15px; font-weight: bold"|Header 3 | |
− | + | |} | |
− | |||
− | + | === Block Quotes === | |
− | |||
− | |||
− | + | To make an entire paragraph into a block quotation, place "bq." before it. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|An old text<br /><br />bq. A block quotation.<br /><br />Any old text | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>An old text</p><br /><blockquote><br /><p>A block quotation.</p><br /></blockquote><br /><p>Any old text</p> | |
− | + | |- | |
− | </ | + | | |
− | + | | | |
− | < | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>An old text</p><blockquote><p>A block quotation.</p></blockquote><p>Any old text</p> |
− | + | |} | |
− | + | === Footnotes === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Numeric references within text to footnotes appear between square brackets. | |
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|This is covered elsewhere[1]. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>This is covered elsewhere<sup><a href="#fn1">1</a></sup>.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>This is covered elsewhere<sup>[[#fn1|1]]</sup>.</p> | |
+ | |} | ||
− | + | To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote's number, followed by a dot and a space. | |
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|fn1. Down here, in fact. | |
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p id="fn1"><sup>1</sup> Down here, in fact.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p id="fn1"><sup>1</sup> Down here, in fact.</p> | ||
+ | |} | ||
+ | == Quick Phrase Modifiers == | ||
− | + | === Structural Emphasis === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as ''italics''. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I _believe_ every word. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I <em>believe</em> every word.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I ''believe'' every word.</p> | |
+ | |} | ||
− | + | Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as '''bold'''. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|And then? She *fell*! | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>And then? She <strong>fell</strong>!</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | < | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>And then? She '''fell'''!</p> |
− | + | |} | |
− | + | Both italics and bold can be forced by doubling the underscores or asterisks. | |
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I __know__.<br />I **really** __know__. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I <i>know</i>.<br /><br />I <b>really</b> <i>know</i>.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I <i>know</i>.<br />I <b>really</b> <i>know</i>.</p> | |
+ | |} | ||
− | + | Use double question marks to indicate ''citation''. The title of a book, for instance, | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|??Cat's Cradle?? by Vonnegut | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p><cite>Cat's Cradle</cite> by Vonnegut</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p><cite>Cat's Cradle</cite> by Vonnegut</p> | |
+ | |} | ||
− | + | Code phrases can be surrounded by at-symbols. | |
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|Convert with @r.to_html@ | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>Convert with <code>r.to_html</code></p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>Convert with <code>r.to_html</code></p> | |
+ | |} | ||
− | + | To indicate a passage which has been deleted, surround the passage with hyphens. | |
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I'm -sure- not sure. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I'm <del>sure</del> not sure.</p> | |
− | + | |- | |
− | + | | | |
− | <p> | + | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I'm <del>sure</del> not sure.</p> | ||
+ | |} | ||
− | + | Pluses around a passage indicate its insertion. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|You are a +pleasant+ child. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>You are a <ins>pleasant</ins> child.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>You are a <ins>pleasant</ins> child.</p> | ||
+ | |} | ||
− | + | To superscript a phrase, surround with carets. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|a^2^ + b^2^ = c^2^ | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></p> | |
− | + | |} | |
− | + | To subscript, surround with tildes. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|log~2~ x | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>log<sub>2</sub> x</p> | |
− | + | |- | |
− | + | | | |
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>log<sub>2</sub> x</p> | ||
+ | |} | ||
− | + | === HTML-Specific === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I'm %unaware% of most soft drinks. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I'm <span>unaware</span> of most soft drinks.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I'm <span>unaware</span> of most soft drinks.</p> | ||
+ | |} | ||
− | + | This way, you can apply style settings, as described in the next section to arbitrary phrases. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I'm %{color:red}unaware% of most soft drinks. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I'm <span style="color:red;">unaware</span> of most soft drinks.</p> | |
− | + | |- | |
− | + | | | |
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I'm <span style="color:red;">unaware</span> of most soft drinks.</p> | ||
+ | |} | ||
− | + | == Attributes == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Tailoring Textile to suit your needs is quite easy. Attributes allow you to provide Cascading Style Sheets (CSS) information about any phrase. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Block Attributes === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | A block can be tagged with a CSS class by enclosing the class name in parentheses and placing it just before the period which marks the block. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p(example1). An example | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p class="example1">An example</p> | |
− | + | |- | |
− | + | | | |
− | < | + | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p class="example1">An example</p> | |
+ | |} | ||
− | + | An element ID can be given by prefixing the ID with a hash symbol (#) and using it in place of the class. | |
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p(#big-red). Red here | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p id="big-red">Red here</p> | |
− | + | |- | |
− | + | | | |
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p id="big-red">Red here</p> | ||
+ | |} | ||
− | + | Class and ID can be combined by placing the class first. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p(example1#big-red2). Red here | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p class="example1" id="big-red2">Red here</p> | |
− | + | |- | |
− | + | | | |
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p class="example1" id="big-red2">Red here</p> | ||
+ | |} | ||
− | + | Style settings can be provided directly by surrounding them in curly braces. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p{color:blue;margin:30px}. Spacey blue | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="color:blue; margin:30px;">Spacey blue</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
− | + | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="color:blue;margin:30px;">Spacey blue</p> | |
− | <p> | + | |} |
− | |||
− | + | Language designations can be given between square brackets. | |
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p[fr]. rouge | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p lang="fr">rouge</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p lang="fr">rouge</p> | ||
+ | |} | ||
− | + | === Phrase Attributes === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | All block attributes can be applied to phrases as well by placing them just inside the opening modifier. | |
− | |||
− | |||
− | + | {| style="width: 100%" cellspacing="10" | |
− | + | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I seriously *{color:red}blushed* when I _(big)sprouted_ that corn stalk from my %[es]cabeza%. | |
− | + | |→ | |
− | + | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I seriously <strong style="color:red;">blushed</strong> when I <em class="big">sprouted</em> that corn stalk from my <span lang="es">cabeza</span>.</p> | |
− | + | |- | |
− | + | | | |
− | + | | | |
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I seriously <strong style="color:red;">blushed</strong> when I <em style="font-size: 20px">sprouted</em> that corn stalk from my <span lang="es">cabeza</span>.</p> | ||
+ | |} | ||
− | + | === Block Alignments === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | Text inside blocks can be aligned in four basic ways. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p<. align left | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="text-align:left;">align left</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="text-align:left;">align left</p> | ||
+ | |} | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p>. align right | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="text-align:right;">align right</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="text-align:right;">align right</p> | ||
+ | |} | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p=. centered | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="text-align:center;">centered</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="text-align:center;">centered</p> | ||
+ | |} | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p<>. justified | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="text-align:justify;">justified</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="text-align:justify;">justified</p> | ||
+ | |} | ||
+ | |||
+ | Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p(. left ident 1em | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="padding-left:1em;">left ident 1em</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="padding-left:1em;">left ident 1em</p> | ||
+ | |} | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p((. left ident 2em | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="padding-left:2em;">left ident 2em</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="padding-left:2em;">left ident 2em</p> | ||
+ | |} | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|p))). right ident 3em | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="padding-right:3em;">right ident 3em</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="padding-right:3em;">right ident 3em</p> | ||
+ | |} | ||
+ | |||
+ | === Combining Alignments === | ||
+ | |||
+ | Identation may be coupled with alignment. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|h2()>. Bingo. | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<h2 style="padding-left:1em; padding-right:1em; text-align:right;">Bingo.</h2> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px; font-size: 20px; font-weight: bold"|<div style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</div> | ||
+ | |} | ||
+ | |||
+ | And, furthermore, coupled with language settings and CSS styles. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|h3()>[no]{color:red}. Bingo | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<h3 style="color:red; padding-left:1em; padding-right:1em; text-align:right;" lang="no">Bingo</h3> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px; font-size: 15px; font-weight: bold"|<div style="color:red;padding-left:1em;padding-right:1em;text-align:right;" lang="no">Bingo</div> | ||
+ | |} | ||
+ | |||
+ | === HTML in Textile === | ||
+ | |||
+ | Textile is designed for making simple markup quick and easy. For more complex formatting, you are encouraged to break out into HTML. | ||
+ | |||
+ | For example, long code blocks belong between <code><pre>…</pre></code> and <code><code>…</code></code> tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<pre><br /><code><br /> a.gsub!( /</, '' )<br /></code><br /></pre> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<pre><br /><code><br /> a.gsub!( /&lt;/, '' )<br /></code><br /></pre> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<code>a.gsub!( /</, '' )</code> | ||
+ | |} | ||
+ | |||
+ | You may also choose to surround sections with <code><div></code> tags to separate your document into sections. [http://www.instiki.org Instiki] uses this technique to float a sidebar to the right. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<div style="float:right;padding:5px;"><br /><br />h3. Sidebar<br /><br />"Spiffy":<nowiki>http://www.spiffystores.com/</nowiki><br />"Ruby":<nowiki>http://ruby-lang.org/</nowiki><br /><br /></div><br /><br />The main text of the page goes here and will stay to the left of the sidebar. | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding:5px"|<div style="float:right;padding:5px;"><br /><h3>Sidebar</h3><br /><p><br /><a href="<nowiki>http://www.spiffystores.com/</nowiki>">Spiffy</a><br /><br /><a href="<nowiki>http://ruby-lang.org/</nowiki>">Ruby</a><br /></p><br /></div><br /><br /><p>The main text of the page goes here and will stay to the left of the sidebar.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<div style="float:right;padding:5px;"><div style="font-size: 15px; font-weight: bold">Sidebar</div><p>[http://www.spiffystores.com Spiffy]<br />[http://ruby-lang.org/ Ruby]</p></div> | ||
+ | <p>The main text of the page goes here and will stay to the left of the sidebar.</p> | ||
+ | |} | ||
+ | |||
+ | == Lists == | ||
+ | |||
+ | === Numeric Lists === | ||
+ | |||
+ | To make a numbered list, place each item in its own paragraph, preceded by a hash character ("#"). | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|# A first item<br /># A second item<br /># A third | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<ol><br /><li>A first item</li><br /><li>A second item</li><br /><li>A third</li><br /></ol> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<ol> | ||
+ | <li>A first item</li> | ||
+ | <li>A second item</li> | ||
+ | <li>A third</li> | ||
+ | </ol> | ||
+ | |} | ||
+ | |||
+ | These lists may be nested by increasing the number of hash characters ("#") that precede the child entries. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|# Fuel could be:<br />## Coal<br />## Petrol<br />## Electricity<br /># Humans need only:<br />## Water<br />## Protein | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<ol><br /><li>Fuel could be:<br /><ol><br /><li>Coal</li><br /><li>Petrol</li><br /> <li>Electricity</li><br /></ol><br /></li><br /><li>Humans need only:<br /><ol><br /><li>Water</li><br /><li>Protein</li><br /></ol><br /></li><br /></ol> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<ol> | ||
+ | <li>Fuel could be: | ||
+ | <ol> | ||
+ | <li>Coal</li> | ||
+ | <li>Petrol</li> | ||
+ | <li>Electricity</li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li>Humans need only: | ||
+ | <ol> | ||
+ | <li>Water</li> | ||
+ | <li>Protein</li> | ||
+ | </ol></li> | ||
+ | </ol> | ||
+ | |} | ||
+ | |||
+ | === Bulleted Lists === | ||
+ | |||
+ | Bulleted lists use an asterisk character ("*") instead of the hash character ("#"). | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|* A first item<br />* A second item<br />* A third | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<ul><br /><li>A first item</li><br /><li>A second item</li><br /><li>A third</li><br /></ul> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<ul> | ||
+ | <li>A first item</li> | ||
+ | <li>A second item</li> | ||
+ | <li>A third</li> | ||
+ | </ul> | ||
+ | |} | ||
+ | |||
+ | These lists may also be nested in a similar manner. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|* Fuel could be:<br />** Coal<br />** Petrol<br />** Electricity<br />* Humans need only:<br />** Water<br />** Protein | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<ul><br /><li>Fuel could be:<br /><ul><br /><li>Coal</li><br /><li>Petrol</li><br /> <li>Electricity</li><br /></ul><br /></li><br /><li>Humans need only:<br /><ul><br /><li>Water</li><br /><li>Protein</li><br /></ul><br /></li><br /></ul> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<ul> | ||
+ | <li>Fuel could be: | ||
+ | <ul> | ||
+ | <li>Coal</li> | ||
+ | <li>Petrol</li> | ||
+ | <li>Electricity</li> | ||
+ | </ul> | ||
+ | </li> | ||
+ | <li>Humans need only: | ||
+ | <ul> | ||
+ | <li>Water</li> | ||
+ | <li>Protein</li> | ||
+ | </ul></li> | ||
+ | </ul> | ||
+ | |} | ||
+ | |||
+ | == External References == | ||
+ | |||
+ | === Hypertext Links === | ||
+ | |||
+ | Basic links are comprised of a phrase which is linked to a URL. Place the descriptive phrase in quotation marks, and follow it immediately by a colon and the URL. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I searched "Google":<nowiki>http://google.com</nowiki>. | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I searched <a href="<nowiki>http://google.com</nowiki>">Google</a>.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I searched [http://google.com Google].</p> | ||
+ | |} | ||
+ | |||
+ | Note, the link won't include any trailing punctuation. | ||
+ | |||
+ | === Link Aliases === | ||
+ | |||
+ | If you are using the same link several times in your document, or you'd just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|I am crazy about "Spiffy Stores":spiffy<br />and "it's":spiffy "all":spiffy I ever<br />"link to":spiffy!<br /><br />[spiffy]<nowiki>http://www.spiffystores.com</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>I am crazy about <a href="<nowiki>http://www.spiffystores.com</nowiki>">Spiffy Stores</a><br />and <a href="<nowiki>http://www.spiffystores.com</nowiki>">it's</a> <a href="<nowiki>http://www.spiffystores.com</nowiki>">all</a> I ever<br /><a href="<nowiki>http://www.spiffystores.com</nowiki>">link to</a>!</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>I am crazy about [http://www.spiffystores.com Spiffy Stores] and [http://www.spiffystores.com it's] [http://www.spiffystores.com all] I ever | ||
+ | [http://www.spiffystores.com link to]!</p> | ||
+ | |} | ||
+ | |||
+ | === Embedded Images === | ||
+ | |||
+ | You can embed an image in your Textile document by surrounding its URL with exclamation marks. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>!http://spiffyserver.com/images/spiffy-stores-logo.gif!</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p><img src="<nowiki>http://spiffyserver.com/images/spiffy-stores-logo.gif</nowiki>" alt="" /></p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>http://spiffyserver.com/images/spiffy-stores-logo.gif</p> | ||
+ | |} | ||
+ | |||
+ | URLs may be relative. | ||
+ | |||
+ | A title for the image can also be provided in parentheses, just before the closing exclamation mark. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>!http://spiffyserver.com/images/spiffy-stores-logo.gif(Spiffy Logo)!</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p><img src="<nowiki>http://spiffyserver.com/images/spiffy-stores-logo.gif</nowiki>" title="Spiffy Logo" alt="Spiffy Logo" /></p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p><html><img src="http://spiffyserver.com/images/spiffy-stores-logo.gif" title="Spiffy Logo" alt="Spiffy Logo"></html></p> | ||
+ | |} | ||
+ | |||
+ | The title also acts as '''alt''' text should the image not be found. | ||
+ | |||
+ | Links can be attached to images with a colon. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>!http://spiffyserver.com/images/spiffy-stores-logo.gif!:http://www.spiffystores.com/</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p><a href="<nowiki>http://www.spiffystores.com/</nowiki>"><img src="<nowiki>http://spiffyserver.com/images/spiffy-stores-logo.gif</nowiki>" alt="" /></a></p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>[http://www.spiffystores.com/ http://spiffyserver.com/images/spiffy-stores-logo.gif]</p> | ||
+ | |} | ||
+ | |||
+ | === Image Alignments === | ||
+ | |||
+ | Alignments can be applied as well to images. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|!><nowiki>http://spiffyserver.com/images/spiffy-stores-logo.gif</nowiki>!<br /><br />And others sat all round the small<br />machine and paid it to sing to them. | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p style="float:right"><img src="<nowiki>http://spiffyserver.com/images/spiffy-stores-logo.gif</nowiki>" alt="" /></p><br /><br /><p>And others sat all round the small<br />machine and paid it to sing to them.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p style="float:right">http://spiffyserver.com/images/spiffy-stores-logo.gif</p> | ||
+ | <p>And others sat all round the small machine and paid it to sing to them.</p> | ||
+ | |} | ||
+ | |||
+ | === Acronyms === | ||
+ | |||
+ | Definitions for acronyms can be provided by following an acronym with its definition in parentheses. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|We use CSS(Cascading Style Sheets). | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<p>We use <acronym title="Cascading Style Sheets">CSS</acronym>.</p> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<p>We use <html><acronym title="Cascading Style Sheets">CSS</acronym></html>.</p> | ||
+ | |} | ||
+ | |||
+ | == Tables == | ||
+ | |||
+ | Simple tables can be built by separating fields with pipe characters. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>| name | age | sex |</nowiki><br /><nowiki>| joan | 24 | f |</nowiki><br /><nowiki>| archie | 29 | m |</nowiki><br /><nowiki>| bella | 45 | f |</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><td> name </td><br /><td> age </td><br /><td> sex </td><br /></tr><br /><tr><br /><td> joan </td><br /><td> 24 </td><br /><td> f </td><br /></tr><br /><tr><br /><td> archie </td><br /><td> 29 </td><br /><td> m </td><br /></tr><br /><tr><br /><td> bella </td><br /><td> 45 </td><br /><td> f </td><br /></tr><br /> </table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <td> name </td> | ||
+ | <td> age </td> | ||
+ | <td> sex </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> joan </td> | ||
+ | <td> 24 </td> | ||
+ | <td> f </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> archie </td> | ||
+ | <td> 29 </td> | ||
+ | <td> m </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> bella </td> | ||
+ | <td> 45 </td> | ||
+ | <td> f </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | Specify header cells by marking them with an underscore and period. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>| _.name | _.age | _.sex |</nowiki><br /><nowiki>| joan | 24 | f |</nowiki><br /><nowiki>| archie | 29 | m |</nowiki><br /><nowiki>| bella | 45 | f |</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><th> name </th><br /><th> age </th><br /><th> sex </th><br /></tr><br /><tr><br /><td> joan </td><br /><td> 24 </td><br /><td> f </td><br /></tr><br /><tr><br /><td> archie </td><br /><td> 29 </td><br /><td> m </td><br /></tr><br /><tr><br /><td> bella </td><br /><td> 45 </td><br /><td> f </td><br /></tr><br /> </table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <th> name </th> | ||
+ | <th> age </th> | ||
+ | <th> sex </th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> joan </td> | ||
+ | <td> 24 </td> | ||
+ | <td> f </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> archie </td> | ||
+ | <td> 29 </td> | ||
+ | <td> m </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> bella </td> | ||
+ | <td> 45 </td> | ||
+ | <td> f </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | === Cell Attributes === | ||
+ | |||
+ | The period character, as used above, marks the end of a cell's attributes. Other attributes can be applied as well. | ||
+ | |||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>|_. attribute list |</nowiki><br /><nowiki>|<. align left |</nowiki><br /><nowiki>|>. align right|</nowiki><br /><nowiki>|=. center |</nowiki><br /><nowiki>|<>. justify |</nowiki><br /><nowiki>|^. valign top |</nowiki><br /><nowiki>|~. bottom |</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><th>attribute list </th><br /></tr><br /><tr><br /><td style="text-align:left;">align left </td><br /></tr><br /><tr><br /><td style="text-align:right;">align right</td><br /></tr><br /><tr><br /><td style="text-align:center;">center </td><br /></tr><br /><tr><br /><td style="text-align:justify;">justify </td><br /></tr><br /><tr><br /><td style="vertical-align:top;">valign top </td><br /></tr><br /><tr><br /><td style="vertical-align:bottom;">bottom </td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <th>attribute list </th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="text-align:left;">align left </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="text-align:right;">align right</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="text-align:center;">center </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="text-align:justify;">justify </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="vertical-align:top;">valign top </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="vertical-align:bottom;">bottom </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | You can also specify ''colspans'' with a backslash, followed by the cell width. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>|\2. spans two cols |</nowiki><br /><nowiki>| col 1 | col 2 | | ||
+ | </nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><td colspan="2">spans two cols </td><br /></tr><br /><tr><br /><td> col 1 </td><br /><td> col 2 </td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <td colspan="2">spans two cols </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> col 1 </td> | ||
+ | <td> col 2 </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | A ''rowspan'' is specified by a forward slash, followed by the row height. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>|/3. spans 3 rows | a |</nowiki><br /><nowiki>| b |</nowiki><br /><nowiki>| c |</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><td rowspan="3">spans 3 rows </td><br /><td> a </td><br /></tr><br /><tr><br /><td> b </td><br /></tr><br /><tr><br /><td> c </td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <td rowspan="3">spans 3 rows </td> | ||
+ | <td> a </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> b </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> c </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | All block attributes can be applied to table cells as well. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>|{background:#ddd}. Grey cell|</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><td style="background:#ddd;">Grey cell</td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <td style="background:#ddd;">Grey cell</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | === Table and Row Attributes === | ||
+ | |||
+ | Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|table{border:1px solid black}.<br /><nowiki>|This|is|a|row|</nowiki><br /><nowiki>|This|is|a|row|</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table style="border:1px solid black;"><br /><tr><br /><td>This</td><br /><td>is</td><br /><td>a</td><br /><td>row</td><br /></tr><br /><tr><br /><td>This</td><br /><td>is</td><br /><td>a</td><br /><td>row</td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table style="border:1px solid black;"> | ||
+ | <tr> | ||
+ | <td>This</td> | ||
+ | <td>is</td> | ||
+ | <td>a</td> | ||
+ | <td>row</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>This</td> | ||
+ | <td>is</td> | ||
+ | <td>a</td> | ||
+ | <td>row</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |} | ||
+ | |||
+ | Attributes can be applied to a single row by supplying the attribute before the row starts, using a <code>table</code> modifier and following it by a period. | ||
+ | |||
+ | {| style="width: 100%" cellspacing="10" | ||
+ | |style="width: 49%; background-color: #B30; color: white; padding: 5px"|<nowiki>|This|is|a|row|</nowiki><br />{background:#ddd}. <nowiki>|This|is|grey|row|</nowiki> | ||
+ | |→ | ||
+ | |style="width: 49%; background-color: #EEE; border: 1px solid #DDD; padding: 5px"|<table><br /><tr><br /><td>This</td><br /><td>is</td><br /><td>a</td><br /><td>row</td><br /></tr><br /><tr style="background:#ddd;"><br /><td>This</td><br /><td>is</td><br /><td>grey</td><br /><td>row</td><br /></tr><br /></table> | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |style="background-color: #FFE; border: 1px solid #EED; padding: 5px"|<table> | ||
+ | <tr> | ||
+ | <td>This</td> | ||
+ | <td>is</td> | ||
+ | <td>a</td> | ||
+ | <td>row</td> | ||
+ | </tr> | ||
+ | <tr style="background:#ddd;"> | ||
+ | <td>This</td> | ||
+ | <td>is</td> | ||
+ | <td>grey</td> | ||
+ | <td>row</td> | ||
+ | </tr> | ||
</table> | </table> | ||
+ | |} |
Latest revision as of 12:57, 7 June 2011
Textile is a simple text markup. Simple symbols mark a word's emphasis. Blocks of text can be easily tagged as headers, quotes, or lists. A Textile document can then be converted to HTML (Hypertext Markup Language) for viewing on the web.
Texile makes it easy to mark up text for a web page without needing to have any knowledge about HTML.
You can try out Textile on the Textile home page.
Contents
Reading the Examples
In each section below, examples are provided to help clearly illustrate how to use the markup. In each example, the Textile example is followed by the raw HTML that is generated. This is followed by an example of how the output will appear in a browser.
Textile example | → | Converted to HTML |
Browser view |
Writing in Textile
Paragraphs in Textile
Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph.
A single paragraph. Followed by another. |
→ | <p>A single paragraph.</p> <p>Followed by another.</p> |
A single paragraph. Followed by another. |
Using HTML in Textile
You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it's found in a pre or code block.
I am <b>very</b> serious. <pre> I am <b>very</b> serious. </pre> |
→ | <p>I am <b>very</b> serious.</p> <pre> I am <b>very</b> serious. </pre> |
I am very serious. I am <b>very</b> serious. |
Line Breaks
Line breaks are converted to HTML breaks.
I spoke. And none replied. |
→ | <p>I spoke.<br />And none replied.</p> |
I spoke. |
Entities
Single-quotes and double-quotes around words or phrases are converted to curly quotations, which are much easier on the eye.
"Observe!" | → | <p>“Observe!”</p> |
“Observe!” |
Double hyphens are replaced with an em-dash.
Observe -- very nice! | → | <p>Observe — very nice!</p> |
Observe — very nice! |
Single hyphens are replaced with en-dashes.
Observe - tiny and brief. | → | <p>Observe – tiny and brief.</p> |
Observe – tiny and brief. |
Triplets of periods become an ellipsis.
Observe... | → | <p>Observe…</p> |
Observe… |
The letter ‘x’ becomes a dimension sign when used alone.
Observe: 2x2. | → | <p>Observe: 2×2.</p> |
Observe: 2×2. |
Conversion of trademark and copyright symbols.
a(TM), b(R), c(C). | → | <p>a™, b®, c©.</p> |
a™, b®, c©. |
Quick Block Modifiers
Blocks of text are treated as paragraphs by default. However, modifers can be prefixed to the beginning of a block to change its treatment.
Headers
To make an entire paragraph into a Header, place "hn" at its beginning, where n is a number from 1-6.
h1. Header 1 | → | <h1>Header 1</h1> |
Header 1 |
h2. Header 2 | → | <h2>Header 2</h2> |
Header 2 |
h3. Header 3 | → | <h3>Header 3</h3> |
Header 3 |
Block Quotes
To make an entire paragraph into a block quotation, place "bq." before it.
An old text bq. A block quotation. Any old text |
→ | <p>An old text</p> <blockquote> <p>A block quotation.</p> </blockquote> <p>Any old text</p> |
An old text
Any old text |
Footnotes
Numeric references within text to footnotes appear between square brackets.
This is covered elsewhere[1]. | → | <p>This is covered elsewhere<sup><a href="#fn1">1</a></sup>.</p> |
This is covered elsewhere1. |
To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote's number, followed by a dot and a space.
fn1. Down here, in fact. | → | <p id="fn1"><sup>1</sup> Down here, in fact.</p> |
1 Down here, in fact. |
Quick Phrase Modifiers
Structural Emphasis
Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as italics.
I _believe_ every word. | → | <p>I <em>believe</em> every word.</p> |
I believe every word. |
Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as bold.
And then? She *fell*! | → | <p>And then? She <strong>fell</strong>!</p> |
And then? She fell! |
Both italics and bold can be forced by doubling the underscores or asterisks.
I __know__. I **really** __know__. |
→ | <p>I <i>know</i>.<br /> I <b>really</b> <i>know</i>.</p> |
I know. |
Use double question marks to indicate citation. The title of a book, for instance,
??Cat's Cradle?? by Vonnegut | → | <p><cite>Cat's Cradle</cite> by Vonnegut</p> |
Cat's Cradle by Vonnegut |
Code phrases can be surrounded by at-symbols.
Convert with @r.to_html@ | → | <p>Convert with <code>r.to_html</code></p> |
Convert with |
To indicate a passage which has been deleted, surround the passage with hyphens.
I'm -sure- not sure. | → | <p>I'm <del>sure</del> not sure.</p> |
I'm |
Pluses around a passage indicate its insertion.
You are a +pleasant+ child. | → | <p>You are a <ins>pleasant</ins> child.</p> |
You are a pleasant child. |
To superscript a phrase, surround with carets.
a^2^ + b^2^ = c^2^ | → | <p>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></p> |
a2 + b2 = c2 |
To subscript, surround with tildes.
log~2~ x | → | <p>log<sub>2</sub> x</p> |
log2 x |
HTML-Specific
Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span.
I'm %unaware% of most soft drinks. | → | <p>I'm <span>unaware</span> of most soft drinks.</p> |
I'm unaware of most soft drinks. |
This way, you can apply style settings, as described in the next section to arbitrary phrases.
I'm %{color:red}unaware% of most soft drinks. | → | <p>I'm <span style="color:red;">unaware</span> of most soft drinks.</p> |
I'm unaware of most soft drinks. |
Attributes
Tailoring Textile to suit your needs is quite easy. Attributes allow you to provide Cascading Style Sheets (CSS) information about any phrase.
Block Attributes
A block can be tagged with a CSS class by enclosing the class name in parentheses and placing it just before the period which marks the block.
p(example1). An example | → | <p class="example1">An example</p> |
An example |
An element ID can be given by prefixing the ID with a hash symbol (#) and using it in place of the class.
p(#big-red). Red here | → | <p id="big-red">Red here</p> |
Red here |
Class and ID can be combined by placing the class first.
p(example1#big-red2). Red here | → | <p class="example1" id="big-red2">Red here</p> |
Red here |
Style settings can be provided directly by surrounding them in curly braces.
p{color:blue;margin:30px}. Spacey blue | → | <p style="color:blue; margin:30px;">Spacey blue</p> |
Spacey blue |
Language designations can be given between square brackets.
p[fr]. rouge | → | <p lang="fr">rouge</p> |
rouge |
Phrase Attributes
All block attributes can be applied to phrases as well by placing them just inside the opening modifier.
I seriously *{color:red}blushed* when I _(big)sprouted_ that corn stalk from my %[es]cabeza%. | → | <p>I seriously <strong style="color:red;">blushed</strong> when I <em class="big">sprouted</em> that corn stalk from my <span lang="es">cabeza</span>.</p> |
I seriously blushed when I sprouted that corn stalk from my cabeza. |
Block Alignments
Text inside blocks can be aligned in four basic ways.
p<. align left | → | <p style="text-align:left;">align left</p> |
align left |
p>. align right | → | <p style="text-align:right;">align right</p> |
align right |
p=. centered | → | <p style="text-align:center;">centered</p> |
centered |
p<>. justified | → | <p style="text-align:justify;">justified</p> |
justified |
Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right.
p(. left ident 1em | → | <p style="padding-left:1em;">left ident 1em</p> |
left ident 1em |
p((. left ident 2em | → | <p style="padding-left:2em;">left ident 2em</p> |
left ident 2em |
p))). right ident 3em | → | <p style="padding-right:3em;">right ident 3em</p> |
right ident 3em |
Combining Alignments
Identation may be coupled with alignment.
h2()>. Bingo. | → | <h2 style="padding-left:1em; padding-right:1em; text-align:right;">Bingo.</h2> |
Bingo.
|
And, furthermore, coupled with language settings and CSS styles.
h3()>[no]{color:red}. Bingo | → | <h3 style="color:red; padding-left:1em; padding-right:1em; text-align:right;" lang="no">Bingo</h3> |
Bingo
|
HTML in Textile
Textile is designed for making simple markup quick and easy. For more complex formatting, you are encouraged to break out into HTML.
For example, long code blocks belong between <pre>…</pre>
and <code>…</code>
tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents.
<pre> <code> a.gsub!( /</, '' ) </code> </pre> |
→ | <pre> <code> a.gsub!( /</, '' ) </code> </pre> |
a.gsub!( /</, '' )
|
You may also choose to surround sections with <div>
tags to separate your document into sections. Instiki uses this technique to float a sidebar to the right.
<div style="float:right;padding:5px;"> h3. Sidebar "Spiffy":http://www.spiffystores.com/ "Ruby":http://ruby-lang.org/ </div> The main text of the page goes here and will stay to the left of the sidebar. |
→ | <div style="float:right;padding:5px;"> <h3>Sidebar</h3> <p> <a href="http://www.spiffystores.com/">Spiffy</a><br /> <a href="http://ruby-lang.org/">Ruby</a> </p> </div> <p>The main text of the page goes here and will stay to the left of the sidebar.</p> |
The main text of the page goes here and will stay to the left of the sidebar. |
Lists
Numeric Lists
To make a numbered list, place each item in its own paragraph, preceded by a hash character ("#").
# A first item # A second item # A third |
→ | <ol> <li>A first item</li> <li>A second item</li> <li>A third</li> </ol> |
|
These lists may be nested by increasing the number of hash characters ("#") that precede the child entries.
# Fuel could be: ## Coal ## Petrol ## Electricity # Humans need only: ## Water ## Protein |
→ | <ol> <li>Fuel could be: <ol> <li>Coal</li> <li>Petrol</li> <li>Electricity</li> </ol> </li> <li>Humans need only: <ol> <li>Water</li> <li>Protein</li> </ol> </li> </ol> |
|
Bulleted Lists
Bulleted lists use an asterisk character ("*") instead of the hash character ("#").
* A first item * A second item * A third |
→ | <ul> <li>A first item</li> <li>A second item</li> <li>A third</li> </ul> |
|
These lists may also be nested in a similar manner.
* Fuel could be: ** Coal ** Petrol ** Electricity * Humans need only: ** Water ** Protein |
→ | <ul> <li>Fuel could be: <ul> <li>Coal</li> <li>Petrol</li> <li>Electricity</li> </ul> </li> <li>Humans need only: <ul> <li>Water</li> <li>Protein</li> </ul> </li> </ul> |
|
External References
Hypertext Links
Basic links are comprised of a phrase which is linked to a URL. Place the descriptive phrase in quotation marks, and follow it immediately by a colon and the URL.
I searched "Google":http://google.com. | → | <p>I searched <a href="http://google.com">Google</a>.</p> |
I searched Google. |
Note, the link won't include any trailing punctuation.
Link Aliases
If you are using the same link several times in your document, or you'd just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above.
I am crazy about "Spiffy Stores":spiffy and "it's":spiffy "all":spiffy I ever "link to":spiffy! [spiffy]http://www.spiffystores.com |
→ | <p>I am crazy about <a href="http://www.spiffystores.com">Spiffy Stores</a> and <a href="http://www.spiffystores.com">it's</a> <a href="http://www.spiffystores.com">all</a> I ever <a href="http://www.spiffystores.com">link to</a>!</p> |
I am crazy about Spiffy Stores and it's all I ever link to! |
Embedded Images
You can embed an image in your Textile document by surrounding its URL with exclamation marks.
!http://spiffyserver.com/images/spiffy-stores-logo.gif! | → | <p><img src="http://spiffyserver.com/images/spiffy-stores-logo.gif" alt="" /></p> |
URLs may be relative.
A title for the image can also be provided in parentheses, just before the closing exclamation mark.
!http://spiffyserver.com/images/spiffy-stores-logo.gif(Spiffy Logo)! | → | <p><img src="http://spiffyserver.com/images/spiffy-stores-logo.gif" title="Spiffy Logo" alt="Spiffy Logo" /></p> |
The title also acts as alt text should the image not be found.
Links can be attached to images with a colon.
!http://spiffyserver.com/images/spiffy-stores-logo.gif!:http://www.spiffystores.com/ | → | <p><a href="http://www.spiffystores.com/"><img src="http://spiffyserver.com/images/spiffy-stores-logo.gif" alt="" /></a></p> |
Image Alignments
Alignments can be applied as well to images.
!>http://spiffyserver.com/images/spiffy-stores-logo.gif! And others sat all round the small machine and paid it to sing to them. |
→ | <p style="float:right"><img src="http://spiffyserver.com/images/spiffy-stores-logo.gif" alt="" /></p> <p>And others sat all round the small machine and paid it to sing to them.</p> |
And others sat all round the small machine and paid it to sing to them. |
Acronyms
Definitions for acronyms can be provided by following an acronym with its definition in parentheses.
We use CSS(Cascading Style Sheets). | → | <p>We use <acronym title="Cascading Style Sheets">CSS</acronym>.</p> |
We use CSS. |
Tables
Simple tables can be built by separating fields with pipe characters.
| name | age | sex | | joan | 24 | f | | archie | 29 | m | | bella | 45 | f | |
→ | <table> <tr> <td> name </td> <td> age </td> <td> sex </td> </tr> <tr> <td> joan </td> <td> 24 </td> <td> f </td> </tr> <tr> <td> archie </td> <td> 29 </td> <td> m </td> </tr> <tr> <td> bella </td> <td> 45 </td> <td> f </td> </tr> </table> | ||||||||||||
|
Specify header cells by marking them with an underscore and period.
| _.name | _.age | _.sex | | joan | 24 | f | | archie | 29 | m | | bella | 45 | f | |
→ | <table> <tr> <th> name </th> <th> age </th> <th> sex </th> </tr> <tr> <td> joan </td> <td> 24 </td> <td> f </td> </tr> <tr> <td> archie </td> <td> 29 </td> <td> m </td> </tr> <tr> <td> bella </td> <td> 45 </td> <td> f </td> </tr> </table> | ||||||||||||
|
Cell Attributes
The period character, as used above, marks the end of a cell's attributes. Other attributes can be applied as well.
|_. attribute list | |<. align left | |>. align right| |=. center | |<>. justify | |^. valign top | |~. bottom | |
→ | <table> <tr> <th>attribute list </th> </tr> <tr> <td style="text-align:left;">align left </td> </tr> <tr> <td style="text-align:right;">align right</td> </tr> <tr> <td style="text-align:center;">center </td> </tr> <tr> <td style="text-align:justify;">justify </td> </tr> <tr> <td style="vertical-align:top;">valign top </td> </tr> <tr> <td style="vertical-align:bottom;">bottom </td> </tr> </table> | |||||||
|
You can also specify colspans with a backslash, followed by the cell width.
|\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> | ||||
|
A rowspan is specified by a forward slash, followed by the row height.
|/3. spans 3 rows | a | | b | | c | |
→ | <table> <tr> <td rowspan="3">spans 3 rows </td> <td> a </td> </tr> <tr> <td> b </td> </tr> <tr> <td> c </td> </tr> </table> | ||||
|
All block attributes can be applied to table cells as well.
|{background:#ddd}. Grey cell| | → | <table> <tr> <td style="background:#ddd;">Grey cell</td> </tr> </table> | |
|
Table and Row Attributes
Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period.
table{border:1px solid black}. |This|is|a|row| |This|is|a|row| |
→ | <table style="border:1px solid black;"> <tr> <td>This</td> <td>is</td> <td>a</td> <td>row</td> </tr> <tr> <td>This</td> <td>is</td> <td>a</td> <td>row</td> </tr> </table> | ||||||||
|
Attributes can be applied to a single row by supplying the attribute before the row starts, using a table
modifier and following it by a period.
|This|is|a|row| {background:#ddd}. |This|is|grey|row| |
→ | <table> <tr> <td>This</td> <td>is</td> <td>a</td> <td>row</td> </tr> <tr style="background:#ddd;"> <td>This</td> <td>is</td> <td>grey</td> <td>row</td> </tr> </table> | ||||||||
|