aozora2html 0.7.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +34 -0
  3. data/.gitignore +8 -3
  4. data/.rubocop.yml +227 -0
  5. data/.travis.yml +5 -0
  6. data/CHANGELOG.md +33 -0
  7. data/LICENSE +116 -0
  8. data/README.md +16 -11
  9. data/aozora2html.gemspec +6 -6
  10. data/bin/aozora2html +6 -54
  11. data/lib/aozora2html/accent_parser.rb +91 -0
  12. data/lib/aozora2html/error.rb +16 -0
  13. data/lib/aozora2html/header.rb +139 -0
  14. data/lib/aozora2html/i18n.rb +28 -0
  15. data/lib/aozora2html/ruby_buffer.rb +81 -0
  16. data/lib/aozora2html/style_stack.rb +27 -0
  17. data/lib/aozora2html/tag/accent.rb +39 -0
  18. data/lib/aozora2html/tag/block.rb +19 -0
  19. data/lib/aozora2html/tag/chitsuki.rb +15 -0
  20. data/lib/aozora2html/tag/dakuten_katakana.rb +23 -0
  21. data/lib/aozora2html/tag/decorate.rb +18 -0
  22. data/lib/aozora2html/tag/dir.rb +15 -0
  23. data/lib/aozora2html/tag/editor_note.rb +16 -0
  24. data/lib/aozora2html/tag/embed_gaiji.rb +48 -0
  25. data/lib/aozora2html/tag/font_size.rb +17 -0
  26. data/lib/aozora2html/tag/gaiji.rb +11 -0
  27. data/lib/aozora2html/tag/img.rb +21 -0
  28. data/lib/aozora2html/tag/indent.rb +8 -0
  29. data/lib/aozora2html/tag/inline.rb +13 -0
  30. data/lib/aozora2html/tag/inline_caption.rb +15 -0
  31. data/lib/aozora2html/tag/inline_font_size.rb +18 -0
  32. data/lib/aozora2html/tag/inline_keigakomi.rb +15 -0
  33. data/lib/aozora2html/tag/inline_yokogumi.rb +16 -0
  34. data/lib/aozora2html/tag/jisage.rb +15 -0
  35. data/lib/aozora2html/tag/jizume.rb +16 -0
  36. data/lib/aozora2html/tag/kaeriten.rb +15 -0
  37. data/lib/aozora2html/tag/keigakomi.rb +13 -0
  38. data/lib/aozora2html/tag/kunten.rb +12 -0
  39. data/lib/aozora2html/tag/midashi.rb +18 -0
  40. data/lib/aozora2html/tag/multiline.rb +6 -0
  41. data/lib/aozora2html/tag/multiline_caption.rb +15 -0
  42. data/lib/aozora2html/tag/multiline_chitsuki.rb +8 -0
  43. data/lib/aozora2html/tag/multiline_jisage.rb +8 -0
  44. data/lib/aozora2html/tag/multiline_midashi.rb +22 -0
  45. data/lib/aozora2html/tag/multiline_style.rb +17 -0
  46. data/lib/aozora2html/tag/multiline_yokogumi.rb +17 -0
  47. data/lib/aozora2html/tag/okurigana.rb +15 -0
  48. data/lib/aozora2html/tag/oneline_chitsuki.rb +9 -0
  49. data/lib/aozora2html/tag/oneline_indent.rb +2 -0
  50. data/lib/aozora2html/tag/oneline_jisage.rb +7 -0
  51. data/lib/aozora2html/tag/reference_mentioned.rb +46 -0
  52. data/lib/aozora2html/tag/ruby.rb +98 -0
  53. data/lib/aozora2html/tag/un_embed_gaiji.rb +24 -0
  54. data/lib/aozora2html/tag.rb +55 -0
  55. data/lib/aozora2html/tag_parser.rb +53 -0
  56. data/lib/aozora2html/utils.rb +93 -0
  57. data/lib/aozora2html/version.rb +1 -1
  58. data/lib/aozora2html/yaml_loader.rb +31 -0
  59. data/lib/aozora2html.rb +0 -4
  60. data/lib/extensions.rb +44 -0
  61. data/lib/jstream.rb +68 -0
  62. data/lib/t2hs.rb +837 -1765
  63. data/test/test_aozora2html.rb +320 -43
  64. data/test/test_aozora_accent_parser.rb +13 -2
  65. data/test/test_command_parse.rb +213 -0
  66. data/test/test_dakuten_katakana_tag.rb +5 -4
  67. data/test/test_decorate_tag.rb +5 -4
  68. data/test/test_dir_tag.rb +5 -4
  69. data/test/test_editor_note_tag.rb +4 -4
  70. data/test/test_exception.rb +4 -4
  71. data/test/test_font_size_tag.rb +15 -7
  72. data/test/test_gaiji_tag.rb +14 -7
  73. data/test/test_header.rb +60 -0
  74. data/test/test_i18n.rb +23 -0
  75. data/test/test_img_tag.rb +5 -4
  76. data/test/test_inline_caption_tag.rb +5 -4
  77. data/test/test_inline_font_size_tag.rb +7 -6
  78. data/test/test_inline_keigakomi_tag.rb +5 -4
  79. data/test/test_inline_yokogumi_tag.rb +5 -4
  80. data/test/test_jizume_tag.rb +7 -6
  81. data/test/test_jstream.rb +5 -5
  82. data/test/test_kaeriten_tag.rb +5 -4
  83. data/test/test_keigakomi_tag.rb +8 -7
  84. data/test/test_midashi_tag.rb +38 -0
  85. data/test/test_multiline_caption_tag.rb +7 -6
  86. data/test/test_multiline_midashi_tag.rb +24 -7
  87. data/test/test_multiline_style_tag.rb +7 -6
  88. data/test/test_multiline_yokogumi_tag.rb +7 -6
  89. data/test/test_okurigana_tag.rb +5 -4
  90. data/test/test_ruby_parse.rb +130 -0
  91. data/test/test_ruby_tag.rb +5 -4
  92. data/test/test_tag_parser.rb +10 -10
  93. data/vendor/jis2ucs/README.md +3 -6
  94. data/yml/accent_table.yml +240 -0
  95. data/yml/command_table.yml +61 -0
  96. data/yml/jis2ucs.yml +11234 -0
  97. metadata +74 -42
  98. data/appveyor.yml +0 -19
  99. data/lib/accent_tag.rb +0 -23
  100. data/lib/aozora2html/jis2ucs.rb +0 -11237
  101. data/lib/embed_gaiji_tag.rb +0 -34
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aozora2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aozorahack team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-26 00:00:00.000000000 Z
11
+ date: 2021-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
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: '10.0'
54
+ version: '12.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-unit
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,34 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: guard
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: guard-test
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
83
  description: converter from Aozora Bunko format into xhtml. It's based of t2hs.rb
