reverse_adoc 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/macos.yml +27 -0
- data/.github/workflows/ubuntu.yml +27 -0
- data/.github/workflows/windows.yml +30 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +25 -0
- data/README.adoc +290 -0
- data/Rakefile +14 -0
- data/bin/reverse_adoc +67 -0
- data/bin/w2a +85 -0
- data/lib/reverse_asciidoctor.rb +70 -0
- data/lib/reverse_asciidoctor/cleaner.rb +90 -0
- data/lib/reverse_asciidoctor/config.rb +53 -0
- data/lib/reverse_asciidoctor/converters.rb +33 -0
- data/lib/reverse_asciidoctor/converters/a.rb +38 -0
- data/lib/reverse_asciidoctor/converters/aside.rb +14 -0
- data/lib/reverse_asciidoctor/converters/audio.rb +34 -0
- data/lib/reverse_asciidoctor/converters/base.rb +24 -0
- data/lib/reverse_asciidoctor/converters/blockquote.rb +18 -0
- data/lib/reverse_asciidoctor/converters/br.rb +11 -0
- data/lib/reverse_asciidoctor/converters/bypass.rb +77 -0
- data/lib/reverse_asciidoctor/converters/code.rb +15 -0
- data/lib/reverse_asciidoctor/converters/div.rb +14 -0
- data/lib/reverse_asciidoctor/converters/drop.rb +18 -0
- data/lib/reverse_asciidoctor/converters/em.rb +18 -0
- data/lib/reverse_asciidoctor/converters/figure.rb +21 -0
- data/lib/reverse_asciidoctor/converters/h.rb +19 -0
- data/lib/reverse_asciidoctor/converters/head.rb +18 -0
- data/lib/reverse_asciidoctor/converters/hr.rb +11 -0
- data/lib/reverse_asciidoctor/converters/ignore.rb +12 -0
- data/lib/reverse_asciidoctor/converters/img.rb +80 -0
- data/lib/reverse_asciidoctor/converters/li.rb +24 -0
- data/lib/reverse_asciidoctor/converters/mark.rb +12 -0
- data/lib/reverse_asciidoctor/converters/math.rb +20 -0
- data/lib/reverse_asciidoctor/converters/ol.rb +46 -0
- data/lib/reverse_asciidoctor/converters/p.rb +17 -0
- data/lib/reverse_asciidoctor/converters/pass_through.rb +9 -0
- data/lib/reverse_asciidoctor/converters/pre.rb +38 -0
- data/lib/reverse_asciidoctor/converters/q.rb +12 -0
- data/lib/reverse_asciidoctor/converters/strong.rb +17 -0
- data/lib/reverse_asciidoctor/converters/sub.rb +12 -0
- data/lib/reverse_asciidoctor/converters/sup.rb +12 -0
- data/lib/reverse_asciidoctor/converters/table.rb +64 -0
- data/lib/reverse_asciidoctor/converters/td.rb +67 -0
- data/lib/reverse_asciidoctor/converters/text.rb +65 -0
- data/lib/reverse_asciidoctor/converters/th.rb +16 -0
- data/lib/reverse_asciidoctor/converters/tr.rb +22 -0
- data/lib/reverse_asciidoctor/converters/video.rb +36 -0
- data/lib/reverse_asciidoctor/errors.rb +10 -0
- data/lib/reverse_asciidoctor/version.rb +3 -0
- data/reverse_adoc.gemspec +35 -0
- data/spec/assets/anchors.html +22 -0
- data/spec/assets/basic.html +58 -0
- data/spec/assets/code.html +22 -0
- data/spec/assets/escapables.html +15 -0
- data/spec/assets/from_the_wild.html +23 -0
- data/spec/assets/full_example.html +49 -0
- data/spec/assets/html_fragment.html +3 -0
- data/spec/assets/lists.html +137 -0
- data/spec/assets/minimum.html +4 -0
- data/spec/assets/paragraphs.html +24 -0
- data/spec/assets/quotation.html +12 -0
- data/spec/assets/tables.html +99 -0
- data/spec/assets/unknown_tags.html +9 -0
- data/spec/components/anchors_spec.rb +21 -0
- data/spec/components/basic_spec.rb +49 -0
- data/spec/components/code_spec.rb +28 -0
- data/spec/components/escapables_spec.rb +23 -0
- data/spec/components/from_the_wild_spec.rb +17 -0
- data/spec/components/html_fragment_spec.rb +11 -0
- data/spec/components/lists_spec.rb +86 -0
- data/spec/components/paragraphs_spec.rb +15 -0
- data/spec/components/quotation_spec.rb +12 -0
- data/spec/components/tables_spec.rb +31 -0
- data/spec/components/unknown_tags_spec.rb +39 -0
- data/spec/lib/reverse_asciidoctor/cleaner_spec.rb +157 -0
- data/spec/lib/reverse_asciidoctor/config_spec.rb +26 -0
- data/spec/lib/reverse_asciidoctor/converters/aside_spec.rb +12 -0
- data/spec/lib/reverse_asciidoctor/converters/audio_spec.rb +18 -0
- data/spec/lib/reverse_asciidoctor/converters/blockquote_spec.rb +24 -0
- data/spec/lib/reverse_asciidoctor/converters/br_spec.rb +9 -0
- data/spec/lib/reverse_asciidoctor/converters/code_spec.rb +18 -0
- data/spec/lib/reverse_asciidoctor/converters/div_spec.rb +18 -0
- data/spec/lib/reverse_asciidoctor/converters/figure_spec.rb +13 -0
- data/spec/lib/reverse_asciidoctor/converters/img_spec.rb +28 -0
- data/spec/lib/reverse_asciidoctor/converters/li_spec.rb +13 -0
- data/spec/lib/reverse_asciidoctor/converters/mark_spec.rb +10 -0
- data/spec/lib/reverse_asciidoctor/converters/p_spec.rb +12 -0
- data/spec/lib/reverse_asciidoctor/converters/pre_spec.rb +45 -0
- data/spec/lib/reverse_asciidoctor/converters/q_spec.rb +10 -0
- data/spec/lib/reverse_asciidoctor/converters/strong_spec.rb +20 -0
- data/spec/lib/reverse_asciidoctor/converters/text_spec.rb +62 -0
- data/spec/lib/reverse_asciidoctor/converters/video_spec.rb +18 -0
- data/spec/lib/reverse_asciidoctor/converters_spec.rb +19 -0
- data/spec/lib/reverse_asciidoctor_spec.rb +37 -0
- data/spec/spec_helper.rb +21 -0
- metadata +299 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
# require 'byebug'
|
3
|
+
|
4
|
+
SimpleCov.profiles.define 'gem' do
|
5
|
+
add_filter '/spec/'
|
6
|
+
add_filter '/autotest/'
|
7
|
+
add_group 'Libraries', '/lib/'
|
8
|
+
end
|
9
|
+
SimpleCov.start 'gem'
|
10
|
+
|
11
|
+
require 'reverse_asciidoctor'
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.after(:each) do
|
15
|
+
ReverseAsciidoctor.instance_variable_set(:@config, nil)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def node_for(html)
|
20
|
+
Nokogiri::HTML.parse(html).root.child.child
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,299 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: reverse_adoc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ribose Inc.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.10.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.10.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mathml2asciimath
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: redcarpet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: codeclimate-test-reporter
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: word-to-markdown
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
|
126
|
+
email:
|
127
|
+
- open.source@ribose.com
|
128
|
+
executables:
|
129
|
+
- reverse_adoc
|
130
|
+
- w2a
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- ".github/workflows/macos.yml"
|
135
|
+
- ".github/workflows/ubuntu.yml"
|
136
|
+
- ".github/workflows/windows.yml"
|
137
|
+
- ".hound.yml"
|
138
|
+
- ".rubocop.yml"
|
139
|
+
- Gemfile
|
140
|
+
- LICENSE.txt
|
141
|
+
- README.adoc
|
142
|
+
- Rakefile
|
143
|
+
- bin/reverse_adoc
|
144
|
+
- bin/w2a
|
145
|
+
- lib/reverse_asciidoctor.rb
|
146
|
+
- lib/reverse_asciidoctor/cleaner.rb
|
147
|
+
- lib/reverse_asciidoctor/config.rb
|
148
|
+
- lib/reverse_asciidoctor/converters.rb
|
149
|
+
- lib/reverse_asciidoctor/converters/a.rb
|
150
|
+
- lib/reverse_asciidoctor/converters/aside.rb
|
151
|
+
- lib/reverse_asciidoctor/converters/audio.rb
|
152
|
+
- lib/reverse_asciidoctor/converters/base.rb
|
153
|
+
- lib/reverse_asciidoctor/converters/blockquote.rb
|
154
|
+
- lib/reverse_asciidoctor/converters/br.rb
|
155
|
+
- lib/reverse_asciidoctor/converters/bypass.rb
|
156
|
+
- lib/reverse_asciidoctor/converters/code.rb
|
157
|
+
- lib/reverse_asciidoctor/converters/div.rb
|
158
|
+
- lib/reverse_asciidoctor/converters/drop.rb
|
159
|
+
- lib/reverse_asciidoctor/converters/em.rb
|
160
|
+
- lib/reverse_asciidoctor/converters/figure.rb
|
161
|
+
- lib/reverse_asciidoctor/converters/h.rb
|
162
|
+
- lib/reverse_asciidoctor/converters/head.rb
|
163
|
+
- lib/reverse_asciidoctor/converters/hr.rb
|
164
|
+
- lib/reverse_asciidoctor/converters/ignore.rb
|
165
|
+
- lib/reverse_asciidoctor/converters/img.rb
|
166
|
+
- lib/reverse_asciidoctor/converters/li.rb
|
167
|
+
- lib/reverse_asciidoctor/converters/mark.rb
|
168
|
+
- lib/reverse_asciidoctor/converters/math.rb
|
169
|
+
- lib/reverse_asciidoctor/converters/ol.rb
|
170
|
+
- lib/reverse_asciidoctor/converters/p.rb
|
171
|
+
- lib/reverse_asciidoctor/converters/pass_through.rb
|
172
|
+
- lib/reverse_asciidoctor/converters/pre.rb
|
173
|
+
- lib/reverse_asciidoctor/converters/q.rb
|
174
|
+
- lib/reverse_asciidoctor/converters/strong.rb
|
175
|
+
- lib/reverse_asciidoctor/converters/sub.rb
|
176
|
+
- lib/reverse_asciidoctor/converters/sup.rb
|
177
|
+
- lib/reverse_asciidoctor/converters/table.rb
|
178
|
+
- lib/reverse_asciidoctor/converters/td.rb
|
179
|
+
- lib/reverse_asciidoctor/converters/text.rb
|
180
|
+
- lib/reverse_asciidoctor/converters/th.rb
|
181
|
+
- lib/reverse_asciidoctor/converters/tr.rb
|
182
|
+
- lib/reverse_asciidoctor/converters/video.rb
|
183
|
+
- lib/reverse_asciidoctor/errors.rb
|
184
|
+
- lib/reverse_asciidoctor/version.rb
|
185
|
+
- reverse_adoc.gemspec
|
186
|
+
- spec/assets/anchors.html
|
187
|
+
- spec/assets/basic.html
|
188
|
+
- spec/assets/code.html
|
189
|
+
- spec/assets/escapables.html
|
190
|
+
- spec/assets/from_the_wild.html
|
191
|
+
- spec/assets/full_example.html
|
192
|
+
- spec/assets/html_fragment.html
|
193
|
+
- spec/assets/lists.html
|
194
|
+
- spec/assets/minimum.html
|
195
|
+
- spec/assets/paragraphs.html
|
196
|
+
- spec/assets/quotation.html
|
197
|
+
- spec/assets/tables.html
|
198
|
+
- spec/assets/unknown_tags.html
|
199
|
+
- spec/components/anchors_spec.rb
|
200
|
+
- spec/components/basic_spec.rb
|
201
|
+
- spec/components/code_spec.rb
|
202
|
+
- spec/components/escapables_spec.rb
|
203
|
+
- spec/components/from_the_wild_spec.rb
|
204
|
+
- spec/components/html_fragment_spec.rb
|
205
|
+
- spec/components/lists_spec.rb
|
206
|
+
- spec/components/paragraphs_spec.rb
|
207
|
+
- spec/components/quotation_spec.rb
|
208
|
+
- spec/components/tables_spec.rb
|
209
|
+
- spec/components/unknown_tags_spec.rb
|
210
|
+
- spec/lib/reverse_asciidoctor/cleaner_spec.rb
|
211
|
+
- spec/lib/reverse_asciidoctor/config_spec.rb
|
212
|
+
- spec/lib/reverse_asciidoctor/converters/aside_spec.rb
|
213
|
+
- spec/lib/reverse_asciidoctor/converters/audio_spec.rb
|
214
|
+
- spec/lib/reverse_asciidoctor/converters/blockquote_spec.rb
|
215
|
+
- spec/lib/reverse_asciidoctor/converters/br_spec.rb
|
216
|
+
- spec/lib/reverse_asciidoctor/converters/code_spec.rb
|
217
|
+
- spec/lib/reverse_asciidoctor/converters/div_spec.rb
|
218
|
+
- spec/lib/reverse_asciidoctor/converters/figure_spec.rb
|
219
|
+
- spec/lib/reverse_asciidoctor/converters/img_spec.rb
|
220
|
+
- spec/lib/reverse_asciidoctor/converters/li_spec.rb
|
221
|
+
- spec/lib/reverse_asciidoctor/converters/mark_spec.rb
|
222
|
+
- spec/lib/reverse_asciidoctor/converters/p_spec.rb
|
223
|
+
- spec/lib/reverse_asciidoctor/converters/pre_spec.rb
|
224
|
+
- spec/lib/reverse_asciidoctor/converters/q_spec.rb
|
225
|
+
- spec/lib/reverse_asciidoctor/converters/strong_spec.rb
|
226
|
+
- spec/lib/reverse_asciidoctor/converters/text_spec.rb
|
227
|
+
- spec/lib/reverse_asciidoctor/converters/video_spec.rb
|
228
|
+
- spec/lib/reverse_asciidoctor/converters_spec.rb
|
229
|
+
- spec/lib/reverse_asciidoctor_spec.rb
|
230
|
+
- spec/spec_helper.rb
|
231
|
+
homepage: http://github.com/metanorma/reverse_adoc
|
232
|
+
licenses:
|
233
|
+
- BSD-2-Clause
|
234
|
+
metadata: {}
|
235
|
+
post_install_message:
|
236
|
+
rdoc_options: []
|
237
|
+
require_paths:
|
238
|
+
- lib
|
239
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: 2.4.0
|
244
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
|
+
requirements:
|
246
|
+
- - ">="
|
247
|
+
- !ruby/object:Gem::Version
|
248
|
+
version: '0'
|
249
|
+
requirements: []
|
250
|
+
rubygems_version: 3.0.3
|
251
|
+
signing_key:
|
252
|
+
specification_version: 4
|
253
|
+
summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
|
254
|
+
test_files:
|
255
|
+
- spec/assets/anchors.html
|
256
|
+
- spec/assets/basic.html
|
257
|
+
- spec/assets/code.html
|
258
|
+
- spec/assets/escapables.html
|
259
|
+
- spec/assets/from_the_wild.html
|
260
|
+
- spec/assets/full_example.html
|
261
|
+
- spec/assets/html_fragment.html
|
262
|
+
- spec/assets/lists.html
|
263
|
+
- spec/assets/minimum.html
|
264
|
+
- spec/assets/paragraphs.html
|
265
|
+
- spec/assets/quotation.html
|
266
|
+
- spec/assets/tables.html
|
267
|
+
- spec/assets/unknown_tags.html
|
268
|
+
- spec/components/anchors_spec.rb
|
269
|
+
- spec/components/basic_spec.rb
|
270
|
+
- spec/components/code_spec.rb
|
271
|
+
- spec/components/escapables_spec.rb
|
272
|
+
- spec/components/from_the_wild_spec.rb
|
273
|
+
- spec/components/html_fragment_spec.rb
|
274
|
+
- spec/components/lists_spec.rb
|
275
|
+
- spec/components/paragraphs_spec.rb
|
276
|
+
- spec/components/quotation_spec.rb
|
277
|
+
- spec/components/tables_spec.rb
|
278
|
+
- spec/components/unknown_tags_spec.rb
|
279
|
+
- spec/lib/reverse_asciidoctor/cleaner_spec.rb
|
280
|
+
- spec/lib/reverse_asciidoctor/config_spec.rb
|
281
|
+
- spec/lib/reverse_asciidoctor/converters/aside_spec.rb
|
282
|
+
- spec/lib/reverse_asciidoctor/converters/audio_spec.rb
|
283
|
+
- spec/lib/reverse_asciidoctor/converters/blockquote_spec.rb
|
284
|
+
- spec/lib/reverse_asciidoctor/converters/br_spec.rb
|
285
|
+
- spec/lib/reverse_asciidoctor/converters/code_spec.rb
|
286
|
+
- spec/lib/reverse_asciidoctor/converters/div_spec.rb
|
287
|
+
- spec/lib/reverse_asciidoctor/converters/figure_spec.rb
|
288
|
+
- spec/lib/reverse_asciidoctor/converters/img_spec.rb
|
289
|
+
- spec/lib/reverse_asciidoctor/converters/li_spec.rb
|
290
|
+
- spec/lib/reverse_asciidoctor/converters/mark_spec.rb
|
291
|
+
- spec/lib/reverse_asciidoctor/converters/p_spec.rb
|
292
|
+
- spec/lib/reverse_asciidoctor/converters/pre_spec.rb
|
293
|
+
- spec/lib/reverse_asciidoctor/converters/q_spec.rb
|
294
|
+
- spec/lib/reverse_asciidoctor/converters/strong_spec.rb
|
295
|
+
- spec/lib/reverse_asciidoctor/converters/text_spec.rb
|
296
|
+
- spec/lib/reverse_asciidoctor/converters/video_spec.rb
|
297
|
+
- spec/lib/reverse_asciidoctor/converters_spec.rb
|
298
|
+
- spec/lib/reverse_asciidoctor_spec.rb
|
299
|
+
- spec/spec_helper.rb
|