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
+ #!/usr/bin/env ruby
2
+ #$Id: test-wikilink.rb 158 2006-07-23 23:47:12Z larry $
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
+
6
+ require 'tartan'
7
+ require 'tartan_wikilink_def'
8
+ require 'wiki-test'
9
+ require 'wikilink-test-helper'
10
+ require 'tartan_test_base_def'
11
+
12
+ class TartanTestWikilink < Tartan
13
+ include TartanTestBaseDef
14
+ include TartanWikilinkDef
15
+ include WikilinkTestHelper
16
+ end
17
+
18
+ cases = WikiTestCases.new(TartanTestWikilink, "test-wikilink.yml")
@@ -0,0 +1,22 @@
1
+ #$Id: test-larry-wikiparser.yml 116 2006-04-23 12:23:08Z larry $
2
+
3
+ title: MissingPageNameOnly
4
+ in: "[[Missing Page Name]]"
5
+ html: '<p><a class="missing" href="/prefix/Missing+Page+Name?action=edit">Missing Page Name</a></p>'
6
+ ---
7
+ title: ExistingPageNameOnly
8
+ in: "[[Page Name]]"
9
+ html: '<p><a class="existing" href="/prefix/Page+Name">Page Name</a></p>'
10
+ ---
11
+ title: ExistingWithNameAndLinkBody
12
+ in: "[[Page Name|Link Body]]"
13
+ html: '<p><a class="existing" href="/prefix/Page+Name">Link Body</a></p>'
14
+ ---
15
+ title: Style
16
+ in: "Link *Body*"
17
+ html: '<p>Link <em>Body</em></p>'
18
+ ---
19
+ title: ExistingWithNameAndLinkBodyWithStyle
20
+ in: "[[Page Name|Link *Body*]]"
21
+ html: '<p><a class="existing" href="/prefix/Page+Name">Link <em>Body</em></a></p>'
22
+ ---
@@ -0,0 +1,14 @@
1
+ module WikilinkTestHelper
2
+ def wiki_link_tag(page_name)
3
+ if page_name =~ /^[mM]issing/
4
+ klass = "missing"
5
+ extension = "?action=edit"
6
+ else
7
+ klass = "existing"
8
+ extension = ""
9
+ end
10
+
11
+ page_name = page_name.gsub(/ +/, '+')
12
+ %Q:<a class="#{klass}" href="/prefix/#{page_name}#{extension}">:
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.0
3
+ specification_version: 1
4
+ name: tartan
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.0
7
+ date: 2006-08-17 00:00:00 +02:00
8
+ summary: A library for building text parsers
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage:
13
+ rubyforge_project:
14
+ description: A text parsing engine. The syntax is defined outside the engine as regex-based rules, in YAML or Ruby. It supports layering and multiple output types. Rules for Markdown to HTML are included, with optional layered extensions for tables and wikilinks.
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Larry Baltz and David B. Anderson
31
+ files:
32
+ - README
33
+ - TODO
34
+ - MIT-LICENSE
35
+ - test/MarkdownTest_1.0
36
+ - test/harder
37
+ - test/redcloth
38
+ - test/test-combo.rb
39
+ - test/test-hash.rb
40
+ - test/test-markdown.rb
41
+ - test/test-markdown.yml
42
+ - test/test-match-data.rb
43
+ - test/test-readme-example.rb
44
+ - test/test-tables.rb
45
+ - test/test-tables.yml
46
+ - test/test-tartan-markdown.rb
47
+ - test/test-tartan.rb
48
+ - test/test-wikilink.rb
49
+ - test/test-wikilink.yml
50
+ - test/wikilink-test-helper.rb
51
+ - test/MarkdownTest_1.0/Amps and angle encoding.html
52
+ - test/MarkdownTest_1.0/Amps and angle encoding.text
53
+ - test/MarkdownTest_1.0/Auto links.html
54
+ - test/MarkdownTest_1.0/Auto links.text
55
+ - test/MarkdownTest_1.0/Backslash codeescapes.html
56
+ - test/MarkdownTest_1.0/Backslash codeescapes.text
57
+ - test/MarkdownTest_1.0/Backslash simpleescapes.html
58
+ - test/MarkdownTest_1.0/Backslash simpleescapes.text
59
+ - test/MarkdownTest_1.0/Blockquotes with code blocks.html
60
+ - test/MarkdownTest_1.0/Blockquotes with code blocks.text
61
+ - test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.html
62
+ - test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.text
63
+ - test/MarkdownTest_1.0/Horizontal rules.html
64
+ - test/MarkdownTest_1.0/Horizontal rules.text
65
+ - test/MarkdownTest_1.0/Inline HTML (Advanced).html
66
+ - test/MarkdownTest_1.0/Inline HTML (Advanced).text
67
+ - test/MarkdownTest_1.0/Inline HTML (Simple).html
68
+ - test/MarkdownTest_1.0/Inline HTML (Simple).text
69
+ - test/MarkdownTest_1.0/Inline HTML comments.html
70
+ - test/MarkdownTest_1.0/Inline HTML comments.text
71
+ - test/MarkdownTest_1.0/Links, inline style.html
72
+ - test/MarkdownTest_1.0/Links, inline style.text
73
+ - test/MarkdownTest_1.0/Links, reference style.html
74
+ - test/MarkdownTest_1.0/Links, reference style.text
75
+ - test/MarkdownTest_1.0/Literal quotes in titles.html
76
+ - test/MarkdownTest_1.0/Literal quotes in titles.text
77
+ - test/MarkdownTest_1.0/Markdown Documentation - Basics.html
78
+ - test/MarkdownTest_1.0/Markdown Documentation - Basics.text
79
+ - test/MarkdownTest_1.0/Markdown Documentation - Syntax.html
80
+ - test/MarkdownTest_1.0/Markdown Documentation - Syntax.text
81
+ - test/MarkdownTest_1.0/Nested blockquotes.html
82
+ - test/MarkdownTest_1.0/Nested blockquotes.text
83
+ - test/MarkdownTest_1.0/Ordered and unordered lists.html
84
+ - test/MarkdownTest_1.0/Ordered and unordered lists.text
85
+ - test/MarkdownTest_1.0/Strong and em together.html
86
+ - test/MarkdownTest_1.0/Strong and em together.text
87
+ - test/MarkdownTest_1.0/Tabs.html
88
+ - test/MarkdownTest_1.0/Tabs.text
89
+ - test/MarkdownTest_1.0/Tidyness.html
90
+ - test/MarkdownTest_1.0/Tidyness.text
91
+ - test/MarkdownTest_1.0/run-markdown.rb
92
+ - test/MarkdownTest_1.0/test-fireball-markdown.rb
93
+ - test/MarkdownTest_1.0/testdiff.rb
94
+ - test/harder/test-markdown-harder.rb
95
+ - test/harder/test-markdown-harder.yml
96
+ - test/redcloth/redcloth-markdown-tests.rb
97
+ - test/redcloth/redcloth-markdown-tests.yml
98
+ - lib/core_ext
99
+ - lib/markdown.yml
100
+ - lib/symbolize.rb
101
+ - lib/table.yml
102
+ - lib/tartan.rb
103
+ - lib/tartan_markdown.rb
104
+ - lib/tartan_markdown_def.rb
105
+ - lib/tartan_table_def.rb
106
+ - lib/tartan_test_base_def.rb
107
+ - lib/tartan_wikilink_def.rb
108
+ - lib/test_base.yml
109
+ - lib/wiki-test.rb
110
+ - lib/wiki_rule.rb
111
+ - lib/wikilink.yml
112
+ - lib/core_ext/array.rb
113
+ - lib/core_ext/file.rb
114
+ - lib/core_ext/hash.rb
115
+ - lib/core_ext/match_data.rb
116
+ - lib/core_ext/module.rb
117
+ - lib/core_ext/regexp.rb
118
+ test_files:
119
+ - test/test-combo.rb
120
+ - test/test-hash.rb
121
+ - test/test-markdown.rb
122
+ - test/test-match-data.rb
123
+ - test/test-readme-example.rb
124
+ - test/test-tables.rb
125
+ - test/test-tartan-markdown.rb
126
+ - test/test-tartan.rb
127
+ - test/test-wikilink.rb
128
+ rdoc_options: []
129
+
130
+ extra_rdoc_files:
131
+ - README
132
+ executables: []
133
+
134
+ extensions: []
135
+
136
+ requirements: []
137
+
138
+ dependencies: []
139
+