aozora2html 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfb62ea54699175cfd3c28221df421d4eb74f5cd
4
- data.tar.gz: 2832eaea05cba1157cc74ac0dc195317230d58da
3
+ metadata.gz: b6cfff2de9e1f983ece8fd82d5dd91dcfe108341
4
+ data.tar.gz: d5e51269b8342a2e4c73d5043b691246daf46539
5
5
  SHA512:
6
- metadata.gz: e52e8b81a6acc325dc0a518e37a29631de53f4984482192ba274fe81432322068bb323191ebd2b28349f810bc1496eb067d2dafe93a3d90ed47ec04ec08f3870
7
- data.tar.gz: 5c5efd22f9a8e10d0aeedc7564f668679fd17acf2552b1557c8278babd25677c92116142d0063ab8fea8b7bd3c8c0bfa7197e8e920a70cebbbe3d434097a9d15
6
+ metadata.gz: 3dacc3786ae5dc1aaeaf2584a13950412699889f4ec8c9cdce81e3236cf8fde9bfc789b3f1d817477dfc0bf44883180178676352d66cf5e147b715387b085dbb
7
+ data.tar.gz: 386bc597c40cd6db861759894448b82dc0b16aa53fb79be334efdf2cb67ba27c71b5d548eec6291a005e9fbaca1a1c7cb5d9571532f10da119e36166ab97a83f
data/.travis.yml CHANGED
@@ -5,4 +5,3 @@ rvm:
5
5
  - 2.0
6
6
  - 2.1
7
7
  - 2.2
8
- - ruby-head
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Aozora2Html
2
2
 
