asciidoctor-nabetani 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feb568f9628d944ab1d7e1ee064b509b2cc6d06c66fd06ab011b449b1d613c58
4
- data.tar.gz: 9be05cf9c184c6623e5eaabd35afebc61ec8432fbe375e39f9c1e460108b256b
3
+ metadata.gz: 36541afab633ccb1ee3e98dec88f8bd3a9a1f6ec948eaf74d5e35adccb5f8de4
4
+ data.tar.gz: b37347e33e691667bb9459e4a8f879e3a8f274723941308b6dbb5645121c99f2
5
5
  SHA512:
6
- metadata.gz: a26321551521f6cf1ad1a8bcf11d5a25de2d8e316d0c29753c36b3d627fe9c7746998038f0456d6792b33096c1133afeebd667f3cf70d9144f684831192723c5
7
- data.tar.gz: ecef8e00c2e6f770f48d0ec678d27b6d9c46b211428669da1e20045af88cdf26886b38ab5bd0f6560171e19b25dd92cf6d0e9f84c84544b4f152209a53626ce0
6
+ metadata.gz: 0f13e4211bdaad2ba12c8f474698210ed35523412b03f60c573d66957108c330acf17f7df435c6b517870392743832e5d204863d387458ebac65a6a2317662e8
7
+ data.tar.gz: fd9c0ac361a89d31bc6d967b375d050f35d54bbf2108f36b4762ea29d7baf124e0058d2cb8e57421e4075ebdac1bb877ce285ce1432ea39f195fd63b963bf1f1
data/Gemfile CHANGED
@@ -10,3 +10,10 @@ gem "asciidoctor-pdf", "1.5.3"
10
10
  gem "prawn", "2.2.2"
11
11
  gem "prawn-table", "0.2.2"
12
12
  gem 'asciidoctor-pdf-cjk-kai_gen_gothic'
