asciidoctor-pdf-cjk 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/asciidoctor/pdf/cjk.rb +3 -0
- data/lib/asciidoctor/pdf/cjk/converter.rb +4 -4
- data/lib/asciidoctor/pdf/cjk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9cd11f8007d30919399b1f00fe8436942f5a56a
|
4
|
+
data.tar.gz: 18963e488654fa8d9216dd5c1d11cc8330c20a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6484f5edcf84da57cdd7a2ddebc8cc0f6a0b436ae5c0da3b5297a33b0827e3348d60a68eeb41c862282198ad055dcf8f7b4b0822a0756ab4e98280cf35ea453c
|
7
|
+
data.tar.gz: 356a81c5527aec134b343e79f1d6636b104b761898e648975c42273be5edea9e8507176a0d68da40791e4e4c4d86bfc90f07417e6d05675ce724cfccbaa4d764
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Current do this things:
|
|
10
10
|
Add this line to your application's Gemfile:
|
11
11
|
|
12
12
|
```ruby
|
13
|
-
gem 'asciidoctor-pdf-cjk', '~> 0.1.
|
13
|
+
gem 'asciidoctor-pdf-cjk', '~> 0.1.2'
|
14
14
|
```
|
15
15
|
|
16
16
|
And then execute:
|
@@ -29,10 +29,10 @@ Render PDF:
|
|
29
29
|
|
30
30
|
## Themes
|
31
31
|
|
32
|
-
- [Asciidoctor::Pdf::CJK::
|
32
|
+
- [Asciidoctor::Pdf::CJK::KaiGenGothic](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic)
|
33
33
|
|
34
34
|
A theme using font [KaiGen Gothic](https://github.com/akiratw/kaigen-gothic).
|
35
35
|
|
36
36
|
## Contributing
|
37
37
|
|
38
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chloerei/asciidoctor-pdf-cjk.
|
data/lib/asciidoctor/pdf/cjk.rb
CHANGED
@@ -5,6 +5,9 @@ require "asciidoctor/pdf/cjk/converter"
|
|
5
5
|
module Asciidoctor
|
6
6
|
module Pdf
|
7
7
|
module Cjk
|
8
|
+
def self.break_words(string)
|
9
|
+
string.gsub(/(?<!^|\p{Space}|\p{Ps}|\p{Pi})[\p{Han}\p{Hiragana}\p{Katakana}\p{Ps}\p{Pi}]/) {|s| "#{::Prawn::Text::ZWSP}#{s}"}
|
10
|
+
end
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Asciidoctor
|
2
2
|
module Pdf
|
3
3
|
class Converter
|
4
|
-
def
|
5
|
-
|
4
|
+
def typeset_text_with_break_words(string, line_metrics, opts = {})
|
5
|
+
typeset_text_without_break_words ::Asciidoctor::Pdf::Cjk.break_words(string), line_metrics, opts
|
6
6
|
end
|
7
|
-
alias_method :
|
8
|
-
alias_method :typeset_text, :
|
7
|
+
alias_method :typeset_text_without_break_words, :typeset_text
|
8
|
+
alias_method :typeset_text, :typeset_text_with_break_words
|
9
9
|
end
|
10
10
|
end
|
11
11
|
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor-pdf
|