Skip to content

Commit

Permalink
Add PDF CJK theme
Browse files Browse the repository at this point in the history
  • Loading branch information
chloerei committed Jul 12, 2015
1 parent 5d1559e commit f840b91
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ gem 'json'
gem 'awesome_print'

gem 'asciidoctor-epub3', '1.0.0.alpha.2'
gem 'asciidoctor-pdf', '1.5.0.alpha.5'
gem 'asciidoctor-pdf', '1.5.0.alpha.8'
gem 'asciidoctor-pdf-cjk-kai_gen_gothic', '~> 0.1.0'

gem 'coderay'
gem 'pygments.rb'
Expand Down
44 changes: 31 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.2)
addressable (2.3.8)
afm (0.2.2)
asciidoctor (1.5.0)
asciidoctor-epub3 (1.0.0.alpha.2)
asciidoctor (>= 1.5.0, < 1.6.0)
gepub (~> 0.6.9.2)
thread_safe (~> 0.3.4)
asciidoctor-pdf (1.5.0.alpha.5)
asciidoctor-pdf (1.5.0.alpha.8)
asciidoctor (~> 1.5.0)
prawn (= 1.2.1)
prawn-svg (= 0.16.0)
prawn-table (= 0.1.1)
prawn (>= 1.3.0, < 3.0.0)
prawn-icon (= 0.6.4)
prawn-svg (= 0.20.0)
prawn-table (= 0.2.1)
prawn-templates (= 0.0.3)
safe_yaml (= 1.0.4)
thread_safe (= 0.3.4)
treetop (= 1.5.3)
asciidoctor-pdf-cjk (0.1.1)
asciidoctor-pdf (~> 1.5.0.alpha.8)
asciidoctor-pdf-cjk-kai_gen_gothic (0.1.0)
asciidoctor-pdf-cjk (~> 0.1.1)
awesome_print (1.2.0)
coderay (1.1.0)
css_parser (1.3.6)
addressable
epubcheck (3.0.1)
gepub (0.6.9.2)
nokogiri (~> 1.6.1)
Expand All @@ -27,7 +37,7 @@ GEM
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
pdf-core (0.2.5)
pdf-core (0.5.1)
pdf-reader (1.3.3)
Ascii85 (~> 1.0.0)
afm (~> 0.2.0)
Expand All @@ -36,12 +46,15 @@ GEM
ttfunk
polyglot (0.3.5)
posix-spawn (0.3.9)
prawn (1.2.1)
pdf-core (~> 0.2.5)
ttfunk (~> 1.2.0)
prawn-svg (0.16.0)
prawn (>= 0.8.4)
prawn-table (0.1.1)
prawn (2.0.1)
pdf-core (~> 0.5.1)
ttfunk (~> 1.4.0)
prawn-icon (0.6.4)
prawn (>= 1.1.0, < 3.0.0)
prawn-svg (0.20.0)
css_parser (~> 1.3)
prawn (>= 0.8.4, < 3)
prawn-table (0.2.1)
prawn-templates (0.0.3)
pdf-reader (~> 1.3)
prawn (>= 0.15.0)
Expand All @@ -51,10 +64,11 @@ GEM
rake (10.3.2)
ruby-rc4 (0.1.5)
rubyzip (1.1.6)
safe_yaml (1.0.4)
thread_safe (0.3.4)
treetop (1.5.3)
polyglot (~> 0.3)
ttfunk (1.2.2)
ttfunk (1.4.0)
yajl-ruby (1.1.0)

PLATFORMS
Expand All @@ -63,7 +77,8 @@ PLATFORMS
DEPENDENCIES
asciidoctor (= 1.5.0)
asciidoctor-epub3 (= 1.0.0.alpha.2)
asciidoctor-pdf (= 1.5.0.alpha.5)
asciidoctor-pdf (= 1.5.0.alpha.8)
asciidoctor-pdf-cjk-kai_gen_gothic (~> 0.1.0)
awesome_print
coderay
epubcheck
Expand All @@ -72,3 +87,6 @@ DEPENDENCIES
pygments.rb
rake
thread_safe

BUNDLED WITH
1.10.5
10 changes: 9 additions & 1 deletion README.asc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@

你可以在 http://git-scm.com/book[]找到当前构建,详情请见 https://progit.org[]。

另一个生成电子书文件的方法是使用 Asciidoctor 手动完成。如果你运行下面的命令,你_可能_获得 HTML、Epub、Mobi 和 PDF 输出文件:
另一个生成电子书文件的方法是使用 Asciidoctor 手动完成。

首先安装中文字体(只需运行一次):

----
$ asciidoctor-pdf-cjk-kai_gen_gothic-install
----

然后运行下面的命令,你_可能_获得 HTML、Epub、Mobi 和 PDF 输出文件:

----
$ bundle install
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace :book do
puts " -- Mobi output at progit.mobi"

puts "Converting to PDF... (this one takes a while)"
`bundle exec asciidoctor-pdf progit.asc 2>/dev/null`
`bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicCN progit.asc 2>/dev/null`
puts " -- PDF output at progit.pdf"
end
end

0 comments on commit f840b91

Please sign in to comment.