redcloth-formatters-docbook 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/redcloth-formatters-docbook/formatters/docbook.rb +9 -0
- data/lib/redcloth-formatters-docbook/version.rb +1 -1
- data/redcloth-formatters-docbook.gemspec +1 -1
- data/spec/docbook_spec.rb +1 -1
- data/spec/fixtures/phrase.textile +15 -1
- data/spec/fixtures/phrase.xml +23 -0
- data/spec/fixtures/source.textile +8 -1
- data/spec/fixtures/source.xml +13 -0
- metadata +35 -64
@@ -269,6 +269,10 @@ module RedCloth::Formatters::Docbook
|
|
269
269
|
out += "\t<programlisting width=\"100%\">\n"
|
270
270
|
out
|
271
271
|
end
|
272
|
+
|
273
|
+
def bc(opts)
|
274
|
+
puts "middle"
|
275
|
+
end
|
272
276
|
|
273
277
|
def bc_close(opts)
|
274
278
|
out = "</programlisting>\n"
|
@@ -339,6 +343,11 @@ module RedCloth::Formatters::Docbook
|
|
339
343
|
|
340
344
|
# escapement for HTML in a PRE tag
|
341
345
|
def escape_pre(text)
|
346
|
+
text.gsub! "&", "&"
|
347
|
+
text.gsub! "<", "<"
|
348
|
+
text.gsub! ">", ">"
|
349
|
+
text.gsub! "'", "'"
|
350
|
+
text.gsub! '"', ""e;"
|
342
351
|
text
|
343
352
|
end
|
344
353
|
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Thomas Fankhauser"]
|
10
10
|
s.email = ["tommylefunk@googlemail.com"]
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "http://www.southdesign.de"
|
12
12
|
s.summary = %q{RedCloth DocBook Formatter}
|
13
13
|
s.description = %q{Allows RedCloth to convert .textiles to Docbook XMLs}
|
14
14
|
|
data/spec/docbook_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'RedCloth'
|
|
2
2
|
require 'redcloth-formatters-docbook'
|
3
3
|
require 'spec/helpers'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe RedCloth::Formatters::Docbook do
|
6
6
|
|
7
7
|
it "basic command available" do
|
8
8
|
textile = File.open("spec/fixtures/hello.textile", 'rb') { |f| f.read }
|
@@ -18,4 +18,18 @@ Simply got to "Google":http://www.google.com and search.
|
|
18
18
|
|
19
19
|
!{width: 90%;}../images/image.png(A great image)!
|
20
20
|
|
21
|
-
bq{by: Martin Luther King}. I have a dream. The dream is great. It will come true!
|
21
|
+
bq{by: Martin Luther King}. I have a dream. The dream is great. It will come true!
|
22
|
+
|
23
|
+
|
24
|
+
h2. Block Quotes
|
25
|
+
|
26
|
+
The next paragraph should include a great block quote.
|
27
|
+
|
28
|
+
bq{by: wikipedia.com}. This is some quoted text.
|
29
|
+
This is in the new line still in the block quote.
|
30
|
+
|
31
|
+
bq{by: google.com}. This block quote is the next.
|
32
|
+
|
33
|
+
p. Some more text between the block quotes.
|
34
|
+
|
35
|
+
bq{by: facebook.com}. Another block quote.
|
data/spec/fixtures/phrase.xml
CHANGED
@@ -35,5 +35,28 @@
|
|
35
35
|
</blockquote>
|
36
36
|
|
37
37
|
</section>
|
38
|
+
<section>
|
39
|
+
<title>Block Quotes</title>
|
40
|
+
|
41
|
+
<para>The next paragraph should include a great block quote.</para>
|
42
|
+
|
43
|
+
<blockquote>
|
44
|
+
<attribution>wikipedia.com</attribution>
|
45
|
+
<para>This is some quoted text. This is in the new line still in the block quote.</para>
|
46
|
+
</blockquote>
|
47
|
+
|
48
|
+
<blockquote>
|
49
|
+
<attribution>google.com</attribution>
|
50
|
+
<para>This block quote is the next.</para>
|
51
|
+
</blockquote>
|
52
|
+
|
53
|
+
<para>Some more text between the block quotes.</para>
|
54
|
+
|
55
|
+
<blockquote>
|
56
|
+
<attribution>facebook.com</attribution>
|
57
|
+
<para>Another block quote.</para>
|
58
|
+
</blockquote>
|
59
|
+
|
60
|
+
</section>
|
38
61
|
</chapter>
|
39
62
|
</book>
|
@@ -14,4 +14,11 @@ bc{name: Ruby Car Class;}.. class Car
|
|
14
14
|
|
15
15
|
end
|
16
16
|
|
17
|
-
p. Another paragraph
|
17
|
+
p. Another paragraph
|
18
|
+
|
19
|
+
bc{name: Consuming the ManAtBar Protocol 1;}.. -(void)didUpdateBloodAlcoholLevel:(Man*)aMan to:(float)level{
|
20
|
+
if(level < 3.0) return;
|
21
|
+
else [self callAmbulance];
|
22
|
+
}
|
23
|
+
|
24
|
+
p. So if the man's level is lower than 3.0 she'll do nothing, otherwise she thinks it's time to call the ambulance.
|
data/spec/fixtures/source.xml
CHANGED
@@ -26,6 +26,19 @@ end</programlisting>
|
|
26
26
|
|
27
27
|
<para>Another paragraph</para>
|
28
28
|
|
29
|
+
<para>
|
30
|
+
<example xml:id="ConsumingtheManAtBarProtocol1">
|
31
|
+
<title>Consuming the ManAtBar Protocol 1</title>
|
32
|
+
<programlisting width="100%">
|
33
|
+
-(void)didUpdateBloodAlcoholLevel:(Man*)aMan to:(float)level{
|
34
|
+
if(level < 3.0) return;
|
35
|
+
else [self callAmbulance];
|
36
|
+
}</programlisting>
|
37
|
+
</example>
|
38
|
+
</para>
|
39
|
+
|
40
|
+
<para>So if the man's level is lower than 3.0 she'll do nothing, otherwise she thinks it's time to call the ambulance.</para>
|
41
|
+
|
29
42
|
</section>
|
30
43
|
</chapter>
|
31
44
|
|
metadata
CHANGED
@@ -1,64 +1,45 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: redcloth-formatters-docbook
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Thomas Fankhauser
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: RedCloth
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70130260404840 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 39
|
30
|
-
segments:
|
31
|
-
- 4
|
32
|
-
- 2
|
33
|
-
- 8
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 4.2.8
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *70130260404840
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &70130260403900 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
29
|
+
requirements:
|
43
30
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 6
|
49
|
-
version: "2.6"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.6'
|
50
33
|
type: :development
|
51
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70130260403900
|
52
36
|
description: Allows RedCloth to convert .textiles to Docbook XMLs
|
53
|
-
email:
|
37
|
+
email:
|
54
38
|
- tommylefunk@googlemail.com
|
55
39
|
executables: []
|
56
|
-
|
57
40
|
extensions: []
|
58
|
-
|
59
41
|
extra_rdoc_files: []
|
60
|
-
|
61
|
-
files:
|
42
|
+
files:
|
62
43
|
- .gitignore
|
63
44
|
- Gemfile
|
64
45
|
- README.textile
|
@@ -90,41 +71,31 @@ files:
|
|
90
71
|
- spec/fixtures/tables.textile
|
91
72
|
- spec/fixtures/tables.xml
|
92
73
|
- spec/helpers.rb
|
93
|
-
|
94
|
-
homepage: ""
|
74
|
+
homepage: http://www.southdesign.de
|
95
75
|
licenses: []
|
96
|
-
|
97
76
|
post_install_message:
|
98
77
|
rdoc_options: []
|
99
|
-
|
100
|
-
require_paths:
|
78
|
+
require_paths:
|
101
79
|
- lib
|
102
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
81
|
none: false
|
104
|
-
requirements:
|
105
|
-
- -
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
|
109
|
-
- 0
|
110
|
-
version: "0"
|
111
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
87
|
none: false
|
113
|
-
requirements:
|
114
|
-
- -
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
|
117
|
-
segments:
|
118
|
-
- 0
|
119
|
-
version: "0"
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
120
92
|
requirements: []
|
121
|
-
|
122
93
|
rubyforge_project: redcloth-formatters-docbook
|
123
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 1.8.15
|
124
95
|
signing_key:
|
125
96
|
specification_version: 3
|
126
97
|
summary: RedCloth DocBook Formatter
|
127
|
-
test_files:
|
98
|
+
test_files:
|
128
99
|
- spec/docbook_spec.rb
|
129
100
|
- spec/fixtures/bibliography.textile
|
130
101
|
- spec/fixtures/bibliography.xml
|