3
- [![Build Status](https://travis-ci.org/aozorahack/aozora2html.svg?branch=master)](https://travis-ci.org/aozorahack/aozora2html) [![Gem Version](https://badge.fury.io/rb/aozora2html.svg)](https://badge.fury.io/rb/aozora2html) [![Code Climate](https://codeclimate.com/github/aozorahack/aozora2html/badges/gpa.svg)](https://codeclimate.com/github/aozorahack/aozora2html)
3
+ [![Build Status](https://travis-ci.org/aozorahack/aozora2html.svg?branch=master)](https://travis-ci.org/aozorahack/aozora2html) [![Gem Version](https://badge.fury.io/rb/aozora2html.svg)](https://badge.fury.io/rb/aozora2html) [![Build Status](https://ci.appveyor.com/api/projects/status/9ds6wksavm50ha9v/branch/master?svg=true)](https://ci.appveyor.com/project/takahashim/aozora2html/branch/master) [![Code Climate](https://codeclimate.com/github/aozorahack/aozora2html/badges/gpa.svg)](https://codeclimate.com/github/aozorahack/aozora2html)
4
4
 
5
5
  青空文庫の「組版案内」( http://kumihan.aozora.gr.jp/ )で配布されているtxt2html内にあるt2hs.rbを改造するプロジェクトです。
6
6
 
data/appveyor.yml ADDED
@@ -0,0 +1,19 @@
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/bin/aozora2html CHANGED
@@ -53,6 +53,7 @@ end
53
53
 
54
54
  opt = OptionParser.new("Usage: aozora2html [options] <text file> [<html file>]\n")
55
55
  opt.on('--gaiji-dir DIR', 'setting gaiji directory')
56
+ opt.on('--css-files FILES', 'setting css directory')
56
57
  opt.on('--use-jisx0213', 'use JIS X 0213 character')
57
58
  opt.on('--use-unicode', 'use Unicode character')
58
59
  opt.version = Aozora2Html::VERSION
@@ -62,6 +63,10 @@ if options["gaiji-dir"]
62
63
  $gaiji_dir = options["gaiji-dir"]
63
64
  end
64
65
 
66
+ if options["css-files"]
67
+ $css_files = options["css-files"].split(",")
68
+ end
69
+
65
70
  if options["use-jisx0213"]
66
71
  Embed_Gaiji_tag.use_jisx0213 = true
67
72
  Accent_tag.use_jisx0213 = true
@@ -114,4 +119,3 @@ Dir.mktmpdir do |dir|
114
119
  print output
115
120
  end
116
121
  end
117
-
@@ -1,3 +1,3 @@
1
1
  class Aozora2Html
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/t2hs.rb CHANGED
@@ -4,6 +4,8 @@ require "cgi"
4
4
 
5
5
  $gaiji_dir = "../../../gaiji/"
6
6
 
7
+ $css_files = Array["../../aozora.css"]
8
+
7
9
  # 1.8 like to_s method to Array
8
10
  class Array
9
11
  def to_s
@@ -1157,7 +1159,11 @@ class Aozora2Html
1157
1159
  html_title += "</title>"
1158
1160
 
1159
1161
  # �o��
1160
- @out.print("<?xml version=\"1.0\" encoding=\"Shift_JIS\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ja\" >\r\n<head>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html;charset=Shift_JIS\" />\r\n <meta http-equiv=\"content-style-type\" content=\"text/css\" />\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../aozora.css\" />\r\n\t#{html_title}\r\n <script type=\"text/javascript\" src=\"../../jquery-1.4.2.min.js\"></script>\r\n <link rel=\"Schema.DC\" href=\"http://purl.org/dc/elements/1.1/\" />\r\n <meta name=\"DC.Title\" content=\"#{header_info[:title]}\" />\r\n <meta name=\"DC.Creator\" content=\"#{header_info[:author]}\" />\r\n <meta name=\"DC.Publisher\" content=\"�‹󕶌�\" />\r\n</head>\r\n<body>\r\n<div class=\"metadata\">\r\n")
1162
+ @out.print("<?xml version=\"1.0\" encoding=\"Shift_JIS\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ja\" >\r\n<head>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html;charset=Shift_JIS\" />\r\n <meta http-equiv=\"content-style-type\" content=\"text/css\" />\r\n")
1163
+ $css_files.each{|css|
1164
+ @out.print("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" + css + "\" />\r\n")
1165
+ }
1166
+ @out.print("\t#{html_title}\r\n <script type=\"text/javascript\" src=\"../../jquery-1.4.2.min.js\"></script>\r\n <link rel=\"Schema.DC\" href=\"http://purl.org/dc/elements/1.1/\" />\r\n <meta name=\"DC.Title\" content=\"#{header_info[:title]}\" />\r\n <meta name=\"DC.Creator\" content=\"#{header_info[:author]}\" />\r\n <meta name=\"DC.Publisher\" content=\"�‹󕶌�\" />\r\n</head>\r\n<body>\r\n<div class=\"metadata\">\r\n")
1161
1167
  @out.print("<h1 class=\"title\">#{header_info[:title]}</h1>\r\n")
1162
1168
  out_header_info(header_info, :original_title)
1163
1169
  out_header_info(header_info, :subtitle)
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.6.1
4
+ version: 0.7.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: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -125,6 +125,7 @@ files:
125
125
  - README.md
126
126
  - Rakefile
127
127
  - aozora2html.gemspec
128
+ - appveyor.yml
128
129
  - bin/aozora2html
129
130
  - lib/accent_tag.rb
130
131
  - lib/aozora2html.rb
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  version: '0'
186
187
  requirements: []
187
188
  rubyforge_project:
188
- rubygems_version: 2.4.5
189
+ rubygems_version: 2.5.1
189
190
  signing_key:
190
191
  specification_version: 4
191
192
  summary: converter from Aozora Bunko format into xhtml. It's based of t2hs.rb from
@@ -218,4 +219,3 @@ test_files:
218
219
  - test/test_okurigana_tag.rb
219
220
  - test/test_ruby_tag.rb
220
221
  - test/test_tag_parser.rb
221
- has_rdoc: