tartan 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/History.txt +11 -0
  2. data/Manifest.txt +42 -0
  3. data/{README → README.txt} +12 -8
  4. data/Rakefile +78 -0
  5. data/lib/core_ext/array.rb +9 -10
  6. data/lib/core_ext/module.rb +2 -0
  7. data/lib/{symbolize.rb → core_ext/symbolize.rb} +0 -0
  8. data/lib/core_ext.rb +7 -0
  9. data/lib/{markdown.yml → tartan/markdown/markdown.yml} +67 -25
  10. data/lib/tartan/markdown/rules.rb +11 -0
  11. data/lib/tartan/markdown.rb +14 -0
  12. data/lib/tartan/table/rules.rb +11 -0
  13. data/lib/{table.yml → tartan/table/table.yml} +1 -1
  14. data/lib/tartan/test/base_rules.rb +9 -0
  15. data/lib/{test_base.yml → tartan/test/test_base.yml} +0 -0
  16. data/lib/{wiki-test.rb → tartan/test/wiki-test.rb} +15 -12
  17. data/lib/tartan/wiki_rule.rb +242 -0
  18. data/lib/tartan/wikilink/rules.rb +18 -0
  19. data/lib/{wikilink.yml → tartan/wikilink/wikilink.yml} +4 -2
  20. data/lib/tartan.rb +259 -270
  21. data/test/test-combo.rb +21 -14
  22. data/test/test-combo.yml +17 -0
  23. data/test/test-markdown-and-wikilink.rb +22 -0
  24. data/test/test-markdown-and-wikilink.yml +6 -0
  25. data/test/test-markdown.rb +4 -5
  26. data/test/test-markdown.yml +194 -1
  27. data/test/test-readme-example.rb +6 -5
  28. data/test/test-tables.rb +11 -7
  29. data/test/test-tartan.rb +8 -7
  30. data/test/test-wikilink.rb +13 -9
  31. data/test/test-wikilink.yml +3 -0
  32. metadata +47 -86
  33. data/lib/tartan_markdown.rb +0 -8
  34. data/lib/tartan_markdown_def.rb +0 -7
  35. data/lib/tartan_table_def.rb +0 -7
  36. data/lib/tartan_test_base_def.rb +0 -5
  37. data/lib/tartan_wikilink_def.rb +0 -14
  38. data/lib/wiki_rule.rb +0 -240
  39. data/test/MarkdownTest_1.0/Amps and angle encoding.html +0 -17
  40. data/test/MarkdownTest_1.0/Amps and angle encoding.text +0 -21
  41. data/test/MarkdownTest_1.0/Auto links.html +0 -18
  42. data/test/MarkdownTest_1.0/Auto links.text +0 -13
  43. data/test/MarkdownTest_1.0/Backslash codeescapes.html +0 -68
  44. data/test/MarkdownTest_1.0/Backslash codeescapes.text +0 -68
  45. data/test/MarkdownTest_1.0/Backslash simpleescapes.html +0 -33
  46. data/test/MarkdownTest_1.0/Backslash simpleescapes.text +0 -33
  47. data/test/MarkdownTest_1.0/Blockquotes with code blocks.html +0 -15
  48. data/test/MarkdownTest_1.0/Blockquotes with code blocks.text +0 -11
  49. data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.html +0 -8
  50. data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.text +0 -8
  51. data/test/MarkdownTest_1.0/Horizontal rules.html +0 -71
  52. data/test/MarkdownTest_1.0/Horizontal rules.text +0 -67
  53. data/test/MarkdownTest_1.0/Inline HTML (Advanced).html +0 -14
  54. data/test/MarkdownTest_1.0/Inline HTML (Advanced).text +0 -14
  55. data/test/MarkdownTest_1.0/Inline HTML (Simple).html +0 -72
  56. data/test/MarkdownTest_1.0/Inline HTML (Simple).text +0 -69
  57. data/test/MarkdownTest_1.0/Inline HTML comments.html +0 -13
  58. data/test/MarkdownTest_1.0/Inline HTML comments.text +0 -13
  59. data/test/MarkdownTest_1.0/Links, inline style.html +0 -9
  60. data/test/MarkdownTest_1.0/Links, inline style.text +0 -9
  61. data/test/MarkdownTest_1.0/Links, reference style.html +0 -18
  62. data/test/MarkdownTest_1.0/Links, reference style.text +0 -31
  63. data/test/MarkdownTest_1.0/Literal quotes in titles.html +0 -3
  64. data/test/MarkdownTest_1.0/Literal quotes in titles.text +0 -7
  65. data/test/MarkdownTest_1.0/Markdown Documentation - Basics.html +0 -314
  66. data/test/MarkdownTest_1.0/Markdown Documentation - Basics.out +0 -316
  67. data/test/MarkdownTest_1.0/Markdown Documentation - Basics.text +0 -306
  68. data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.html +0 -942
  69. data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.out +0 -947
  70. data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.text +0 -888
  71. data/test/MarkdownTest_1.0/Nested blockquotes.html +0 -9
  72. data/test/MarkdownTest_1.0/Nested blockquotes.text +0 -5
  73. data/test/MarkdownTest_1.0/Ordered and unordered lists.html +0 -137
  74. data/test/MarkdownTest_1.0/Ordered and unordered lists.text +0 -122
  75. data/test/MarkdownTest_1.0/Strong and em together.html +0 -7
  76. data/test/MarkdownTest_1.0/Strong and em together.text +0 -7
  77. data/test/MarkdownTest_1.0/Tabs.html +0 -25
  78. data/test/MarkdownTest_1.0/Tabs.text +0 -21
  79. data/test/MarkdownTest_1.0/Tidyness.html +0 -8
  80. data/test/MarkdownTest_1.0/Tidyness.text +0 -5
  81. data/test/MarkdownTest_1.0/run-markdown.rb +0 -56
  82. data/test/MarkdownTest_1.0/test-fireball-markdown.rb +0 -177
  83. data/test/MarkdownTest_1.0/testdiff.rb +0 -42
  84. data/test/harder/test-markdown-harder.rb +0 -11
  85. data/test/harder/test-markdown-harder.yml +0 -111
  86. data/test/redcloth/redcloth-markdown-tests.rb +0 -29
  87. data/test/redcloth/redcloth-markdown-tests.yml +0 -218
  88. data/test/test-tartan-markdown.rb +0 -11
