redcloth-formatters-ast 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ module RedCloth::Formatters::AST
|
|
3
3
|
|
4
4
|
@@ast = []
|
5
5
|
|
6
|
-
[:title, :subtitle, :author, :copyright, :h0, :h1, :h2, :h3, :h4, :cite].each do |m|
|
6
|
+
[:title, :subtitle, :author, :copyright, :h0, :h1, :h2, :h3, :h4, :cite, :toc, :tof, :toe].each do |m|
|
7
7
|
define_method(m) do |opts|
|
8
8
|
@@ast << { :type => m, :text => opts[:text], :options => parse_css(opts[:style]) }
|
9
9
|
""
|
data/spec/ast_spec.rb
CHANGED
@@ -93,6 +93,13 @@ describe RedCloth::Formatters::AST do
|
|
93
93
|
]
|
94
94
|
end
|
95
95
|
|
96
|
-
|
96
|
+
it "should compile toc tof toe" do
|
97
|
+
textile = File.read "spec/fixtures/toc.textile"
|
98
|
+
RedCloth.new(textile).to_ast.should == [
|
99
|
+
{:type=>:toc, :text=>"Table of Contents", :options=>{}},
|
100
|
+
{:type=>:tof, :text=>"Table of Figures", :options=>{}},
|
101
|
+
{:type=>:toe, :text=>"Table of Examples", :options=>{}}
|
102
|
+
]
|
103
|
+
end
|
97
104
|
|
98
105
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redcloth-formatters-ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A RedCloth formatter that compiles textile to an AST
|
15
15
|
email:
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- spec/fixtures/lists.textile
|
36
36
|
- spec/fixtures/tables.textile
|
37
37
|
- spec/fixtures/title_subtitle.textile
|
38
|
+
- spec/fixtures/toc.textile
|
38
39
|
- spec/helpers.rb
|
39
40
|
homepage: http://southdesign.github.com/redcloth-formatters-ast
|
40
41
|
licenses: []
|
@@ -69,4 +70,5 @@ test_files:
|
|
69
70
|
- spec/fixtures/lists.textile
|
70
71
|
- spec/fixtures/tables.textile
|
71
72
|
- spec/fixtures/title_subtitle.textile
|
73
|
+
- spec/fixtures/toc.textile
|
72
74
|
- spec/helpers.rb
|