Changeset 267
- Timestamp:
- 03/15/2008 06:38:32 (8 months ago)
- Location:
- branches/superredcloth/test
- Files:
-
- 1 added
- 15 modified
-
code.yml (modified) (9 diffs)
-
definitions.yml (modified) (4 diffs)
-
extra_whitespace.yml (modified) (8 diffs)
-
helper.rb (modified) (1 diff)
-
hobix.yml (modified) (31 diffs)
-
html.yml (modified) (6 diffs)
-
images.yml (modified) (1 diff)
-
instiki.yml (modified) (3 diffs)
-
links.yml (modified) (1 diff)
-
lists.yml (modified) (9 diffs)
-
poignant.yml (modified) (1 diff)
-
table.yml (modified) (10 diffs)
-
test_formatters.rb (added)
-
test_parser.rb (modified) (1 diff)
-
textism.yml (modified) (17 diffs)
-
threshold.yml (modified) (43 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/superredcloth/test/code.yml
r265 r267 2 2 name: inline code 3 3 in: 'This is an empty dictionary: @{}@' 4 out: '<p>This is an empty dictionary: <code>{}</code></p>'4 html: '<p>This is an empty dictionary: <code>{}</code></p>' 5 5 --- 6 6 name: inline code escapement 7 7 in: 'Please type @cat "file.txt" > otherfile.txt@ at the prompt.' 8 out: '<p>Please type <code>cat "file.txt" > otherfile.txt</code> at the prompt.</p>'8 html: '<p>Please type <code>cat "file.txt" > otherfile.txt</code> at the prompt.</p>' 9 9 --- 10 10 name: escaping in blockcode 11 11 in: 'bc. This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.' 12 out: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.</code></pre>'12 html: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.</code></pre>' 13 13 --- 14 14 name: escaping in pre 15 15 in: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag in pre tags too.</code></pre>' 16 out: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag in pre tags too.</code></pre>'16 html: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag in pre tags too.</code></pre>' 17 17 --- 18 18 name: escaping in normal text 19 19 in: |- 20 20 This is a regular paragraph. AT&T. £38 > $38. 21 out: |-21 html: |- 22 22 <p>This is a regular paragraph. AT&T. £38 > $38.</p> 23 23 --- … … 25 25 in: "Math fact: 3 < 5 & 5 > 3 but £6 > $6. 26 26 " 27 out: "<p>Math fact: 3 < 5 & 5 > 3 but £6 > $6.</p>"27 html: "<p>Math fact: 3 < 5 & 5 > 3 but £6 > $6.</p>" 28 28 --- 29 29 name: escaping of existing entities in blockcode 30 30 in: "bc. Math fact: 3 < 5 & 5 > 3 but £5 > $5. 31 31 " 32 out: "<pre><code>Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;5 &#62; $5.</code></pre>"32 html: "<pre><code>Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;5 &#62; $5.</code></pre>" 33 33 --- 34 34 name: nested pre tags … … 45 45 </code> 46 46 </pre> 47 out: |-47 html: |- 48 48 <pre> 49 49 <code> … … 67 67 </code> 68 68 </pre> 69 out: |-69 html: |- 70 70 <pre> 71 71 <code> … … 79 79 in: |- 80 80 bc. __not italics__ 81 out: |-81 html: |- 82 82 <pre><code>__not italics__</code></pre> 83 83 --- … … 89 89 90 90 p. Back to normal. 91 out: |-91 html: |- 92 92 <p>Regular paragraph</p> 93 93 <p>Escaped portion -- will not be formatted by Textile at all</p> … … 99 99 # *test* 100 100 </notextile> 101 out: |-101 html: |- 102 102 103 103 # *test* … … 109 109 * and @x@ is also. 110 110 111 out: |-111 html: |- 112 112 <ul> 113 113 <li><code>foo</code></li> … … 126 126 127 127 p. And then go back with a normal paragraph. 128 out: |-128 html: |- 129 129 <p>If you have a line or two of code or <span class="caps">HTML</span> to embed, use extended block code like so:</p> 130 130 <pre><code>./foo.pl% -
branches/superredcloth/test/definitions.yml
r265 r267 6 6 - no:=no 7 7 - maybe:= yes 8 out: |-8 html: |- 9 9 <p>here is a RedCloth definition list:</p> 10 10 <dl> … … 23 23 - line-spanning 24 24 term := hey, slick! 25 out: |-25 html: |- 26 26 <dl> 27 27 <dt>term</dt> … … 40 40 - fabric 41 41 - cloth := woven threads 42 out: |-42 html: |- 43 43 <p>You can have multiple terms before a definition:</p> 44 44 <dl> … … 60 60 ok =: 61 61 - regular term := no 62 out: |-62 html: |- 63 63 <p>here is a long definition</p> 64 64 <dl> -
branches/superredcloth/test/extra_whitespace.yml
r265 r267 5 5 6 6 text 7 out: |-7 html: |- 8 8 <h1>Header</h1> 9 9 <p>text</p> … … 15 15 16 16 text 17 out: |-17 html: |- 18 18 <h1>Header</h1> 19 19 <p>text</p> … … 24 24 25 25 h1. Header 26 out: |-26 html: |- 27 27 <p>text</p> 28 28 <h1>Header</h1> … … 34 34 35 35 h1. Header 36 out: |-36 html: |- 37 37 <p>text</p> 38 38 <h1>Header</h1> … … 42 42 43 43 h1. Header 44 out: <h1>Header</h1>44 html: <h1>Header</h1> 45 45 --- 46 46 name: header with 2 blank lines above and with no text … … 49 49 50 50 h1. Header 51 out: <h1>Header</h1>51 html: <h1>Header</h1> 52 52 --- 53 53 name: header with 1 blank line below and with no text … … 55 55 h1. Header 56 56 57 out: <h1>Header</h1>57 html: <h1>Header</h1> 58 58 --- 59 59 name: header with 2 blank lines below and with no text … … 62 62 63 63 64 out: <h1>Header</h1>64 html: <h1>Header</h1> -
branches/superredcloth/test/helper.rb
r257 r267 3 3 require 'superredcloth' 4 4 require 'yaml' 5 6 def red(formatter, str) 7 SuperRedCloth.new(str).send("to_#{formatter}") 8 end 5 9 6 10 module Test -
branches/superredcloth/test/hobix.yml
r265 r267 6 6 7 7 Followed by another. 8 out: |-8 html: |- 9 9 <p>A single paragraph.</p> 10 10 <p>Followed by another.</p> … … 18 18 I am <b>very</b> serious. 19 19 </pre> 20 out: |-20 html: |- 21 21 <p>I am <b>very</b> serious.</p> 22 22 <pre> … … 29 29 I spoke. 30 30 And none replied. 31 out: |-31 html: |- 32 32 <p>I spoke.<br /> 33 33 And none replied.</p> … … 36 36 desc: Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye. 37 37 in: "\"Observe!\"" 38 out: <p>“Observe!”</p>38 html: <p>“Observe!”</p> 39 39 --- 40 40 name: double hyphens 41 41 desc: Double hyphens are replaced with an em-dash. 42 42 in: Observe--very nice! 43 out: <p>Observe—very nice!</p>43 html: <p>Observe—very nice!</p> 44 44 --- 45 45 name: double hyphens with spaces 46 46 desc: Double hyphens are replaced with an em-dash and surrounding spaces are preserved. 47 47 in: Observe -- very nice! 48 out: <p>Observe — very nice!</p>48 html: <p>Observe — very nice!</p> 49 49 --- 50 50 name: single hyphens with spaces 51 51 desc: Single hyphens are replaced with en-dashes if they are surrounded by spaces. 52 52 in: Observe - tiny and brief. 53 out: <p>Observe – tiny and brief.</p>53 html: <p>Observe – tiny and brief.</p> 54 54 --- 55 55 name: midword hyphens 56 56 desc: Single hyphens are left alone if not surrounded by spaces. 57 57 in: Observe the nicely-done hyphen. 58 out: <p>Observe the nicely-done hyphen.</p>58 html: <p>Observe the nicely-done hyphen.</p> 59 59 --- 60 60 name: ellipses 61 61 desc: Triplets of periods become an ellipsis. 62 62 in: Observe... 63 out: <p>Observe…</p>63 html: <p>Observe…</p> 64 64 --- 65 65 name: dimension sign 66 66 desc: The letter 'x' becomes a dimension sign when used between digits. 67 67 in: "Observe: 2x3." 68 out: "<p>Observe: 2×3.</p>"68 html: "<p>Observe: 2×3.</p>" 69 69 --- 70 70 name: dimension sign with spaces 71 71 in: "Observe: 2 x 4." 72 out: "<p>Observe: 2 × 4.</p>"72 html: "<p>Observe: 2 × 4.</p>" 73 73 --- 74 74 name: dimension signs chained 75 75 in: "Observe: 2x3x4." 76 out: "<p>Observe: 2×3×4.</p>"76 html: "<p>Observe: 2×3×4.</p>" 77 77 --- 78 78 name: trademark and copyright 79 79 desc: Conversion of trademark and copyright symbols. 80 80 in: one(TM), two(R), three(C). 81 out: <p>one™, two®, three©.</p>81 html: <p>one™, two®, three©.</p> 82 82 --- 83 83 name: headers 84 84 desc: To make an entire paragraph into a Header, place âh<em>n</em>.â at its beginning, where <em>n</em> is a number from 1-6. 85 85 in: h3. Header 3 86 out: <h3>Header 3</h3>86 html: <h3>Header 3</h3> 87 87 --- 88 88 name: blockquote … … 94 94 95 95 Any old text 96 out: |-96 html: |- 97 97 <p>Any old text</p> 98 98 <blockquote> … … 104 104 desc: Numeric references within text to footnotes appear between square brackets. 105 105 in: This is covered elsewhere[1]. 106 out: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p>106 html: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p> 107 107 --- 108 108 name: footnote 109 109 desc: 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. 110 110 in: fn1. Down here, in fact. 111 out: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p>111 html: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p> 112 112 --- 113 113 name: em 114 114 desc: Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as <em>italics</em>. 115 115 in: I _believe_ every word. 116 out: <p>I <em>believe</em> every word.</p>116 html: <p>I <em>believe</em> every word.</p> 117 117 --- 118 118 name: strong 119 119 desc: Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as <strong>bold</strong>. 120 120 in: And then? She *fell*! 121 out: <p>And then? She <strong>fell</strong>!</p>121 html: <p>And then? She <strong>fell</strong>!</p> 122 122 --- 123 123 name: force bold italics … … 126 126 I __know__. 127 127 I **really** __know__. 128 out: |-128 html: |- 129 129 <p>I <i>know</i>.<br /> 130 130 I <b>really</b> <i>know</i>.</p> … … 133 133 desc: Use double question marks to indicate <em>citation</em>. The title of a book, for instance. 134 134 in: ??Cat's Cradle?? by Vonnegut 135 out: <p><cite>Cat’s Cradle</cite> by Vonnegut</p>135 html: <p><cite>Cat’s Cradle</cite> by Vonnegut</p> 136 136 --- 137 137 name: code phrases 138 138 desc: Code phrases can be surrounded by at-symbols. 139 139 in: Convert with @r.to_html@ 140 out: <p>Convert with <code>r.to_html</code></p>140 html: <p>Convert with <code>r.to_html</code></p> 141 141 --- 142 142 name: del 143 143 desc: To indicate a passage which has been deleted, surround the passage with hypens. 144 144 in: I'm -sure- not sure. 145 out: <p>I’m <del>sure</del> not sure.</p>145 html: <p>I’m <del>sure</del> not sure.</p> 146 146 --- 147 147 name: ins 148 148 desc: Pluses around a passage indicate its insertion. 149 149 in: You are a +pleasant+ child. 150 out: <p>You are a <ins>pleasant</ins> child.</p>150 html: <p>You are a <ins>pleasant</ins> child.</p> 151 151 --- 152 152 name: superscript 153 153 desc: To superscript a phrase, surround with carets. 154 154 in: a ^2^ + b ^2^ = c ^2^ 155 out: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p>155 html: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p> 156 156 --- 157 157 name: subscript 158 158 desc: To subscript, surround with tildes. 159 159 in: log ~2~ x 160 out: <p>log <sub>2</sub> x</p>160 html: <p>log <sub>2</sub> x</p> 161 161 --- 162 162 name: span 163 163 desc: Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span. 164 164 in: I'm %unaware% of most soft drinks. 165 out: <p>I’m <span>unaware</span> of most soft drinks.</p>165 html: <p>I’m <span>unaware</span> of most soft drinks.</p> 166 166 --- 167 167 name: style span … … 170 170 I'm %{color:red}unaware% 171 171 of most soft drinks. 172 out: |-172 html: |- 173 173 <p>I’m <span style="color:red;">unaware</span><br /> 174 174 of most soft drinks.</p> … … 177 177 desc: A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block. 178 178 in: p(example1). An example 179 out: <p class="example1">An example</p>179 html: <p class="example1">An example</p> 180 180 --- 181 181 name: css id 182 182 desc: An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class. 183 183 in: p(#big-red). Red here 184 out: <p id="big-red">Red here</p>184 html: <p id="big-red">Red here</p> 185 185 --- 186 186 name: class and id combined 187 187 desc: Class and ID can be combined by placing the class first. 188 188 in: p(example1#big-red2). Red here 189 out: <p class="example1" id="big-red2">Red here</p>189 html: <p class="example1" id="big-red2">Red here</p> 190 190 --- 191 191 name: css style 192 192 desc: Style settings can be provided directly by surrounding them in curly braces. 193 193 in: p{color:blue;margin:30px}. Spacey blue 194 out: <p style="color:blue;margin:30px;">Spacey blue</p>194 html: <p style="color:blue;margin:30px;">Spacey blue</p> 195 195 --- 196 196 name: language designations 197 197 desc: Language designations can be given between angel brackets. 198 198 in: p[fr]. rouge 199 out: <p lang="fr">rouge</p>199 html: <p lang="fr">rouge</p> 200 200 --- 201 201 name: block attributes on phrase modifiers … … 206 206 corn stalk from my 207 207 %[es]cabeza%. 208 out: |-208 html: |- 209 209 <p>I seriously <strong style="color:red;">blushed</strong><br /> 210 210 when I <em class="big">sprouted</em> that<br /> … … 215 215 desc: Text inside blocks can be aligned in four basic ways. 216 216 in: p<>. justified 217 out: <p style="text-align:justify;">justified</p>217 html: <p style="text-align:justify;">justified</p> 218 218 --- 219 219 name: indentation 220 220 desc: 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. 221 221 in: p))). right ident 3em 222 out: <p style="padding-right:3em;">right ident 3em</p>222 html: <p style="padding-right:3em;">right ident 3em</p> 223 223 --- 224 224 name: indentation and alignment 225 225 desc: Identation may be coupled with alignment. 226 226 in: h2()>. Bingo. 227 out: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2>227 html: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2> 228 228 --- 229 229 name: many modifiers combined 230 230 desc: And, furthermore, coupled with language settings and CSS styles. 231 231 in: h3()>[no]{color:red}. Bingo 232 out: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3>232 html: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3> 233 233 --- 234 234 name: code blocks … … 240 240 </code> 241 241 </pre> 242 out: |-242 html: |- 243 243 <pre> 244 244 <code> … … 260 260 261 261 The main text of the page goes here and will stay to the left of the sidebar. 262 out: |-262 html: |- 263 263 <div style="float:right;"> 264 264 … … 276 276 # A second item 277 277 # A third 278 out: |-278 html: |- 279 279 <ol> 280 280 <li>A first item</li> … … 293 293 ## Water 294 294 ## Protein 295 out: |-295 html: |- 296 296 <ol> 297 297 <li>Fuel could be: … … 314 314 * A second item 315 315 * A third 316 out: |-316 html: |- 317 317 <ul> 318 318 <li>A first item</li> … … 331 331 ** Water 332 332 ** Protein 333 out: |-333 html: |- 334 334 <ul> 335 335 <li>Fuel could be: … … 349 349 desc: Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>. Place the descriptive phrase in quotation marks. Follow it immediately by a colon and the URL. 350 350 in: I searched "Google":http://google.com. 351 out: <p>I searched <a href="http://google.com">Google</a>.</p>351 html: <p>I searched <a href="http://google.com">Google</a>.</p> 352 352 --- 353 353 name: link aliases … … 359 359 360 360 [hobix]http://hobix.com 361 out: |-361 html: |- 362 362 <p>I am crazy about <a href="http://hobix.com">Hobix</a><br /> 363 363 and <a href="http://hobix.com">it’s</a> <a href="http://hobix.com">all</a> I ever<br /> … … 367 367 desc: You can embed an image in your Textile document by surrounding its URL with exclamation marks. 368 368 in: "!http://hobix.com/sample.jpg!" 369 out: <p><img src="http://hobix.com/sample.jpg" alt="" /></p>369 html: <p><img src="http://hobix.com/sample.jpg" alt="" /></p> 370 370 --- 371 371 name: image title 372 372 desc: A title for the image can also be provided in parens, just before the closing exclamation. 373 373 in: "!openwindow1.gif(Bunny.)!" 374 out: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p>374 html: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p> 375 375 --- 376 376 name: image links 377 377 desc: Links can be attached to images with a colon. 378 378 in: "!openwindow1.gif!:http://hobix.com/" 379 out: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p>379 html: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p> 380 380 --- 381 381 name: image alignments … … 386 386 And others sat all round the small 387 387 machine and paid it to sing to them. 388 out: |-388 html: |- 389 389 <p style="float:right;"><img src="obake.gif" alt="" /></p> 390 390 <p>And others sat all round the small<br /> … … 394 394 desc: Definitions for acronyms can be provided by following an acronym with its definition in parens. 395 395 in: We use CSS(Cascading Style Sheets). 396 out: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p>396 html: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p> 397 397 --- 398 398 name: tables … … 403 403 | archie | 29 | m | 404 404 | bella | 45 | f | 405 out: |-405 html: |- 406 406 <table> 407 407 <tr> … … 434 434 | archie | 29 | m | 435 435 | bella | 45 | f | 436 out: |-436 html: |- 437 437 <table> 438 438 <tr> … … 468 468 |^. valign top | 469 469 |~. bottom | 470 out: |-470 html: |- 471 471 <table> 472 472 <tr> … … 498 498 |\2. spans two cols | 499 499 | col 1 | col 2 | 500 out: |-500 html: |- 501 501 <table> 502 502 <tr> … … 515 515 | b | 516 516 | c | 517 out: |-517 html: |- 518 518 <table> 519 519 <tr> … … 532 532 desc: All block attributes can be applied to table cells as well. 533 533 in: "|{background:#ddd}. Grey cell|" 534 out