@@ -1,111 +0,0 @@
1
- #$Id: test-markdown-harder.yml 161 2006-05-20 11:19:30Z larry $
2
- ---
3
- # Fails
4
- title: MixedListsSpaced
5
- in: |-
6
- 1. First
7
-
8
- 2. Second:
9
-
10
- * Fee
11
- * Fie
12
- * Foe
13
-
14
- 3. Third
15
- html: |-
16
- <ol>
17
- <li><p>First</p></li>
18
- <li><p>Second:</p><ul>
19
-
20
- <li>Fee</li>
21
- <li>Fie</li>
22
- <li>Foe</li>
23
- </ul></li>
24
- <li><p>Third</p></li>
25
- </ol>
26
- ---
27
- # Fails
28
- title: LinkWithAmpInURL
29
- in: |-
30
- A [link] [1] with an ampersand in the URL.
31
-
32
- [1]: http://example.com/?foo=1&bar=2
33
- [2]: http://att.com/ "AT&T"
34
- html: |-
35
- <p>A <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an ampersand in the URL.</p>
36
- ---
37
- # Fails
38
- title: AmpInLinkText
39
- in: |-
40
- A link with an amersand in the link text: [AT&T] [2].
41
-
42
- [1]: http://example.com/?foo=1&bar=2
43
- [2]: http://att.com/ "AT&T"
44
- html: |-
45
- <p>A link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
46
- ---
47
- # Fails
48
- title: AmpInInlineLink
49
- in: "An inline [link](</script?foo=1&bar=2>)."
50
- html: |-
51
- <p>An inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
52
- ---
53
- # Fails
54
- title: Tidyness
55
- in: |-
56
- > A list within a blockquote:
57
- >
58
- > * asterisk 1
59
- > * asterisk 2
60
- > * asterisk 3
61
- html: |-
62
- <blockquote>
63
- <p>A list within a blockquote:</p>
64
- <ul>
65
- <li>asterisk 1</li>
66
- <li>asterisk 2</li>
67
- <li>asterisk 3</li>
68
- </ul>
69
- </blockquote>
70
- ---
71
- # Fails
72
- title: Links
73
- in: |-
74
- Here's a [link] [1] with an ampersand in the URL.
75
-
76
- Here's a link with an amersand in the link text: [AT&T] [2].
77
-
78
- [1]: http://example.com/?foo=1&bar=2
79
- [2]: http://att.com/ "AT&T"
80
- html: |-
81
- <p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an amper
82
- sand in the URL.</p>
83
-
84
- <p>Here's a link with an amersand in the link text: <a href="http://att.com/" ti
85
- tle="AT&amp;T">AT&amp;T</a>.</p>
86
- ---
87
- # Fails
88
- title: InlineLinks
89
- in: |-
90
- Here's an inline [link](/script?foo=1&bar=2).
91
-
92
- Here's an inline [link](</script?foo=1&bar=2>).
93
- html: |-
94
- <p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
95
-
96
- <p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
97
- ---
98
- # Fails
99
- title: BackslashQuotingInCodeBlock
100
- in: |-
101
- These should not, because they occur within a code block:
102
-
103
- Backslash: \\
104
-
105
- Backtick: \`
106
- html: |-
107
- <p>These should not, because they occur within a code block:</p>
108
- <pre><code>
109
- Backslash: \\
110
-
111
- Backtick: \`
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #$Id: redcloth-markdown-tests.rb 148 2006-07-22 14:04:20Z larry $
3
-
4
- # Adapted from the Redcloth tests
5
-
6
- $:.unshift File.join(File.dirname(__FILE__), "../..", "lib")
7
-
8
- require 'yaml'
9
- require 'markdown'
10
- require 'tartan'
11
-
12
- Dir["./redcloth*.yml"].each do |testfile|
13
- YAML::load_documents( File.open( testfile ) ) do |doc|
14
- if doc['in'] and doc['out']
15
- wp = Wikiparser.new( doc['in'] )
16
- html = wp.to_html
17
- puts "---"
18
-
19
- html.gsub!( /\n+/, "\n" )
20
- doc['out'].gsub!( /\n+/, "\n" )
21
- if html == doc['out']
22
- puts "success: true"
23
- else
24
- puts "expected: "; p doc['out']
25
- puts "out: "; p html
26
- end
27
- end
28
- end
29
- end
@@ -1,218 +0,0 @@
1
- in: |
2
- This is a regular paragraph.
3
-
4
- <table>
5
- <tr>
6
- <td>Foo</td>
7
- </tr>
8
- </table>
9
-
10
- This is another regular paragraph.
11
- html: |-
12
- <p>This is a regular paragraph.</p>
13
-
14
-
15
- <table>
16
- <tr>
17
- <td>Foo</td>
18
- </tr>
19
- </table>
20
- <p>This is another regular paragraph.</p>
21
- ---
22
- in: '"Larry Bird":http://images.google.com/images?num=30&q=larry+bird'
23
- html: '<p>"Larry Bird":http://images.google.com/images?num=30&#38;q=larry+bird</p>'
24
- ---
25
- in: '&copy;'
26
- html: <p>&copy;</p>
27
- ---
28
- in: AT&T
29
- html: <p>AT&#38;T</p>
30
-
31
- # We don't do this.
32
- # ---
33
- # in: 4 < 5
34
- # out: 4 &lt; 5
35
- ---
36
- in: |
37
- This is an H1
38
- =============
39
-
40
- This is an H2
41
- -------------
42
- html: |-
43
- <h1>This is an H1</h1>
44
-
45
- <h2>This is an H2</h2>
46
- ---
47
- in: |
48
- # This is an H1
49
-
50
- ## This is an H2
51
-
52
- ###### This is an H6
53
- html: |-
54
- <h1>This is an H1</h1>
55
-
56
- <h2>This is an H2</h2>
57
-
58
- <h6>This is an H6</h6>
59
- ---
60
- in: |
61
- > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
62
- > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
63
- > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
64
- >
65
- > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
66
- > id sem consectetuer libero luctus adipiscing.
67
- html: |-
68
- <blockquote>
69
- <p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
70
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
71
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
72
-
73
- <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
74
- id sem consectetuer libero luctus adipiscing.</p>
75
-
76
- </blockquote>
77
- ---
78
- in: |
79
- > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
80
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
81
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
82
- >
83
- > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
84
- id sem consectetuer libero luctus adipiscing.
85
- html: |-
86
- <blockquote>
87
- <p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
88
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
89
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
90
-
91
- <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
92
- id sem consectetuer libero luctus adipiscing.</p>
93
-
94
- </blockquote>
95
- ---
96
- in: |
97
- > This is the first level of quoting.
98
- >
99
- > > This is nested blockquote.
100
- >
101
- > Back to the first level.
102
- html: |-
103
- <blockquote>
104
- <p>This is the first level of quoting.</p>
105
- <blockquote>
106
- <p>This is nested blockquote.</p>
107
-
108
- </blockquote>
109
-
110
-
111
-
112
- <p>Back to the first level.</p>
113
-
114
- </blockquote>
115
- ---
116
- in: |
117
- > ## This is a header.
118
- >
119
- > 1. This is the first list item.
120
- > 2. This is the second list item.
121
- >
122
- > Here's some example code:
123
- >
124
- > return shell_exec("echo $input | $markdown_script");
125
- html: |-
126
- <blockquote>
127
- <h2>This is a header.</h2>
128
-
129
-
130
-
131
- <p>1. This is the first list item.
132
- 2. This is the second list item.</p>
133
-
134
- <p>Here's some example code:</p>
135
- <pre><code>return shell_exec("echo $input | $markdown_script");</code></pre>
136
-
137
- </blockquote>
138
- ---
139
- in: |
140
- * * *
141
-
142
- ***
143
-
144
- *****
145
-
146
- - - -
147
-
148
- ---------------------------------------
149
-
150
- _ _ _
151
- html: |-
152
- <hr />
153
-
154
- <hr />
155
-
156
- <hr />
157
-
158
- <hr />
159
-
160
- <hr />
161
-
162
- <hr />
163
- ---
164
- in: |
165
- This is [an example](http://example.com/ "Title") inline link.
166
-
167
- [This link](http://example.net/) has no title attribute.
168
- html: |-
169
- <p>This is <a href="http://example.com/" title="Title">an example</a> inline link.</p>
170
-
171
- <p><a href="http://example.net/">This link</a> has no title attribute.</p>
172
- ---
173
- in: See my [About](/about/) page for details.
174
- html: <p>See my <a href="/about/">About</a> page for details.</p>
175
- ---
176
- in: |
177
- This is [an example][id] reference-style link.
178
-
179
- This is [an example] [id] reference-style link.
180
-
181
- [id]: http://example.com/ "Optional Title Here"
182
- html: |-
183
- <p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
184
-
185
- <p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
186
- ---
187
- in: |
188
- [Google][]
189
- [Google]: http://google.com/
190
- html: <p><a href="http://google.com/">Google</a></p>
191
- ---
192
- in: |
193
- Visit [Daring Fireball][] for more information.
194
- [Daring Fireball]: http://daringfireball.net/
195
- html: <p>Visit <a href="http://daringfireball.net/">Daring Fireball</a> for more information.</p>
196
- ---
197
- in: |
198
- I get 10 times more traffic from [Google] [1] than from
199
- [Yahoo] [2] or [MSN] [3].
200
-
201
- [1]: http://google.com/ "Google"
202
- [2]: http://search.yahoo.com/ "Yahoo Search"
203
- [3]: http://search.msn.com/ "MSN Search"
204
-
205
- html: |-
206
- <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
207
- <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
208
- ---
209
- in: |
210
- I get 10 times more traffic from [Google][] than from
211
- [Yahoo][] or [MSN][].
212
-
213
- [google]: http://google.com/ "Google"
214
- [yahoo]: http://search.yahoo.com/ "Yahoo Search"
215
- [msn]: http://search.msn.com/ "MSN Search"
216
- html: |-
217
- <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
218
- <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #$Id: test-tartan-markdown.rb 148 2006-07-22 14:04:20Z larry $
3
-
4
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
-
6
- #require 'tartan'
7
- require 'tartan_markdown'
8
- require 'wiki-test'
9
-
10
- cases = WikiTestCases.new(TartanMarkdown, "test-markdown.yml")
11
-