112
84
  from kumihan.aozora.gr.jp.
113
85
  email:
@@ -117,27 +89,76 @@ executables:
117
89
  extensions: []
118
90
  extra_rdoc_files: []
119
91
  files:
92
+ - ".github/workflows/ruby.yml"
120
93
  - ".gitignore"
94
+ - ".rubocop.yml"
121
95
  - ".travis.yml"
122
96
  - CHANGELOG.md
123
97
  - Gemfile
124
98
  - Guardfile
99
+ - LICENSE
125
100
  - README.md
126
101
  - Rakefile
127
102
  - aozora2html.gemspec
128
- - appveyor.yml
129
103
  - bin/aozora2html
130
- - lib/accent_tag.rb
131
104
  - lib/aozora2html.rb
132
- - lib/aozora2html/jis2ucs.rb
105
+ - lib/aozora2html/accent_parser.rb
106
+ - lib/aozora2html/error.rb
107
+ - lib/aozora2html/header.rb
108
+ - lib/aozora2html/i18n.rb
109
+ - lib/aozora2html/ruby_buffer.rb
110
+ - lib/aozora2html/style_stack.rb
111
+ - lib/aozora2html/tag.rb
112
+ - lib/aozora2html/tag/accent.rb
113
+ - lib/aozora2html/tag/block.rb
114
+ - lib/aozora2html/tag/chitsuki.rb
115
+ - lib/aozora2html/tag/dakuten_katakana.rb
116
+ - lib/aozora2html/tag/decorate.rb
117
+ - lib/aozora2html/tag/dir.rb
118
+ - lib/aozora2html/tag/editor_note.rb
119
+ - lib/aozora2html/tag/embed_gaiji.rb
120
+ - lib/aozora2html/tag/font_size.rb
121
+ - lib/aozora2html/tag/gaiji.rb
122
+ - lib/aozora2html/tag/img.rb
123
+ - lib/aozora2html/tag/indent.rb
124
+ - lib/aozora2html/tag/inline.rb
125
+ - lib/aozora2html/tag/inline_caption.rb
126
+ - lib/aozora2html/tag/inline_font_size.rb
127
+ - lib/aozora2html/tag/inline_keigakomi.rb
128
+ - lib/aozora2html/tag/inline_yokogumi.rb
129
+ - lib/aozora2html/tag/jisage.rb
130
+ - lib/aozora2html/tag/jizume.rb
131
+ - lib/aozora2html/tag/kaeriten.rb
132
+ - lib/aozora2html/tag/keigakomi.rb
133
+ - lib/aozora2html/tag/kunten.rb
134
+ - lib/aozora2html/tag/midashi.rb
135
+ - lib/aozora2html/tag/multiline.rb
136
+ - lib/aozora2html/tag/multiline_caption.rb
137
+ - lib/aozora2html/tag/multiline_chitsuki.rb
138
+ - lib/aozora2html/tag/multiline_jisage.rb
139
+ - lib/aozora2html/tag/multiline_midashi.rb
140
+ - lib/aozora2html/tag/multiline_style.rb
141
+ - lib/aozora2html/tag/multiline_yokogumi.rb
142
+ - lib/aozora2html/tag/okurigana.rb
143
+ - lib/aozora2html/tag/oneline_chitsuki.rb
144
+ - lib/aozora2html/tag/oneline_indent.rb
145
+ - lib/aozora2html/tag/oneline_jisage.rb
146
+ - lib/aozora2html/tag/reference_mentioned.rb
147
+ - lib/aozora2html/tag/ruby.rb
148
+ - lib/aozora2html/tag/un_embed_gaiji.rb
149
+ - lib/aozora2html/tag_parser.rb
150
+ - lib/aozora2html/utils.rb
133
151
  - lib/aozora2html/version.rb
