tartan 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README +130 -0
- data/TODO +17 -0
- data/lib/core_ext/array.rb +12 -0
- data/lib/core_ext/file.rb +15 -0
- data/lib/core_ext/hash.rb +16 -0
- data/lib/core_ext/match_data.rb +62 -0
- data/lib/core_ext/module.rb +17 -0
- data/lib/core_ext/regexp.rb +33 -0
- data/lib/markdown.yml +499 -0
- data/lib/symbolize.rb +78 -0
- data/lib/table.yml +63 -0
- data/lib/tartan.rb +359 -0
- data/lib/tartan_markdown.rb +8 -0
- data/lib/tartan_markdown_def.rb +7 -0
- data/lib/tartan_table_def.rb +7 -0
- data/lib/tartan_test_base_def.rb +5 -0
- data/lib/tartan_wikilink_def.rb +14 -0
- data/lib/test_base.yml +18 -0
- data/lib/wiki-test.rb +94 -0
- data/lib/wiki_rule.rb +240 -0
- data/lib/wikilink.yml +18 -0
- data/test/MarkdownTest_1.0/Amps and angle encoding.html +17 -0
- data/test/MarkdownTest_1.0/Amps and angle encoding.text +21 -0
- data/test/MarkdownTest_1.0/Auto links.html +18 -0
- data/test/MarkdownTest_1.0/Auto links.text +13 -0
- data/test/MarkdownTest_1.0/Backslash codeescapes.html +68 -0
- data/test/MarkdownTest_1.0/Backslash codeescapes.text +68 -0
- data/test/MarkdownTest_1.0/Backslash simpleescapes.html +33 -0
- data/test/MarkdownTest_1.0/Backslash simpleescapes.text +33 -0
- data/test/MarkdownTest_1.0/Blockquotes with code blocks.html +15 -0
- data/test/MarkdownTest_1.0/Blockquotes with code blocks.text +11 -0
- data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.html +8 -0
- data/test/MarkdownTest_1.0/Hard-wrapped paragraphs with list-like lines.text +8 -0
- data/test/MarkdownTest_1.0/Horizontal rules.html +71 -0
- data/test/MarkdownTest_1.0/Horizontal rules.text +67 -0
- data/test/MarkdownTest_1.0/Inline HTML (Advanced).html +14 -0
- data/test/MarkdownTest_1.0/Inline HTML (Advanced).text +14 -0
- data/test/MarkdownTest_1.0/Inline HTML (Simple).html +72 -0
- data/test/MarkdownTest_1.0/Inline HTML (Simple).text +69 -0
- data/test/MarkdownTest_1.0/Inline HTML comments.html +13 -0
- data/test/MarkdownTest_1.0/Inline HTML comments.text +13 -0
- data/test/MarkdownTest_1.0/Links, inline style.html +9 -0
- data/test/MarkdownTest_1.0/Links, inline style.text +9 -0
- data/test/MarkdownTest_1.0/Links, reference style.html +18 -0
- data/test/MarkdownTest_1.0/Links, reference style.text +31 -0
- data/test/MarkdownTest_1.0/Literal quotes in titles.html +3 -0
- data/test/MarkdownTest_1.0/Literal quotes in titles.text +7 -0
- data/test/MarkdownTest_1.0/Markdown Documentation - Basics.html +314 -0
- data/test/MarkdownTest_1.0/Markdown Documentation - Basics.text +306 -0
- data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.html +942 -0
- data/test/MarkdownTest_1.0/Markdown Documentation - Syntax.text +888 -0
- data/test/MarkdownTest_1.0/Nested blockquotes.html +9 -0
- data/test/MarkdownTest_1.0/Nested blockquotes.text +5 -0
- data/test/MarkdownTest_1.0/Ordered and unordered lists.html +137 -0
- data/test/MarkdownTest_1.0/Ordered and unordered lists.text +122 -0
- data/test/MarkdownTest_1.0/Strong and em together.html +7 -0
- data/test/MarkdownTest_1.0/Strong and em together.text +7 -0
- data/test/MarkdownTest_1.0/Tabs.html +25 -0
- data/test/MarkdownTest_1.0/Tabs.text +21 -0
- data/test/MarkdownTest_1.0/Tidyness.html +8 -0
- data/test/MarkdownTest_1.0/Tidyness.text +5 -0
- data/test/MarkdownTest_1.0/run-markdown.rb +56 -0
- data/test/MarkdownTest_1.0/test-fireball-markdown.rb +177 -0
- data/test/MarkdownTest_1.0/testdiff.rb +42 -0
- data/test/harder/test-markdown-harder.rb +11 -0
- data/test/harder/test-markdown-harder.yml +111 -0
- data/test/redcloth/redcloth-markdown-tests.rb +29 -0
- data/test/redcloth/redcloth-markdown-tests.yml +218 -0
- data/test/test-combo.rb +23 -0
- data/test/test-hash.rb +31 -0
- data/test/test-markdown.rb +11 -0
- data/test/test-markdown.yml +1144 -0
- data/test/test-match-data.rb +54 -0
- data/test/test-readme-example.rb +48 -0
- data/test/test-tables.rb +16 -0
- data/test/test-tables.yml +82 -0
- data/test/test-tartan-markdown.rb +11 -0
- data/test/test-tartan.rb +306 -0
- data/test/test-wikilink.rb +18 -0
- data/test/test-wikilink.yml +22 -0
- data/test/wikilink-test-helper.rb +14 -0
- 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
|
+
|