View script | License | Download documentation as: HTML or editable |
Download script | History | Other scripts by: brianwisti |
30-Apr 14:32 UTC
[0.046] 25.27k
[0.046] 25.27k
Documentation for: textile.rFor lack of real documentation, here is the output from the test I run (using test-simple.r, in case you're curious): Block Creation and Definition: 9/9 passed 1 OK p. marks a paragraph Expected: <"<p>Dude</p>"> Got: <"<p>Dude</p>"> 2 OK h1. marks a level 1 header Expected: <"<h1>Dude</h1>"> Got: <"<h1>Dude</h1>"> 3 OK h2. marks a level 2 header Expected: <"<h2>Dude</h2>"> Got: <"<h2>Dude</h2>"> 4 OK h3. marks a level 3 header Expected: <"<h3>Dude</h3>"> Got: <"<h3>Dude</h3>"> 5 OK h4. marks a level 4 header Expected: <"<h4>Dude</h4>"> Got: <"<h4>Dude</h4>"> 6 OK h5. marks a level 5 header Expected: <"<h5>Dude</h5>"> Got: <"<h5>Dude</h5>"> 7 OK h6. marks a level 6 header Expected: <"<h6>Dude</h6>"> Got: <"<h6>Dude</h6>"> 8 OK bc. marks a block of code Expected: <"<code>$dude</code>"> Got: <"<code>$dude</code>"> 9 OK bq. marks a quoted block Expected: <"<blockquote><p>Sweet!</p></blockquote>"> Got: <"<blockquote><p>Sweet!</p></blockquote>"> Default Block Behavior: 5/5 passed 1 OK A normal line is turned into a paragraph. Expected: <"<p>Dude!</p>"> Got: <"<p>Dude!</p>"> 2 OK Only recognized tag markers are transformed into tags. Expected: <"<p>Dude. Sweet!</p>"> Got: <"<p>Dude. Sweet!</p>"> 3 OK Paragraphs are separated by empty lines Expected: <"<p>Dude!</p><p>Sweet!</p>"> Got: <"<p>Dude!</p><p>Sweet!</p>"> 4 OK (double-checking paragraph-separation) Expected: <"<p>Dude!</p><p>Sweet!</p><p>Dude!</p>"> Got: <"<p>Dude!</p><p>Sweet!</p><p>Dude!</p>"> 5 OK A normal line is turned into a paragraph even if the previous paragraph was another tag Expected: <"<h2>Dude!</h2><p>Sweet!</p>"> Got: <"<h2>Dude!</h2><p>Sweet!</p>"> Block Modifiers: 17/17 passed 1 OK Use 'p{rules}. ' to create inline CSS definitions Expected: <"<p style='text-align: center;'>Dude?</p>"> Got: <"<p style='text-align: center;'>Dude?</p>"> 2 OK Style rules can span multiple lines Expected: <{<p style='margin: 1em; color: red;'>Rebol is nifty.</p>}> Got: <{<p style='margin: 1em;^/color: red;'>Rebol is nifty.</p>}> 3 OK Use 'p[lang]. ' to declare a language for the block Expected: <"<p lang='fr'>Doux!</p>"> Got: <"<p lang='fr'>Doux!</p>"> 4 OK Use 'p(class). ' to declare a CSS class for your element Expected: <"<p class='note'>Sweet.</p>"> Got: <"<p class='note'>Sweet.</p>"> 5 OK Style declarations work for non-paragraph tags, too. Expected: <"<h1 class='title'>Yo</h1>"> Got: <"<h1 class='title'>Yo</h1>"> 6 OK Use '#id' in a class declaration to declare an ID for the element. Expected: <"<p id='abstract'>Stuff.</p>"> Got: <"<p id='abstract'>Stuff.</p>"> 7 OK Use 'class#id' in a class declaration to indicate both CSS class and ID Expected: <"<p class='warn' id='abstract'>Other stuff.</p>"> Got: <"<p class='warn' id='abstract'>Other stuff.</p>"> 8 OK 'p>. ' is shorthand for right alignment of a paragraph. Expected: <"<p style='text-align: right;'>Align Right</p>"> Got: <"<p style='text-align: right;'>Align Right</p>"> 9 OK 'p<. ' is shorthand for left alignment. Expected: <"<p style='text-align: left;'>Align Left</p>"> Got: <"<p style='text-align: left;'>Align Left</p>"> 10 OK 'p=. ' is shorthand for center alignment Expected: <"<p style='text-align: center;'>Align Center</p>"> Got: <"<p style='text-align: center;'>Align Center</p>"> 11 OK 'p<>. ' is shorthand for justified alignment. Expected: <"<p style='text-align: justify;'>Justify</p>"> Got: <"<p style='text-align: justify;'>Justify</p>"> 12 OK 'p(. ' is shorthand for a 1em left margin. Expected: <"<p style='margin-left: 1em;'>Left Margin</p>"> Got: <"<p style='margin-left: 1em;'>Left Margin</p>"> 13 OK Each unmatched '(' adds 1em to left margin Expected: <"<p style='margin-left: 2em;'>Left Margin</p>"> Got: <"<p style='margin-left: 2em;'>Left Margin</p>"> 14 OK 'p). ' is shorthand for a 1em right margin Expected: <"<p style='margin-right: 1em;'>Right Margin</p>"> Got: <"<p style='margin-right: 1em;'>Right Margin</p>"> 15 OK Each unmatched ')' adds 1em to right margin Expected: <"<p style='margin-right: 2em;'>Right Margin</p>"> Got: <"<p style='margin-right: 2em;'>Right Margin</p>"> 16 OK 'p|rebol|. ' will filter the block through rebol before formatting. Expected: <"<p>16-Jun-2006</p>"> Got: <"<p>16-Jun-2006</p>"> 17 OK (double-checking rebol filter) Expected: <"<p>7</p>"> Got: <"<p>7</p>"> Handling entities: 2/2 passed 1 OK < and > are not touched in normal text. Expected: <"<p>1<hr />2</p>"> Got: <"<p>1<hr />2</p>"> 2 OK < and > are escaped in code blocks Expected: <"<code><hr /></code>"> Got: <"<code><hr /></code>"> Handling newlines: 2/2 passed 1 OK Newlines in paragraphs are converted to <br /> tags by default Expected: <"<p>1<br />2</p>"> Got: <"<p>1<br />2</p>"> 2 OK Newlines in paragraphs are converted to spaces if 'textile/collapse?' is true Allowing extended blocks: 1/1 passed 1 OK 'bq.. ' forces following blocks to be part of the declared block until a new declaration is reached Expected: <{<blockquote><p>One</p><p>Two</p></blockquote><p>Three</p>}> Got: <{<blockquote><p>One</p><p>Two</p></blockquote><p>Three</p>}> Inline formatting: 23/23 passed 1 OK *strong* text Expected: <"<p>This is <strong>strong</strong> text.</p>"> Got: <"<p>This is <strong>strong</strong> text.</p>"> 2 OK a marker by itself cannot induce formatting Expected: <"<p>This is * not strong text.</p>"> Got: <"<p>This is * not strong text.</p>"> 3 OK _emphasized_ text Expected: <"<p>This is <em>emphasized</em> text.</p>"> Got: <"<p>This is <em>emphasized</em> text.</p>"> 4 OK @code@ text Expected: <"<p>This is <code>code</code> text.</p>"> Got: <"<p>This is <code>code</code> text.</p>"> 5 OK --small-- text Expected: <"<p>This is <small>small</small> text.</p>"> Got: <"<p>This is <small>small</small> text.</p>"> 6 OK **bold** text Expected: <"<p>This is <b>bold</b> text.</p>"> Got: <"<p>This is <b>bold</b> text.</p>"> 7 OK __italic__ text Expected: <"<p>This is <i>italicized</i> text.</p>"> Got: <"<p>This is <i>italicized</i> text.</p>"> 8 OK ++bigger++ text Expected: <"<p>This is <big>bigger</big> text.</p>"> Got: <"<p>This is <big>bigger</big> text.</p>"> 9 OK -deleted- text Expected: <"<p>This is <del>deleted</del> text</p>"> Got: <"<p>This is <del>deleted</del> text</p>"> 10 OK +inserted+ text Expected: <"<p>This is <ins>inserted</ins> text</p>"> Got: <"<p>This is <ins>inserted</ins> text</p>"> 11 OK %span% text Expected: <"<p>Text in a <span>span</span></p>"> Got: <"<p>Text in a <span>span</span></p>"> 12 OK ~subscripted~ text Expected: <"<p>Text in <sub>subscript</sub></p>"> Got: <"<p>Text in <sub>subscript</sub></p>"> 13 OK ^superscripted^ text Expected: <"<p>Look <sup>up here</sup>!</p>"> Got: <"<p>Look <sup>up here</sup>!</p>"> 14 OK Different markups may be nested. Expected: <{<p>This is <strong>strong and <em>emphasized</em> text.</strong></p>}> Got: <{<p>This is <strong>strong and <em>emphasized</em> text.</strong></p>}> 15 OK Inline markups require whitespace. Expected: <"<p>This funky_text_here is not affected.</p>"> Got: <"<p>This funky_text_here is not affected.</p>"> 16 OK Inline markup may end a line Expected: <"<p>My text is <strong>powerful</strong></p>"> Got: <"<p>My text is <strong>powerful</strong></p>"> 17 OK Inline markup may begin a line Expected: <"<p><strong>My</strong> text is powerful</p>"> Got: <"<p><strong>My</strong> text is powerful</p>"> 18 OK A whole line may be marked up Expected: <"<p><strong>text</strong></p>"> Got: <"<p><strong>text</strong></p>"> 19 OK Inline markup may have style directives. Expected: <{<p>This <strong style='color: red;'>word</strong> is red.</p>}> Got: <{<p>This <strong style='color: red;'>word</strong> is red.</p>}> 20 OK Expected: <{<P>This <span class='note'>tidbit</span> is a note.</p>}> Got: <{<p>This <span class='note'>tidbit</span> is a note.</p>}> 21 OK inline style declarations work if the paragraph is implicit. Expected: <{<p>This <span class='note'>tidbit</span> is a note.</p>}> Got: <{<p>This <span class='note'>tidbit</span> is a note.</p>}> 22 OK Inline markup may be directly nested against each other. Expected: <{<p>Textile is <strong><em>way</em></strong> cool.</p>}> Got: <{<p>Textile is <strong><em>way</em></strong> cool.</p>}> 23 OK Rampant asterisks are usually ignored Expected: <{<p>***********************************************</p>}> Got: <{<p>***********************************************</p>}> Footnotes: 3/3 passed 1 OK Link to footnote 'n' with [n] Expected: <{<p>Foot<sup class='footnote'><a href='#fn1'>1</a></sup></p>}> Got: <{<p>Foot<sup class='footnote'><a href='#fn1'>1</a></sup></p>}> 2 OK Label footnote N with fnN. Expected: <"<p class='footnote' id='fn1'><sup>1</sup> Note</p>"> Got: <"<p class='footnote' id='fn1'><sup>1</sup> Note</p>"> 3 OK Expected: <"<p class='footnote' id='fn2'><sup>2</sup> Note</p>"> Got: <"<p class='footnote' id='fn2'><sup>2</sup> Note</p>"> Images: 5/5 passed 1 OK Images are identified by !image-file! Expected: <{<p><img src='reb-logo.gif' alt='' width='176' height='44' /></p>}> Got: <{<p><img src='reb-logo.gif' alt='' width='176' height='44' /></p>}> 2 OK Textile will provide what information it can about height and width, or leave it out. Expected: <"<p><img src='sdk-logo.gif' alt='' /></p>"> Got: <"<p><img src='sdk-logo.gif' alt='' /></p>"> 3 OK You can use a WxH pair to force width and height values Expected: <{<p><img src='reb-logo.gif' alt='' width='10' height='20' /></p>}> Got: <{<p><img src='reb-logo.gif' alt='' width='10' height='20' /></p>}> 4 OK Embed alt attributes in parens Expected: <"<p><img src='sdk-logo.gif' alt='SDK' /></p>"> Got: <"<p><img src='sdk-logo.gif' alt='SDK' /></p>"> 5 OK CSS information may be associated with images Expected: <{<p><img src='sdk-logo.gif' alt='SDK' class='external' /></p>}> Got: <{<p><img src='sdk-logo.gif' alt='SDK' class='external' /></p>}> Character Replacements: 3/3 passed 1 OK (c) is converted to the Copyright entity Expected: <"<p>© 55 BC Julius Caesar</p>"> Got: <"<p>© 55 BC Julius Caesar</p>"> 2 OK (r) is converted to the registered sign Expected: <"<p>® Registered</p>"> Got: <"<p>® Registered</p>"> 3 OK (tm) is converted to the trademark entity Expected: <"<p>™ Trademark</p>"> Got: <"<p>™ Trademark</p>"> Lists: 8/9 passed 1 OK '* ' marks an element in an unordered list Expected: <"<ul><li>A</li></ul>"> Got: <"<ul><li>A</li></ul>"> 2 OK Items in the same list are separated by a single newline Expected: <"<ul><li>A</li><li>B</li></ul>"> Got: <"<ul><li>A</li><li>B</li></ul>"> 3 OK A list item can span multiple lines (creating hard breaks by default) Expected: <"<ul><li>A<br />a</li><li>B</li></ul>"> Got: <"<ul><li>A<br />a</li><li>B</li></ul>"> 4 OK Multi-line list items are collapsed into a single line if textile/collapse? is true Expected: <"<ul><li>A a</li><li>B</li></ul>"> Got: <"<ul><li>A a</li><li>B</li></ul>"> 5 OK '# ' Marks an element in an ordered list Expected: <"<ol><li>A</li></ol>"> Got: <"<ol><li>A</li></ol>"> 6 OK Expected: <"<ol><li>A</li><li>B</li></ol>"> Got: <"<ol><li>A</li><li>B</li></ol>"> 7 OK If textile/process finds a '*' beginning a line of an ordered list, it's wrapped to the current item Expected: <"<ol><li>A<br />* B</li></ol>"> Got: <"<ol><li>A<br />* B</li></ol>"> 8 OK If textile/process finds a '*' beginning a line of an unordered list, it's wrapped to the current item Expected: <"<ul><li>A<br /># B</li></ul>"> Got: <"<ul><li>A<br /># B</li></ul>"> 9 Not OK Use '** ' to indicate a nested list Expected: <"<ul><li><ul><li>A</li></ul></li></ul>"> Got: <"<ul><li>A</li></ul>"> |