asciidoctor-pdf-cjk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02fce84c2e9ceb6d729919671d8ffdafefe000f9
4
- data.tar.gz: e56e7aeebdf7dc93de694a69f8fc0c70f235c7a6
3
+ metadata.gz: a4873a2220e7a4f43135fe7b5fbf682b519515cb
4
+ data.tar.gz: 5a2284a7d37a9fe72feceaed3c082209ad3fc320
5
5
  SHA512:
6
- metadata.gz: e64ae3d21a79702535c1c7860b02d3fdf1b927783e5d0154d702543e96f4fd7508e7d2d83690a38497a75a8549e445fb7cccf6863ddeca6eaddceeeff4b1e492
7
- data.tar.gz: 1317f17a9dfdd8c33b2f646618c2fba78702b612e9cc9ae69add3c6786d2eb1673b25247240027abbb5a55c98a40f4a65e4333f5bbf48e6e811c7c59cd6c2dc5
6
+ metadata.gz: 2341bba54db734bc81500efe2531fa826be52fb95dbc299e8aae10d11ff7da1d9b741ee94e5005a0f673959a0c6eb268d13f53dfdd6f888d99a80a4bf3e1fb8c
7
+ data.tar.gz: 70325b1988303031d8e885368a3ff9695edd3f3c45ee9fa058eb2e5be782512825fdf3d537a166c30c1b5a2747ed6be73ee4b3cfedc75b54b37c0cf39d40ce59
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Rei
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,15 +1,16 @@
1
- # Asciidoctor::Pdf::Cjk
1
+ # Asciidoctor PDF CJK: A CJK extension fo Asciidoctor PDF
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/asciidoctor/pdf/cjk`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Current do this things:
4
+
5
+ - Insert zero-width space(ZWSP) before CJ characters to fix line wrap
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
6
7
 
7
8
  ## Installation
8
9
 
9
10
  Add this line to your application's Gemfile:
10
11
 
11
12
  ```ruby
12
- gem 'asciidoctor-pdf-cjk'
13
+ gem 'asciidoctor-pdf-cjk', '~> 0.1.1'
13
14
  ```
14
15
 
15
16
  And then execute:
@@ -22,15 +23,16 @@ Or install it yourself as:
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ Render PDF:
27
+
28
+ $ asciidoctor-pdf -r asciidoctor-pdf-cjk doc.asc
26
29
 
27
- ## Development
30
+ ## Themes
28
31
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+ - [Asciidoctor::Pdf::CJK::KaiGenGothicCn](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic)
30
33
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+ A theme using font [KaiGen Gothic](https://github.com/akiratw/kaigen-gothic).
32
35
 
33
36
  ## Contributing
34
37
 
35
38
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/asciidoctor-pdf-cjk.
36
-
@@ -0,0 +1 @@
1
+ require "asciidoctor/pdf/cjk"
@@ -2,7 +2,7 @@ module Asciidoctor
2
2
  module Pdf
3
3
  class Converter
4
4
  def typeset_text_with_break_word(string, line_metrics, opts = {})
5
- typeset_text_without_break_word string.gsub(/[\p{Han}\p{Hiragana}\p{Katakana}]/) {|s| "#{s}#{::Prawn::Text::ZWSP}"}, line_metrics, opts
5
+ typeset_text_without_break_word string.gsub(/(?<!\p{Space})[\p{Han}\p{Hiragana}\p{Katakana}]/) {|s| "#{::Prawn::Text::ZWSP}#{s}"}, line_metrics, opts
6
6
  end
7
7
  alias_method :typeset_text_without_break_word, :typeset_text
8
8
  alias_method :typeset_text, :typeset_text_with_break_word
@@ -1,7 +1,7 @@
1
1
  module Asciidoctor
2
2
  module Pdf
3
3
  module Cjk
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-pdf-cjk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-11 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor-pdf
@@ -76,11 +76,13 @@ files:
76
76
  - ".gitignore"
77
77
  - ".travis.yml"
78
78
  - Gemfile
79
+ - LICENSE.txt
79
80
  - README.md
80
81
  - Rakefile
81
82
  - asciidoctor-pdf-cjk.gemspec
82
83
  - bin/console
83
84
  - bin/setup
85
+ - lib/asciidoctor-pdf-cjk.rb
84
86
  - lib/asciidoctor/pdf/cjk.rb
85
87
  - lib/asciidoctor/pdf/cjk/converter.rb
86
88
  - lib/asciidoctor/pdf/cjk/version.rb