aozora2html 0.7.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/rubocop.yml +19 -0
- data/.github/workflows/ruby.yml +37 -0
- data/.gitignore +8 -3
- data/.rubocop.yml +111 -0
- data/.rubocop_todo.yml +7 -0
- data/CHANGELOG.md +59 -0
- data/Gemfile +2 -0
- data/Guardfile +3 -1
- data/HACKING.md +45 -0
- data/LICENSE +116 -0
- data/README.md +29 -16
- data/Rakefile +12 -5
- data/aozora2html.gemspec +24 -24
- data/bin/aozora2html +25 -71
- data/lib/aozora2html/accent_parser.rb +99 -0
- data/lib/aozora2html/error.rb +17 -0
- data/lib/aozora2html/header.rb +141 -0
- data/lib/aozora2html/i18n.rb +48 -0
- data/lib/aozora2html/ruby_buffer.rb +116 -0
- data/lib/aozora2html/string_refinements.rb +36 -0
- data/lib/aozora2html/style_stack.rb +33 -0
- data/lib/aozora2html/tag/accent.rb +37 -0
- data/lib/aozora2html/tag/block.rb +21 -0
- data/lib/aozora2html/tag/chitsuki.rb +19 -0
- data/lib/aozora2html/tag/dakuten_katakana.rb +25 -0
- data/lib/aozora2html/tag/decorate.rb +19 -0
- data/lib/aozora2html/tag/dir.rb +17 -0
- data/lib/aozora2html/tag/editor_note.rb +19 -0
- data/lib/aozora2html/tag/embed_gaiji.rb +52 -0
- data/lib/aozora2html/tag/font_size.rb +20 -0
- data/lib/aozora2html/tag/gaiji.rb +12 -0
- data/lib/aozora2html/tag/img.rb +21 -0
- data/lib/aozora2html/tag/indent.rb +8 -0
- data/lib/aozora2html/tag/inline.rb +16 -0
- data/lib/aozora2html/tag/inline_caption.rb +17 -0
- data/lib/aozora2html/tag/inline_font_size.rb +19 -0
- data/lib/aozora2html/tag/inline_keigakomi.rb +17 -0
- data/lib/aozora2html/tag/inline_yokogumi.rb +17 -0
- data/lib/aozora2html/tag/jisage.rb +17 -0
- data/lib/aozora2html/tag/jizume.rb +19 -0
- data/lib/aozora2html/tag/kaeriten.rb +17 -0
- data/lib/aozora2html/tag/keigakomi.rb +19 -0
- data/lib/aozora2html/tag/kunten.rb +12 -0
- data/lib/aozora2html/tag/midashi.rb +20 -0
- data/lib/aozora2html/tag/multiline.rb +9 -0
- data/lib/aozora2html/tag/multiline_caption.rb +13 -0
- data/lib/aozora2html/tag/multiline_chitsuki.rb +10 -0
- data/lib/aozora2html/tag/multiline_jisage.rb +10 -0
- data/lib/aozora2html/tag/multiline_midashi.rb +25 -0
- data/lib/aozora2html/tag/multiline_style.rb +19 -0
- data/lib/aozora2html/tag/multiline_yokogumi.rb +14 -0
- data/lib/aozora2html/tag/okurigana.rb +17 -0
- data/lib/aozora2html/tag/oneline_chitsuki.rb +10 -0
- data/lib/aozora2html/tag/oneline_indent.rb +9 -0
- data/lib/aozora2html/tag/oneline_jisage.rb +10 -0
- data/lib/aozora2html/tag/reference_mentioned.rb +47 -0
- data/lib/aozora2html/tag/ruby.rb +202 -0
- data/lib/aozora2html/tag/un_embed_gaiji.rb +30 -0
- data/lib/aozora2html/tag.rb +57 -0
- data/lib/aozora2html/tag_parser.rb +60 -0
- data/lib/aozora2html/text_buffer.rb +50 -0
- data/lib/aozora2html/utils.rb +156 -0
- data/lib/aozora2html/version.rb +3 -1
- data/lib/aozora2html/yaml_loader.rb +37 -0
- data/lib/aozora2html/zip.rb +4 -0
- data/lib/aozora2html.rb +1359 -8
- data/lib/extensions.rb +12 -0
- data/lib/jstream.rb +139 -0
- data/sample/chukiichiran_kinyurei.html +15 -2
- data/sample/chukiichiran_kinyurei.txt +15 -2
- data/test/test_aozora2html.rb +323 -73
- data/test/test_aozora_accent_parser.rb +34 -6
- data/test/test_command_parse.rb +216 -0
- data/test/test_compat.rb +3 -4
- data/test/test_dakuten_katakana_tag.rb +12 -13
- data/test/test_decorate_tag.rb +11 -7
- data/test/test_dir_tag.rb +11 -7
- data/test/test_editor_note_tag.rb +9 -6
- data/test/test_exception.rb +11 -9
- data/test/test_font_size_tag.rb +22 -11
- data/test/test_gaiji_tag.rb +22 -14
- data/test/test_header.rb +45 -0
- data/test/test_helper.rb +3 -1
- data/test/test_i18n.rb +39 -0
- data/test/test_img_tag.rb +11 -6
- data/test/test_inline_caption_tag.rb +11 -7
- data/test/test_inline_font_size_tag.rb +15 -11
- data/test/test_inline_keigakomi_tag.rb +11 -7
- data/test/test_inline_yokogumi_tag.rb +11 -7
- data/test/test_jizume_tag.rb +11 -8
- data/test/test_jstream.rb +33 -30
- data/test/test_kaeriten_tag.rb +11 -7
- data/test/test_keigakomi_tag.rb +14 -11
- data/test/test_midashi_tag.rb +39 -0
- data/test/test_multiline_caption_tag.rb +11 -8
- data/test/test_multiline_midashi_tag.rb +26 -26
- data/test/test_multiline_style_tag.rb +11 -8
- data/test/test_multiline_yokogumi_tag.rb +11 -8
- data/test/test_okurigana_tag.rb +11 -7
- data/test/test_ruby_parse.rb +130 -0
- data/test/test_ruby_tag.rb +11 -7
- data/test/test_tag_parser.rb +31 -29
- data/vendor/jis2ucs/README.md +3 -6
- data/yml/accent_table.yml +240 -0
- data/yml/command_table.yml +61 -0
- data/yml/jis2ucs.yml +11234 -0
- metadata +99 -21
- data/.travis.yml +0 -12
- data/appveyor.yml +0 -23
- data/lib/accent_tag.rb +0 -23
- data/lib/aozora2html/jis2ucs.rb +0 -11237
- data/lib/embed_gaiji_tag.rb +0 -34
- data/lib/t2hs.rb +0 -2535
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aozora2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aozorahack team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -44,16 +44,16 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,21 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rubocop-performance
|
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: rubocop-rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ">="
|
@@ -81,7 +95,7 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: test-unit
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -95,7 +109,7 @@ dependencies:
|
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: test-unit-rr
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - ">="
|
@@ -117,27 +131,79 @@ executables:
|
|
117
131
|
extensions: []
|
118
132
|
extra_rdoc_files: []
|
119
133
|
files:
|
134
|
+
- ".github/workflows/rubocop.yml"
|
135
|
+
- ".github/workflows/ruby.yml"
|
120
136
|
- ".gitignore"
|
121
|
-
- ".
|
137
|
+
- ".rubocop.yml"
|
138
|
+
- ".rubocop_todo.yml"
|
122
139
|
- CHANGELOG.md
|
123
140
|
- Gemfile
|
124
141
|
- Guardfile
|
142
|
+
- HACKING.md
|
143
|
+
- LICENSE
|
125
144
|
- README.md
|
126
145
|
- Rakefile
|
127
146
|
- aozora2html.gemspec
|
128
|
-
- appveyor.yml
|
129
147
|
- bin/aozora2html
|
130
|
-
- lib/accent_tag.rb
|
131
148
|
- lib/aozora2html.rb
|
132
|
-
- lib/aozora2html/
|
149
|
+
- lib/aozora2html/accent_parser.rb
|
150
|
+
- lib/aozora2html/error.rb
|
151
|
+
- lib/aozora2html/header.rb
|
152
|
+
- lib/aozora2html/i18n.rb
|
153
|
+
- lib/aozora2html/ruby_buffer.rb
|
154
|
+
- lib/aozora2html/string_refinements.rb
|
155
|
+
- lib/aozora2html/style_stack.rb
|
156
|
+
- lib/aozora2html/tag.rb
|
157
|
+
- lib/aozora2html/tag/accent.rb
|
158
|
+
- lib/aozora2html/tag/block.rb
|
159
|
+
- lib/aozora2html/tag/chitsuki.rb
|
160
|
+
- lib/aozora2html/tag/dakuten_katakana.rb
|
161
|
+
- lib/aozora2html/tag/decorate.rb
|
162
|
+
- lib/aozora2html/tag/dir.rb
|
163
|
+
- lib/aozora2html/tag/editor_note.rb
|
164
|
+
- lib/aozora2html/tag/embed_gaiji.rb
|
165
|
+
- lib/aozora2html/tag/font_size.rb
|
166
|
+
- lib/aozora2html/tag/gaiji.rb
|
167
|
+
- lib/aozora2html/tag/img.rb
|
168
|
+
- lib/aozora2html/tag/indent.rb
|
169
|
+
- lib/aozora2html/tag/inline.rb
|
170
|
+
- lib/aozora2html/tag/inline_caption.rb
|
171
|
+
- lib/aozora2html/tag/inline_font_size.rb
|
172
|
+
- lib/aozora2html/tag/inline_keigakomi.rb
|
173
|
+
- lib/aozora2html/tag/inline_yokogumi.rb
|
174
|
+
- lib/aozora2html/tag/jisage.rb
|
175
|
+
- lib/aozora2html/tag/jizume.rb
|
176
|
+
- lib/aozora2html/tag/kaeriten.rb
|
177
|
+
- lib/aozora2html/tag/keigakomi.rb
|
178
|
+
- lib/aozora2html/tag/kunten.rb
|
179
|
+
- lib/aozora2html/tag/midashi.rb
|
180
|
+
- lib/aozora2html/tag/multiline.rb
|
181
|
+
- lib/aozora2html/tag/multiline_caption.rb
|
182
|
+
- lib/aozora2html/tag/multiline_chitsuki.rb
|
183
|
+
- lib/aozora2html/tag/multiline_jisage.rb
|
184
|
+
- lib/aozora2html/tag/multiline_midashi.rb
|
185
|
+
- lib/aozora2html/tag/multiline_style.rb
|
186
|
+
- lib/aozora2html/tag/multiline_yokogumi.rb
|
187
|
+
- lib/aozora2html/tag/okurigana.rb
|
188
|
+
- lib/aozora2html/tag/oneline_chitsuki.rb
|
189
|
+
- lib/aozora2html/tag/oneline_indent.rb
|
190
|
+
- lib/aozora2html/tag/oneline_jisage.rb
|
191
|
+
- lib/aozora2html/tag/reference_mentioned.rb
|
192
|
+
- lib/aozora2html/tag/ruby.rb
|
193
|
+
- lib/aozora2html/tag/un_embed_gaiji.rb
|
194
|
+
- lib/aozora2html/tag_parser.rb
|
195
|
+
- lib/aozora2html/text_buffer.rb
|
196
|
+
- lib/aozora2html/utils.rb
|
133
197
|
- lib/aozora2html/version.rb
|
198
|
+
- lib/aozora2html/yaml_loader.rb
|
134
199
|
- lib/aozora2html/zip.rb
|
135
|
-
- lib/
|
136
|
-
- lib/
|
200
|
+
- lib/extensions.rb
|
201
|
+
- lib/jstream.rb
|
137
202
|
- sample/chukiichiran_kinyurei.html
|
138
203
|
- sample/chukiichiran_kinyurei.txt
|
139
204
|
- test/test_aozora2html.rb
|
140
205
|
- test/test_aozora_accent_parser.rb
|
206
|
+
- test/test_command_parse.rb
|
141
207
|
- test/test_compat.rb
|
142
208
|
- test/test_dakuten_katakana_tag.rb
|
143
209
|
- test/test_decorate_tag.rb
|
@@ -146,7 +212,9 @@ files:
|
|
146
212
|
- test/test_exception.rb
|
147
213
|
- test/test_font_size_tag.rb
|
148
214
|
- test/test_gaiji_tag.rb
|
215
|
+
- test/test_header.rb
|
149
216
|
- test/test_helper.rb
|
217
|
+
- test/test_i18n.rb
|
150
218
|
- test/test_img_tag.rb
|
151
219
|
- test/test_inline_caption_tag.rb
|
152
220
|
- test/test_inline_font_size_tag.rb
|
@@ -156,21 +224,27 @@ files:
|
|
156
224
|
- test/test_jstream.rb
|
157
225
|
- test/test_kaeriten_tag.rb
|
158
226
|
- test/test_keigakomi_tag.rb
|
227
|
+
- test/test_midashi_tag.rb
|
159
228
|
- test/test_multiline_caption_tag.rb
|
160
229
|
- test/test_multiline_midashi_tag.rb
|
161
230
|
- test/test_multiline_style_tag.rb
|
162
231
|
- test/test_multiline_yokogumi_tag.rb
|
163
232
|
- test/test_okurigana_tag.rb
|
233
|
+
- test/test_ruby_parse.rb
|
164
234
|
- test/test_ruby_tag.rb
|
165
235
|
- test/test_tag_parser.rb
|
166
236
|
- vendor/jis2ucs/README.md
|
167
237
|
- vendor/jis2ucs/jisx0213-2004-mono.html
|
168
238
|
- vendor/jis2ucs/mkconv.rb
|
239
|
+
- yml/accent_table.yml
|
240
|
+
- yml/command_table.yml
|
241
|
+
- yml/jis2ucs.yml
|
169
242
|
homepage: https://github.com/aozorahack/aozora2html
|
170
243
|
licenses:
|
171
244
|
- CC0
|
172
|
-
metadata:
|
173
|
-
|
245
|
+
metadata:
|
246
|
+
rubygems_mfa_required: 'true'
|
247
|
+
post_install_message:
|
174
248
|
rdoc_options: []
|
175
249
|
require_paths:
|
176
250
|
- lib
|
@@ -178,22 +252,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
252
|
requirements:
|
179
253
|
- - ">="
|
180
254
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
255
|
+
version: 2.7.0
|
182
256
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
257
|
requirements:
|
184
258
|
- - ">="
|
185
259
|
- !ruby/object:Gem::Version
|
186
260
|
version: '0'
|
187
261
|
requirements: []
|
188
|
-
|
189
|
-
|
190
|
-
signing_key:
|
262
|
+
rubygems_version: 3.2.32
|
263
|
+
signing_key:
|
191
264
|
specification_version: 4
|
192
265
|
summary: converter from Aozora Bunko format into xhtml. It's based of t2hs.rb from
|
193
266
|
kumihan.aozora.gr.jp.
|
194
267
|
test_files:
|
195
268
|
- test/test_aozora2html.rb
|
196
269
|
- test/test_aozora_accent_parser.rb
|
270
|
+
- test/test_command_parse.rb
|
197
271
|
- test/test_compat.rb
|
198
272
|
- test/test_dakuten_katakana_tag.rb
|
199
273
|
- test/test_decorate_tag.rb
|
@@ -202,7 +276,9 @@ test_files:
|
|
202
276
|
- test/test_exception.rb
|
203
277
|
- test/test_font_size_tag.rb
|
204
278
|
- test/test_gaiji_tag.rb
|
279
|
+
- test/test_header.rb
|
205
280
|
- test/test_helper.rb
|
281
|
+
- test/test_i18n.rb
|
206
282
|
- test/test_img_tag.rb
|
207
283
|
- test/test_inline_caption_tag.rb
|
208
284
|
- test/test_inline_font_size_tag.rb
|
@@ -212,10 +288,12 @@ test_files:
|
|
212
288
|
- test/test_jstream.rb
|
213
289
|
- test/test_kaeriten_tag.rb
|
214
290
|
- test/test_keigakomi_tag.rb
|
291
|
+
- test/test_midashi_tag.rb
|
215
292
|
- test/test_multiline_caption_tag.rb
|
216
293
|
- test/test_multiline_midashi_tag.rb
|
217
294
|
- test/test_multiline_style_tag.rb
|
218
295
|
- test/test_multiline_yokogumi_tag.rb
|
219
296
|
- test/test_okurigana_tag.rb
|
297
|
+
- test/test_ruby_parse.rb
|
220
298
|
- test/test_ruby_tag.rb
|
221
299
|
- test/test_tag_parser.rb
|
data/.travis.yml
DELETED
data/appveyor.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
install:
|
3
|
-
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
4
|
-
- ruby --version
|
5
|
-
- gem --version
|
6
|
-
- bundle install
|
7
|
-
build_script:
|
8
|
-
- bundle exec rake test
|
9
|
-
|
10
|
-
branches:
|
11
|
-
only:
|
12
|
-
- master
|
13
|
-
|
14
|
-
environment:
|
15
|
-
matrix:
|
16
|
-
- ruby_version: "200"
|
17
|
-
- ruby_version: "200-x64"
|
18
|
-
- ruby_version: "21"
|
19
|
-
- ruby_version: "21-x64"
|
20
|
-
- ruby_version: "22"
|
21
|
-
- ruby_version: "22-x64"
|
22
|
-
- ruby_version: "23"
|
23
|
-
- ruby_version: "23-x64"
|
data/lib/accent_tag.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class Accent_tag
|
2
|
-
alias_method :to_s_orig, :to_s
|
3
|
-
|
4
|
-
def self.use_jisx0213=(val)
|
5
|
-
@use_jisx0213 = val
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.use_jisx0213
|
9
|
-
@use_jisx0213
|
10
|
-
end
|
11
|
-
|
12
|
-
def jisx0213_to_unicode(code)
|
13
|
-
Aozora2Html::JIS2UCS[code]
|
14
|
-
end
|
15
|
-
|
16
|
-
def to_s
|
17
|
-
if Accent_tag.use_jisx0213
|
18
|
-
jisx0213_to_unicode(@code.sub(%r|.*/|,"").to_sym)
|
19
|
-
else
|
20
|
-
to_s_orig
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|