tartan 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README +130 -0
  3. data/TODO +17 -0
  4. data/lib/core_ext/array.rb +12 -0
  5. data/lib/core_ext/file.rb +15 -0
  6. data/lib/core_ext/hash.rb +16 -0
  7. data/lib/core_ext/match_data.rb +62 -0
  8. data/lib/core_ext/module.rb +17 -0
  9. data/lib/core_ext/regexp.rb +33 -0
  10. data/lib/markdown.yml +499 -0
  11. data/lib/symbolize.rb +78 -0
  12. data/lib/table.yml +63 -0
  13. data/lib/tartan.rb +359 -0
  14. data/lib/tartan_markdown.rb +8 -0
  15. data/lib/tartan_markdown_def.rb +7 -0
  16. data/lib/tartan_table_def.rb +7 -0
  17. data/lib/tartan_test_base_def.rb +5 -0
  18. data/lib/tartan_wikilink_def.rb +14 -0
  19. data/lib/test_base.yml +18 -0
  20. data/lib/wiki-test.rb +94 -0
  21. data/lib/wiki_rule.rb +240 -0
  22. data/lib/wikilink.yml +18 -0
  23. data/test/MarkdownTest_1.0/Amps and angle encoding.html +17 -0
  24. data/test/MarkdownTest_1.0/Amps and angle encoding.text +21 -0
  25. data/test/MarkdownTest_1.0/Auto links.html +18 -0
  26. data/test/MarkdownTest_1.0/Auto links.text +13 -0
  27. data/test/MarkdownTest_1.0/Backslash codeescapes.html +68 -0
  28. data/test/MarkdownTest_1.0/Backslash codeescapes.text +68 -0
  29. data/test/MarkdownTest_1.0/Backslash simpleescapes.html +33 -0
  30. data/test/MarkdownTest_1.0/Backslash simpleescapes.text +33 -0
  31. data/test/MarkdownTest_1.0/Blockquotes with code blocks.html +15 -0
  32. data/test/MarkdownTest_1.0/Blockquotes with code blocks.text +11 -0
  33. data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.html +8 -0
  34. data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.text +8 -0
  35. data/test/MarkdownTest_1.0/Horizontal rules.html +71 -0
  36. data/test/MarkdownTest_1.0/Horizontal rules.text +67 -0
  37. data/test/MarkdownTest_1.0/Inline HTML (Advanced).html +14 -0
  38. data/test/MarkdownTest_1.0/Inline HTML (Advanced).text +14 -0
  39. data/test/MarkdownTest_1.0/Inline HTML (Simple).html +72 -0
  40. data/test/MarkdownTest_1.0/Inline HTML (Simple).text +69 -0
  41. data/test/MarkdownTest_1.0/Inline HTML comments.html +13 -0
  42. data/test/MarkdownTest_1.0/Inline HTML comments.text +13 -0
  43. data/test/MarkdownTest_1.0/Links, inline style.html +9 -0
  44. data/test/MarkdownTest_1.0/Links, inline style.text +9 -0
  45. data/test/MarkdownTest_1.0/Links, reference style.html +18 -0
  46. data/test/MarkdownTest_1.0/Links, reference style.text +31 -0
  47. data/test/MarkdownTest_1.0/Literal quotes in titles.html +3 -0
  48. data/test/MarkdownTest_1.0/Literal quotes in titles.text +7 -0
  49. data/test/MarkdownTest_1.0/Markdown Documentation - Basics.html +314 -0
  50. data/test/MarkdownTest_1.0/Markdown Documentation - Basics.text +306 -0
  51. data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.html +942 -0
  52. data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.text +888 -0
  53. data/test/MarkdownTest_1.0/Nested blockquotes.html +9 -0
  54. data/test/MarkdownTest_1.0/Nested blockquotes.text +5 -0
  55. data/test/MarkdownTest_1.0/Ordered and unordered lists.html +137 -0
  56. data/test/MarkdownTest_1.0/Ordered and unordered lists.text +122 -0
  57. data/test/MarkdownTest_1.0/Strong and em together.html +7 -0
  58. data/test/MarkdownTest_1.0/Strong and em together.text +7 -0
  59. data/test/MarkdownTest_1.0/Tabs.html +25 -0
  60. data/test/MarkdownTest_1.0/Tabs.text +21 -0
  61. data/test/MarkdownTest_1.0/Tidyness.html +8 -0
  62. data/test/MarkdownTest_1.0/Tidyness.text +5 -0
  63. data/test/MarkdownTest_1.0/run-markdown.rb +56 -0
  64. data/test/MarkdownTest_1.0/test-fireball-markdown.rb +177 -0
  65. data/test/MarkdownTest_1.0/testdiff.rb +42 -0
  66. data/test/harder/test-markdown-harder.rb +11 -0
  67. data/test/harder/test-markdown-harder.yml +111 -0
  68. data/test/redcloth/redcloth-markdown-tests.rb +29 -0
  69. data/test/redcloth/redcloth-markdown-tests.yml +218 -0
  70. data/test/test-combo.rb +23 -0
  71. data/test/test-hash.rb +31 -0
  72. data/test/test-markdown.rb +11 -0
  73. data/test/test-markdown.yml +1144 -0
  74. data/test/test-match-data.rb +54 -0
  75. data/test/test-readme-example.rb +48 -0
  76. data/test/test-tables.rb +16 -0
  77. data/test/test-tables.yml +82 -0
  78. data/test/test-tartan-markdown.rb +11 -0
  79. data/test/test-tartan.rb +306 -0
  80. data/test/test-wikilink.rb +18 -0
  81. data/test/test-wikilink.yml +22 -0
  82. data/test/wikilink-test-helper.rb +14 -0
  83. metadata +139 -0