152
+ - lib/aozora2html/yaml_loader.rb
134
153
  - lib/aozora2html/zip.rb
135
- - lib/embed_gaiji_tag.rb
154
+ - lib/extensions.rb
155
+ - lib/jstream.rb
136
156
  - lib/t2hs.rb
137
157
  - sample/chukiichiran_kinyurei.html
138
158
  - sample/chukiichiran_kinyurei.txt
139
159
  - test/test_aozora2html.rb
140
160
  - test/test_aozora_accent_parser.rb
161
+ - test/test_command_parse.rb
141
162
  - test/test_compat.rb
142
163
  - test/test_dakuten_katakana_tag.rb
143
164
  - test/test_decorate_tag.rb
@@ -146,7 +167,9 @@ files:
146
167
  - test/test_exception.rb
147
168
  - test/test_font_size_tag.rb
148
169
  - test/test_gaiji_tag.rb
170
+ - test/test_header.rb
149
171
  - test/test_helper.rb
172
+ - test/test_i18n.rb
150
173
  - test/test_img_tag.rb
151
174
  - test/test_inline_caption_tag.rb
152
175
  - test/test_inline_font_size_tag.rb
@@ -156,16 +179,21 @@ files:
156
179
  - test/test_jstream.rb
157
180
  - test/test_kaeriten_tag.rb
158
181
  - test/test_keigakomi_tag.rb
182
+ - test/test_midashi_tag.rb
159
183
  - test/test_multiline_caption_tag.rb
160
184
  - test/test_multiline_midashi_tag.rb
161
185
  - test/test_multiline_style_tag.rb
162
186
  - test/test_multiline_yokogumi_tag.rb
163
187
  - test/test_okurigana_tag.rb
188
+ - test/test_ruby_parse.rb
164
189
  - test/test_ruby_tag.rb
165
190
  - test/test_tag_parser.rb
166
191
  - vendor/jis2ucs/README.md
167
192
  - vendor/jis2ucs/jisx0213-2004-mono.html
168
193
  - vendor/jis2ucs/mkconv.rb
194
+ - yml/accent_table.yml
195
+ - yml/command_table.yml
196
+ - yml/jis2ucs.yml
169
197
  homepage: https://github.com/aozorahack/aozora2html
170
198
  licenses:
171
199
  - CC0
@@ -185,8 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
213
  - !ruby/object:Gem::Version
186
214
  version: '0'
187
215
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.5.1
216
+ rubygems_version: 3.0.3.1
190
217
  signing_key:
191
218
  specification_version: 4
192
219
  summary: converter from Aozora Bunko format into xhtml. It's based of t2hs.rb from
@@ -194,6 +221,7 @@ summary: converter from Aozora Bunko format into xhtml. It's based of t2hs.rb fr
194
221
  test_files:
195
222
  - test/test_aozora2html.rb
196
223
  - test/test_aozora_accent_parser.rb
224
+ - test/test_command_parse.rb
197
225
  - test/test_compat.rb
198
226
  - test/test_dakuten_katakana_tag.rb
199
227
  - test/test_decorate_tag.rb
@@ -202,7 +230,9 @@ test_files:
202
230
  - test/test_exception.rb
203
231
  - test/test_font_size_tag.rb
204
232
  - test/test_gaiji_tag.rb
233
+ - test/test_header.rb
205
234
  - test/test_helper.rb
235
+ - test/test_i18n.rb
206
236
  - test/test_img_tag.rb
207
237
  - test/test_inline_caption_tag.rb
208
238
  - test/test_inline_font_size_tag.rb
@@ -212,10 +242,12 @@ test_files:
212
242
  - test/test_jstream.rb
213
243
  - test/test_kaeriten_tag.rb
214
244
  - test/test_keigakomi_tag.rb
245
+ - test/test_midashi_tag.rb
215
246
  - test/test_multiline_caption_tag.rb
216
247
  - test/test_multiline_midashi_tag.rb
217
248
  - test/test_multiline_style_tag.rb
218
249
  - test/test_multiline_yokogumi_tag.rb
219
250
  - test/test_okurigana_tag.rb
251
+ - test/test_ruby_parse.rb
220
252
  - test/test_ruby_tag.rb
221
253
  - test/test_tag_parser.rb
data/appveyor.yml DELETED
@@ -1,19 +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
- artifacts:
10
- - path: pkg\*.gem
11
-
12
- environment:
13
- matrix:
14
- - ruby_version: "200"
15
- - ruby_version: "200-x64"
16
- - ruby_version: "21"
17
- - ruby_version: "21-x64"
18
- - ruby_version: "22"
19
- - ruby_version: "22-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