13
+
14
+ group :development do
15
+ gem 'pry'
16
+ gem 'pry-doc'
17
+ gem 'debase'
18
+ gem 'ruby-debug-ide'
19
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- asciidoctor-nabetani (0.1.2)
4
+ asciidoctor-nabetani (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -27,11 +27,16 @@ GEM
27
27
  asciidoctor-pdf (~> 1.5.0.alpha.8)
28
28
  asciidoctor-pdf-cjk-kai_gen_gothic (0.1.1)
29
29
  asciidoctor-pdf-cjk (~> 0.1.2)
30
+ coderay (1.1.3)
30
31
  concurrent-ruby (1.1.7)
31
32
  css_parser (1.7.1)
32
33
  addressable
34
+ debase (0.2.4.1)
35
+ debase-ruby_core_source (>= 0.10.2)
36
+ debase-ruby_core_source (0.10.9)
33
37
  diff-lcs (1.4.4)
34
38
  hashery (2.1.2)
39
+ method_source (1.0.0)
35
40
  pdf-core (0.7.0)
36
41
  pdf-reader (2.4.0)
37
42
  Ascii85 (~> 1.0.0)
@@ -53,6 +58,12 @@ GEM
53
58
  prawn-templates (0.1.2)
54
59
  pdf-reader (~> 2.0)
55
60
  prawn (~> 2.2)
61
+ pry (0.13.1)
62
+ coderay (~> 1.1)
63
+ method_source (~> 1.0)
64
+ pry-doc (1.1.0)
65
+ pry (~> 0.11)
66
+ yard (~> 0.9.11)
56
67
  public_suffix (4.0.5)
57
68
  rake (12.3.3)
58
69
  rspec (3.9.0)
@@ -68,12 +79,15 @@ GEM
68
79
  diff-lcs (>= 1.2.0, < 2.0)
69
80
  rspec-support (~> 3.9.0)
70
81
  rspec-support (3.9.3)
82
+ ruby-debug-ide (0.7.2)
83
+ rake (>= 0.8.1)
71
84
  ruby-rc4 (0.1.5)
72
85
  safe_yaml (1.0.5)
73
86
  thread_safe (0.3.6)
74
87
  treetop (1.6.10)
75
88
  polyglot (~> 0.3)
76
89
  ttfunk (1.5.1)
90
+ yard (0.9.25)
77
91
 
78
92
  PLATFORMS
79
93
  ruby
@@ -83,10 +97,14 @@ DEPENDENCIES
83
97
  asciidoctor-nabetani!
84
98
  asciidoctor-pdf (= 1.5.3)
85
99
  asciidoctor-pdf-cjk-kai_gen_gothic
100
+ debase
86
101
  prawn (= 2.2.2)
87
102
  prawn-table (= 0.2.2)
103
+ pry
104
+ pry-doc
88
105
  rake (~> 12.0)
89
106
  rspec (~> 3.0)
107
+ ruby-debug-ide
90
108
 
91
109
  BUNDLED WITH
92
110
  2.1.4
data/README.md CHANGED
@@ -22,10 +22,13 @@ Or install it yourself as:
22
22
  $ gem install asciidoctor-nabetani
23
23
  ```
24
24
 
25
-
26
25
  ## Usage
27
26
 
28
- TODO: Write usage instructions here
27
+ Create PDF from AsciiDoc file with this library like following:
28
+
29
+ ```
30
+ $ asciidoctor-pdf -r asciidoctor/nabetani foobar.adoc -o foobar.pdf
31
+ ```
29
32
 
30
33
  ## Contributing
31
34
 
@@ -51,14 +54,10 @@ AsciiDoctor で PDF を作るときに困っていたことをなんとかした
51
54
 
52
55
  ### 禁則処理の改善
53
56
 
54
- `asciidoctor/nabetani/prawn-linewrap-ja` を require すると有効になる。
55
-
56
57
  prawn の禁則処理を本ライブラリの処理で差し替えることで、禁則処理を改善する。
57
58
 
58
59
  ### クロスリファレンス
59
60
 
60
- `asciidoctor/nabetani/abstractblock-xreftext` を require すると有効になる。
61
-
62
61
  AsciiDoc のクロスリファレンスで
63
62
 
64
63
  従来は
@@ -90,8 +89,6 @@ AsciiDoc のクロスリファレンスで
90
89
 
91
90
  ### horizontal な定義リスト
92
91
 
93
- `asciidoctor/nabetani/horz-dlist` を require すると有効になる。
94
-
95
92
  horizontal な定義リストで
96
93
  ```
97
94
  [horizontal, margin-left=20, margin-bottom=10]
@@ -103,8 +100,6 @@ Baz Qux:: quux corge
103
100
 
104
101
  ### PDF のプロパティ
105
102
 
106
- `asciidoctor/nabetani/pdf-custom-property` を require すると有効になる。
107
-
108
103
  PDF のファイル情報の「概要」欄の項目を adoc ファイル内に
109
104
 
110
105
  ```
@@ -126,18 +121,9 @@ PDF のファイル情報の「概要」欄の項目を adoc ファイル内に
126
121
 
127
122
  ### PDF のしおり(outline)
128
123
 
129
- `asciidoctor/nabetani/pdf-outline` を require することで有効になる。
130
-
131
124
  テーマの yaml に
132
125
  ```
133
126
  bookmark:
134
127
  include-title-page: false
135
128
  ```
136
129
  と書くと、表紙はしおりにふくまれないようになる。
137
-
138
-
139
-
140
-
141
-
142
-
143
-
data/Rakefile CHANGED
@@ -4,31 +4,48 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  desc 'Create Sample PDF'
7
- task :pdf do
7
+ task :pdf_funcs do
8
8
  cmd = %W[
9
9
  asciidoctor-pdf
10
- -r asciidoctor-pdf-cjk-kai_gen_gothic
11
- -r asciidoctor/nabetani/prawn-linewrap-ja
12
- -r asciidoctor/nabetani/abstractblock-xreftext
13
- -r asciidoctor/nabetani/pdf-custom-property
14
- -r asciidoctor/nabetani/horz-dlist
15
- -r asciidoctor/nabetani/pdf-outline
16
- sample/src/index.adoc
17
- -o sample/book.pdf
10
+ -r asciidoctor/nabetani
11
+ sample/funcs/index.adoc
12
+ -o sample/funcs.pdf
13
+ ]
14
+ sh cmd.join(' ')
15
+ end
16
+
17
+ desc 'Create Small Page PDF'
18
+ task :pdf_small do
19
+ cmd = %W[
20
+ asciidoctor-pdf
21
+ -r asciidoctor/nabetani
22
+ sample/small/index.adoc
23
+ -o sample/small.pdf
18
24
  ]
19
25
  sh cmd.join(' ')
20
26
  end
21
27
 
22
28
  desc 'Create Sample PDF Without This Library'
23
- task :pdf_org do
29
+ task :pdf_funcs_org do
30
+ cmd = %W[
31
+ asciidoctor-pdf
32
+ -r asciidoctor-pdf-cjk-kai_gen_gothic
33
+ sample/funcs/index.adoc
34
+ -o sample/funcs_org.pdf
35
+ ]
36
+ sh cmd.join(' ')
37
+ end
38
+
39
+ desc 'Create Small Page PDF Without This Library'
40
+ task :pdf_small_org do
24
41
  cmd = %W[
25
42
  asciidoctor-pdf
26
43
  -r asciidoctor-pdf-cjk-kai_gen_gothic
27
- sample/src/index.adoc
28
- -o sample/book_org.pdf
44
+ sample/small/index.adoc
45
+ -o sample/small_org.pdf
29
46
  ]
30
47
  sh cmd.join(' ')
31
48
  end
32
49
 
33
50
  task default: :spec
34
- task pdfs: [:pdf, :pdf_org]
51
+ task pdf_all: %i[pdf_funcs pdf_funcs_org pdf_small pdf_small_org]
@@ -6,3 +6,11 @@ module Asciidoctor
6
6
  # Your code goes here...
7
7
  end
8
8
  end
9
+
10
+ require "asciidoctor-pdf"
11
+ require 'asciidoctor/pdf/cjk/kai_gen_gothic/theme_loader'
12
+ require 'asciidoctor/nabetani/prawn-linewrap-ja'
13
+ require 'asciidoctor/nabetani/abstractblock-xreftext'
14
+ require 'asciidoctor/nabetani/pdf-custom-property'
15
+ require 'asciidoctor/nabetani/horz-dlist'
16
+ require 'asciidoctor/nabetani/pdf-outline'
@@ -87,6 +87,9 @@ module Prawn
87
87
  end
88
88
 
89
89
  def tokenize(fragment)
90
+ if /ち/===fragment
91
+ x=0
92
+ end
90
93
  fragment.size.times.with_object(["".clone]) do |ix,s|
91
94
  cur = fragment[ix]
92
95
  if s.last.empty?
@@ -123,6 +126,12 @@ module Prawn
123
126
  end
124
127
  end
125
128
 
129
+ def update_line_status_based_on_last_output
130
+ if 1<tokenize(@fragment_output).size
131
+ @line_contains_more_than_one_word = true
132
+ end
133
+ end
134
+
126
135
  def remember_this_fragment_for_backward_looking_ops
127
136
  @previous_fragment = @fragment_output.dup
128
137
  pf = @previous_fragment
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Nabetani
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
File without changes
@@ -1,7 +1,7 @@
1
1
  :encoding: utf-8
2
2
  :lang: ja
3
3
  :doctype: book
4
- :pdf-style: sample/src/theme.yml
4
+ :pdf-style: sample/funcs/theme.yml
5
5
 
6
6
  :doctitle: asciidoctor-nabetani sample
7
7
 
File without changes
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ :encoding: utf-8
2
+ :lang: ja
3
+ :doctype: book
4
+ :pdf-style: sample/small/theme.yml
5
+
6
+ :sectnums:
7
+ :toc-title: 目次
8
+ :toc:
9
+
10
+ include::line-wrap.adoc[]
11
+
12
+
@@ -0,0 +1,21 @@
1
+ == 改行制御
2
+
3
+ === 所謂半角括弧
4
+
5
+   +
6
+   +
7
+   +
8
+   +
9
+   +
10
+   +
11
+   +
12
+
13
+ (aiiiiiiii)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p) +
14
+ (biiiiiiii)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p) +
15
+ (ciiiiiiii)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p) +
16
+
17
+ ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。 +
18
+ Wちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。 +
19
+ WWちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。 +
20
+ WWWちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。 +
21
+ WWWWちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。ちゃっ。 +
@@ -0,0 +1,74 @@
1
+ font:
2
+ catalog:
3
+ serif:
4
+ normal: KaiGenGothicJP-Regular.ttf
5
+ italic: KaiGenGothicJP-Regular-Italic.ttf
6
+ bold: KaiGenGothicJP-Bold.ttf
7
+ bold_italic: KaiGenGothicJP-Bold-Italic.ttf
8
+ sans-serif:
9
+ normal: KaiGenGothicJP-Regular.ttf
10
+ italic: KaiGenGothicJP-Regular-Italic.ttf
11
+ bold: KaiGenGothicJP-Bold.ttf
12
+ bold_italic: KaiGenGothicJP-Bold-Italic.ttf
13
+ monospace:
14
+ normal: KaiGenGothicJP-Regular.ttf
15
+ italic: KaiGenGothicJP-Regular-Italic.ttf
16
+ bold: KaiGenGothicJP-Bold.ttf
17
+ bold_italic: KaiGenGothicJP-Bold-Italic.ttf
18
+ fallbacks:
19
+ sans-serif
20
+
21
+ base:
22
+ align: left
23
+ font_color: 000000
24
+ font_family: sans-serif
25
+ font_size: 10
26
+ line_height_length: 15
27
+ line_height: $base_line_height_length / $base_font_size
28
+ font_size_large: round($base_font_size * 1.25)
29
+ font_size_small: round($base_font_size * 0.85)
30
+ font_size_min: $base_font_size * 0.75
31
+ font_style: normal
32
+ border_color: eeeeee
33
+ border_radius: 4
34
+ border_width: 0.5
35
+
36
+ page:
37
+ background_color: ffffff
38
+ layout: portrait
39
+ margin: [12mm, 6mm, 15mm, 6mm] # [top,right,bottom,left]
40
+ size: A7
41
+
42
+ title_page:
43
+ align: center
44
+ background_color: ffffff
45
+ title:
46
+ top: 20%
47
+ font_family: sans-serif
48
+ font_size: 40pt
49
+ font_style: bold
50
+ font_color: 000000
51
+ line_height: 2
52
+ subtitle:
53
+ font_size: 24pt
54
+ font_family: sans-serif
55
+ line_height: 1
56
+ margin_bottom: 9cm
57
+ authors:
58
+ font_size: 20pt
59
+ font_family: sans-serif
60
+ margin_top: $base_font_size * 1.25
61
+ revision:
62
+ font_size: 16pt
63
+ font_family: sans-serif
64
+ margin_top: $base_font_size * 1.25
65
+
66
+ literal:
67
+ font_family: monospace
68
+
69
+ code:
70
+ font_family: monospace
71
+
72
+ bookmark:
73
+ include-title-page: false
74
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-nabetani
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nabetani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-23 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -37,11 +37,14 @@ files:
37
37
  - lib/asciidoctor/nabetani/pdf-outline.rb
38
38
  - lib/asciidoctor/nabetani/prawn-linewrap-ja.rb
39
39
  - lib/asciidoctor/nabetani/version.rb
40
- - sample/src/horz-dlist.adoc
41
- - sample/src/index.adoc
42
- - sample/src/line-wrap.adoc
43
- - sample/src/theme.yml
44
- - sample/src/xref.adoc
40
+ - sample/funcs/horz-dlist.adoc
41
+ - sample/funcs/index.adoc
42
+ - sample/funcs/line-wrap.adoc
43
+ - sample/funcs/theme.yml
44
+ - sample/funcs/xref.adoc
45
+ - sample/small/index.adoc
46
+ - sample/small/line-wrap.adoc
47
+ - sample/small/theme.yml
45
48
  homepage: https://github.com/nabetani/asciidoctor-nabetani
46
49
  licenses:
47
50
  - MIT