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
data/lib/embed_gaiji_tag.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
class Embed_Gaiji_tag
|
2
|
-
alias_method :to_s_orig, :to_s
|
3
|
-
attr_accessor :unicode
|
4
|
-
|
5
|
-
def self.use_jisx0213=(val)
|
6
|
-
@use_jisx0213 = val
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.use_jisx0213
|
10
|
-
@use_jisx0213
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.use_unicode=(val)
|
14
|
-
@use_unicode = val
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.use_unicode
|
18
|
-
@use_unicode
|
19
|
-
end
|
20
|
-
|
21
|
-
def jisx0213_to_unicode(code)
|
22
|
-
Aozora2Html::JIS2UCS[code]
|
23
|
-
end
|
24
|
-
|
25
|
-
def to_s
|
26
|
-
if Embed_Gaiji_tag.use_jisx0213 && @code
|
27
|
-
jisx0213_to_unicode(@code.to_sym)
|
28
|
-
elsif Embed_Gaiji_tag.use_unicode && @unicode
|
29
|
-
'&#x'+@unicode+';'
|
30
|
-
else
|
31
|
-
to_s_orig
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|