@@ -0,0 +1,18 @@
1
+ <p>Link: <a href="http://example.com/">http://example.com/</a>.</p>
2
+
3
+ <p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
4
+
5
+ <ul>
6
+ <li>In a list?</li>
7
+ <li><a href="http://example.com/">http://example.com/</a></li>
8
+ <li>It should.</li>
9
+ </ul>
10
+
11
+ <blockquote>
12
+ <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
13
+ </blockquote>
14
+
15
+ <p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
16
+
17
+ <pre><code>or here: &lt;http://example.com/&gt;
18
+ </code></pre>
@@ -0,0 +1,13 @@
1
+ Link: <http://example.com/>.
2
+
3
+ With an ampersand: <http://example.com/?foo=1&bar=2>
4
+
5
+ * In a list?
6
+ * <http://example.com/>
7
+ * It should.
8
+
9
+ > Blockquoted: <http://example.com/>
10
+
11
+ Auto-links should not occur here: `<http://example.com/>`
12
+
13
+ or here: <http://example.com/>
@@ -0,0 +1,68 @@
1
+ <p>These should not, because they occur within a code block:</p>
2
+
3
+ <pre><code>Backslash: \\
4
+
5
+ Backtick: \`
6
+
7
+ Asterisk: \*
8
+
9
+ Underscore: \_
10
+
11
+ Left brace: \{
12
+
13
+ Right brace: \}
14
+
15
+ Left bracket: \[
16
+
17
+ Right bracket: \]
18
+
19
+ Left paren: \(
20
+
21
+ Right paren: \)
22
+
23
+ Greater-than: \&gt;
24
+
25
+ Hash: \#
26
+
27
+ Period: \.
28
+
29
+ Bang: \!
30
+
31
+ Plus: \+
32
+
33
+ Minus: \-
34
+ </code></pre>
35
+
36
+ <p>Nor should these, which occur in code spans:</p>
37
+
38
+ <p>Backslash: <code>\\</code></p>
39
+
40
+ <p>Backtick: <code>\`</code></p>
41
+
42
+ <p>Asterisk: <code>\*</code></p>
43
+
44
+ <p>Underscore: <code>\_</code></p>
45
+
46
+ <p>Left brace: <code>\{</code></p>
47
+
48
+ <p>Right brace: <code>\}</code></p>
49
+
50
+ <p>Left bracket: <code>\[</code></p>
51
+
52
+ <p>Right bracket: <code>\]</code></p>
53
+
54
+ <p>Left paren: <code>\(</code></p>
55
+
56
+ <p>Right paren: <code>\)</code></p>
57
+
58
+ <p>Greater-than: <code>\&gt;</code></p>
59
+
60
+ <p>Hash: <code>\#</code></p>
61
+
62
+ <p>Period: <code>\.</code></p>
63
+
64
+ <p>Bang: <code>\!</code></p>
65
+
66
+ <p>Plus: <code>\+</code></p>
67
+
68
+ <p>Minus: <code>\-</code></p>
@@ -0,0 +1,68 @@
1
+ These should not, because they occur within a code block:
2
+
3
+ Backslash: \\
4
+
5
+ Backtick: \`
6
+
7
+ Asterisk: \*
8
+
9
+ Underscore: \_
10
+
11
+ Left brace: \{
12
+
13
+ Right brace: \}
14
+
15
+ Left bracket: \[
16
+
17
+ Right bracket: \]
18
+
19
+ Left paren: \(
20
+
21
+ Right paren: \)
22
+
23
+ Greater-than: \>
24
+
25
+ Hash: \#
26
+
27
+ Period: \.
28
+
29
+ Bang: \!
30
+
31
+ Plus: \+
32
+
33
+ Minus: \-
34
+
35
+
36
+ Nor should these, which occur in code spans:
37
+
38
+ Backslash: `\\`
39
+
40
+ Backtick: `` \` ``
41
+
42
+ Asterisk: `\*`
43
+
44
+ Underscore: `\_`
45
+
46
+ Left brace: `\{`
47
+
48
+ Right brace: `\}`
49
+
50
+ Left bracket: `\[`
51
+
52
+ Right bracket: `\]`
53
+
54
+ Left paren: `\(`
55
+
56
+ Right paren: `\)`
57
+
58
+ Greater-than: `\>`
59
+
60
+ Hash: `\#`
61
+
62
+ Period: `\.`
63
+
64
+ Bang: `\!`
65
+
66
+ Plus: `\+`
67
+
68
+ Minus: `\-`
@@ -0,0 +1,33 @@
1
+ <p>These should all get escaped:</p>
2
+
3
+ <p>Backslash: \</p>
4
+
5
+ <p>Backtick: `</p>
6
+
7
+ <p>Asterisk: *</p>
8
+
9
+ <p>Underscore: _</p>
10
+
11
+ <p>Left brace: {</p>
12
+
13
+ <p>Right brace: }</p>
14
+
15
+ <p>Left bracket: [</p>
16
+
17
+ <p>Right bracket: ]</p>
18
+
19
+ <p>Left paren: (</p>
20
+
21
+ <p>Right paren: )</p>
22
+
23
+ <p>Greater-than: ></p>
24
+
25
+ <p>Hash: #</p>
26
+
27
+ <p>Period: .</p>
28
+
29
+ <p>Bang: !</p>
30
+
31
+ <p>Plus: +</p>
32
+
33
+ <p>Minus: -</p>
@@ -0,0 +1,33 @@
1
+ These should all get escaped:
2
+
3
+ Backslash: \\
4
+
5
+ Backtick: \`
6
+
7
+ Asterisk: \*
8
+
9
+ Underscore: \_
10
+
11
+ Left brace: \{
12
+
13
+ Right brace: \}
14
+
15
+ Left bracket: \[
16
+
17
+ Right bracket: \]
18
+
19
+ Left paren: \(
20
+
21
+ Right paren: \)
22
+
23
+ Greater-than: \>
24
+
25
+ Hash: \#
26
+
27
+ Period: \.
28
+
29
+ Bang: \!
30
+
31
+ Plus: \+
32
+
33
+ Minus: \-
@@ -0,0 +1,15 @@
1
+ <blockquote>
2
+ <p>Example:</p>
3
+
4
+ <pre><code>sub status {
5
+ print "working";
6
+ }
7
+ </code></pre>
8
+
9
+ <p>Or:</p>
10
+
11
+ <pre><code>sub status {
12
+ return "working";
13
+ }
14
+ </code></pre>
15
+ </blockquote>
@@ -0,0 +1,11 @@
1
+ > Example:
2
+ >
3
+ > sub status {
4
+ > print "working";
5
+ > }
6
+ >
7
+ > Or:
8
+ >
9
+ > sub status {
10
+ > return "working";
11
+ > }
@@ -0,0 +1,8 @@
1
+ <p>In Markdown 1.0.0 and earlier. Version
2
+ 8. This line turns into a list item.
3
+ Because a hard-wrapped line in the
4
+ middle of a paragraph looked like a
5
+ list item.</p>
6
+
7
+ <p>Here's one with a bullet.
8
+ * criminey.</p>
@@ -0,0 +1,8 @@
1
+ In Markdown 1.0.0 and earlier. Version
2
+ 8. This line turns into a list item.
3
+ Because a hard-wrapped line in the
4
+ middle of a paragraph looked like a
5
+ list item.
6
+
7
+ Here's one with a bullet.
8
+ * criminey.
@@ -0,0 +1,71 @@
1
+ <p>Dashes:</p>
2
+
3
+ <hr />
4
+
5
+ <hr />
6
+
7
+ <hr />
8
+
9
+ <hr />
10
+
11
+ <pre><code>---
12
+ </code></pre>
13
+
14
+ <hr />
15
+
16
+ <hr />
17
+
18
+ <hr />
19
+
20
+ <hr />
21
+
22
+ <pre><code>- - -
23
+ </code></pre>
24
+
25
+ <p>Asterisks:</p>
26
+
27
+ <hr />
28
+
29
+ <hr />
30
+
31
+ <hr />
32
+
33
+ <hr />
34
+
35
+ <pre><code>***
36
+ </code></pre>
37
+
38
+ <hr />
39
+
40
+ <hr />
41
+
42
+ <hr />
43
+
44
+ <hr />
45
+
46
+ <pre><code>* * *
47
+ </code></pre>
48
+
49
+ <p>Underscores:</p>
50
+
51
+ <hr />
52
+
53
+ <hr />
54
+
55
+ <hr />
56
+
57
+ <hr />
58
+
59
+ <pre><code>___
60
+ </code></pre>
61
+
62
+ <hr />
63
+
64
+ <hr />
65
+
66
+ <hr />
67
+
68
+ <hr />
69
+
70
+ <pre><code>_ _ _
71
+ </code></pre>
@@ -0,0 +1,67 @@
1
+ Dashes:
2
+
3
+ ---
4
+
5
+ ---
6
+
7
+ ---
8
+
9
+ ---
10
+
11
+ ---
12
+
13
+ - - -
14
+
15
+ - - -
16
+
17
+ - - -
18
+
19
+ - - -
20
+
21
+ - - -
22
+
23
+
24
+ Asterisks:
25
+
26
+ ***
27
+
28
+ ***
29
+
30
+ ***
31
+
32
+ ***
33
+
34
+ ***
35
+
36
+ * * *
37
+
38
+ * * *
39
+
40
+ * * *
41
+
42
+ * * *
43
+
44
+ * * *
45
+
46
+
47
+ Underscores:
48
+
49
+ ___
50
+
51
+ ___
52
+
53
+ ___
54
+
55
+ ___
56
+
57
+ ___
58
+
59
+ _ _ _
60
+
61
+ _ _ _
62
+
63
+ _ _ _
64
+
65
+ _ _ _
66
+
67
+ _ _ _
@@ -0,0 +1,14 @@
1
+ <p>Simple block on one line:</p>
2
+
3
+ <div>foo</div>
4
+
5
+ <p>And nested without indentation:</p>
6
+
7
+ <div>
8
+ <div>
9
+ <div>
10
+ foo
11
+ </div>
12
+ </div>
13
+ <div>bar</div>
14
+ </div>