aozora2html 0.7.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aozora2html +3 -50
  3. data/lib/aozora2html.rb +0 -4
  4. data/lib/aozora2html/accent_parser.rb +91 -0
  5. data/lib/aozora2html/error.rb +16 -0
  6. data/lib/aozora2html/header.rb +139 -0
  7. data/lib/aozora2html/i18n.rb +17 -0
  8. data/lib/aozora2html/ruby_buffer.rb +81 -0
  9. data/lib/aozora2html/style_stack.rb +27 -0
  10. data/lib/aozora2html/tag.rb +55 -0
  11. data/lib/aozora2html/tag/accent.rb +39 -0
  12. data/lib/aozora2html/tag/block.rb +19 -0
  13. data/lib/aozora2html/tag/chitsuki.rb +15 -0
  14. data/lib/aozora2html/tag/dakuten_katakana.rb +23 -0
  15. data/lib/aozora2html/tag/decorate.rb +18 -0
  16. data/lib/aozora2html/tag/dir.rb +15 -0
  17. data/lib/aozora2html/tag/editor_note.rb +16 -0
  18. data/lib/aozora2html/tag/embed_gaiji.rb +48 -0
  19. data/lib/aozora2html/tag/font_size.rb +17 -0
  20. data/lib/aozora2html/tag/gaiji.rb +11 -0
  21. data/lib/aozora2html/tag/img.rb +21 -0
  22. data/lib/aozora2html/tag/indent.rb +8 -0
  23. data/lib/aozora2html/tag/inline.rb +13 -0
  24. data/lib/aozora2html/tag/inline_caption.rb +15 -0
  25. data/lib/aozora2html/tag/inline_font_size.rb +18 -0
  26. data/lib/aozora2html/tag/inline_keigakomi.rb +15 -0
  27. data/lib/aozora2html/tag/inline_yokogumi.rb +16 -0
  28. data/lib/aozora2html/tag/jisage.rb +15 -0
  29. data/lib/aozora2html/tag/jizume.rb +16 -0
  30. data/lib/aozora2html/tag/kaeriten.rb +15 -0
  31. data/lib/aozora2html/tag/keigakomi.rb +13 -0
  32. data/lib/aozora2html/tag/kunten.rb +12 -0
  33. data/lib/aozora2html/tag/midashi.rb +18 -0
  34. data/lib/aozora2html/tag/multiline.rb +6 -0
  35. data/lib/aozora2html/tag/multiline_caption.rb +15 -0
  36. data/lib/aozora2html/tag/multiline_chitsuki.rb +8 -0
  37. data/lib/aozora2html/tag/multiline_jisage.rb +8 -0
  38. data/lib/aozora2html/tag/multiline_midashi.rb +22 -0
  39. data/lib/aozora2html/tag/multiline_style.rb +17 -0
  40. data/lib/aozora2html/tag/multiline_yokogumi.rb +17 -0
  41. data/lib/aozora2html/tag/okurigana.rb +15 -0
  42. data/lib/aozora2html/tag/oneline_chitsuki.rb +9 -0
  43. data/lib/aozora2html/tag/oneline_indent.rb +2 -0
  44. data/lib/aozora2html/tag/oneline_jisage.rb +7 -0
  45. data/lib/aozora2html/tag/reference_mentioned.rb +46 -0
  46. data/lib/aozora2html/tag/ruby.rb +98 -0
  47. data/lib/aozora2html/tag/un_embed_gaiji.rb +24 -0
  48. data/lib/aozora2html/tag_parser.rb +53 -0
  49. data/lib/aozora2html/utils.rb +82 -0
  50. data/lib/aozora2html/version.rb +1 -1
  51. data/lib/aozora2html/yaml_loader.rb +31 -0
  52. data/lib/extensions.rb +31 -0
  53. data/lib/jstream.rb +68 -0
  54. data/lib/t2hs.rb +485 -1490
  55. data/test/test_aozora2html.rb +161 -57
  56. data/test/test_aozora_accent_parser.rb +13 -2
  57. data/test/test_command_parse.rb +213 -0
  58. data/test/test_dakuten_katakana_tag.rb +5 -4
  59. data/test/test_decorate_tag.rb +5 -4
  60. data/test/test_dir_tag.rb +5 -4
  61. data/test/test_editor_note_tag.rb +4 -4
  62. data/test/test_exception.rb +4 -4
  63. data/test/test_font_size_tag.rb +8 -7
  64. data/test/test_gaiji_tag.rb +14 -7
  65. data/test/test_header.rb +60 -0
  66. data/test/test_img_tag.rb +5 -4
  67. data/test/test_inline_caption_tag.rb +5 -4
  68. data/test/test_inline_font_size_tag.rb +7 -6
  69. data/test/test_inline_keigakomi_tag.rb +5 -4
  70. data/test/test_inline_yokogumi_tag.rb +5 -4
  71. data/test/test_jizume_tag.rb +7 -6
  72. data/test/test_jstream.rb +5 -5
  73. data/test/test_kaeriten_tag.rb +5 -4
  74. data/test/test_keigakomi_tag.rb +8 -7
  75. data/test/test_midashi_tag.rb +38 -0
  76. data/test/test_multiline_caption_tag.rb +7 -6
  77. data/test/test_multiline_midashi_tag.rb +12 -11
  78. data/test/test_multiline_style_tag.rb +7 -6
  79. data/test/test_multiline_yokogumi_tag.rb +7 -6
  80. data/test/test_okurigana_tag.rb +5 -4
  81. data/test/test_ruby_parse.rb +116 -0
  82. data/test/test_ruby_tag.rb +5 -4
  83. data/test/test_tag_parser.rb +10 -10
  84. data/yml/accent_table.yml +240 -0
  85. data/yml/command_table.yml +61 -0
  86. data/yml/jis2ucs.yml +11234 -0
  87. metadata +63 -6
  88. data/lib/accent_tag.rb +0 -23
  89. data/lib/aozora2html/jis2ucs.rb +0 -11237
  90. data/lib/embed_gaiji_tag.rb +0 -34
@@ -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