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 +4 -4
- data/LICENSE.txt +22 -0
- data/README.md +11 -9
- data/lib/asciidoctor-pdf-cjk.rb +1 -0
- data/lib/asciidoctor/pdf/cjk/converter.rb +1 -1
- data/lib/asciidoctor/pdf/cjk/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4873a2220e7a4f43135fe7b5fbf682b519515cb
|
4
|
+
data.tar.gz: 5a2284a7d37a9fe72feceaed3c082209ad3fc320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
1
|
+
# Asciidoctor PDF CJK: A CJK extension fo Asciidoctor PDF
|
2
2
|
|
3
|
-
|
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
|
-
|
26
|
+
Render PDF:
|
27
|
+
|
28
|
+
$ asciidoctor-pdf -r asciidoctor-pdf-cjk doc.asc
|
26
29
|
|
27
|
-
##
|
30
|
+
## Themes
|
28
31
|
|
29
|
-
|
32
|
+
- [Asciidoctor::Pdf::CJK::KaiGenGothicCn](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic)
|
30
33
|
|
31
|
-
|
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| "#{
|
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
|
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.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
|
+
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
|