├── lib ├── asciidoctor-pdf-cjk.rb └── asciidoctor │ └── pdf │ ├── cjk │ ├── version.rb │ └── converter.rb │ └── cjk.rb ├── .travis.yml ├── Gemfile ├── .gitignore ├── bin ├── setup └── console ├── test ├── test_helper.rb └── asciidoctor │ └── pdf │ └── cjk_test.rb ├── Rakefile ├── README.md ├── asciidoctor-pdf-cjk.gemspec └── LICENSE.txt /lib/asciidoctor-pdf-cjk.rb: -------------------------------------------------------------------------------- 1 | require "asciidoctor/pdf/cjk" 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.2.2 4 | before_install: gem install bundler -v 1.10.5 5 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in asciidoctor-pdf-cjk.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /Gemfile.lock 4 | /_yardoc/ 5 | /coverage/ 6 | /doc/ 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | bundle install 6 | 7 | # Do any other automated setup that you need to do here 8 | -------------------------------------------------------------------------------- /lib/asciidoctor/pdf/cjk/version.rb: -------------------------------------------------------------------------------- 1 | module Asciidoctor 2 | module Pdf 3 | module Cjk 4 | VERSION = "0.1.3" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 2 | require 'asciidoctor/pdf/cjk' 3 | 4 | require 'minitest/autorun' 5 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | require "rake/testtask" 3 | 4 | Rake::TestTask.new(:test) do |t| 5 | t.libs << "test" 6 | t.libs << "lib" 7 | t.test_files = FileList['test/**/*_test.rb'] 8 | end 9 | 10 | task :default => :test 11 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "bundler/setup" 4 | require "asciidoctor/pdf/cjk" 5 | 6 | # You can add fixtures and/or initialization code here to make experimenting 7 | # with your gem easier. You can also use a different console, if you like. 8 | 9 | # (If you use this, don't forget to add pry to your Gemfile!) 10 | # require "pry" 11 | # Pry.start 12 | 13 | require "irb" 14 | IRB.start 15 | -------------------------------------------------------------------------------- /lib/asciidoctor/pdf/cjk.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "asciidoctor-pdf" 4 | require "asciidoctor/pdf/cjk/version" 5 | require "asciidoctor/pdf/cjk/converter" 6 | 7 | module Asciidoctor 8 | module Pdf 9 | module Cjk 10 | def self.break_words(string) 11 | string.gsub(/(? 0.1.3' 14 | ``` 15 | 16 | And then execute: 17 | 18 | $ bundle 19 | 20 | Or install it yourself as: 21 | 22 | $ gem install asciidoctor-pdf-cjk 23 | 24 | ## Usage 25 | 26 | Render PDF: 27 | 28 | $ asciidoctor-pdf -r asciidoctor-pdf-cjk doc.asc 29 | 30 | ## Themes 31 | 32 | - [Asciidoctor::Pdf::CJK::KaiGenGothic](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic) 33 | 34 | A theme using font [KaiGen Gothic](https://github.com/akiratw/kaigen-gothic). 35 | 36 | ## Contributing 37 | 38 | Bug reports and pull requests are welcome on GitHub at https://github.com/chloerei/asciidoctor-pdf-cjk. 39 | -------------------------------------------------------------------------------- /asciidoctor-pdf-cjk.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'asciidoctor/pdf/cjk/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "asciidoctor-pdf-cjk" 8 | spec.version = Asciidoctor::Pdf::Cjk::VERSION 9 | spec.authors = ["Rei"] 10 | spec.email = ["chloerei@gmail.com"] 11 | 12 | spec.summary = %q{asciidoctor-pdf CJK extension} 13 | spec.description = %q{asciidoctor-pdf CJK extension} 14 | spec.homepage = "" 15 | 16 | spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 17 | spec.bindir = "exe" 18 | spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 19 | spec.require_paths = ["lib"] 20 | 21 | spec.add_dependency "asciidoctor-pdf", "~> 1.5.0.alpha.8" 22 | spec.add_development_dependency "bundler", "~> 1.10" 23 | spec.add_development_dependency "rake", "~> 10.0" 24 | spec.add_development_dependency "minitest" 25 | end 26 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 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. 23 | --------------------------------------------------------------------------------