asciidoctor-epub3 1.0.0.alpha.2 → 1.0.0.alpha.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
  SHA1:
3
- metadata.gz: 27a405770a51e0bc06e16b4a484203d25cfeb704
4
- data.tar.gz: 63fdd03371885ea40a82575db6e241ec64c75d00
3
+ metadata.gz: 42287b2fbdd7ae40dd5bf304f7f0de9c93b129d1
4
+ data.tar.gz: 652d4d643f63278e41c72bb65f1eb09b104570a2
5
5
  SHA512:
6
- metadata.gz: 1db122ccbf5baccd60a59e1e482b98132ed5fb3b0097c2d00311e460da24d44a6ab8be76a7202ae49a4c8f112535ba4d9b32d8b7b41f382b492f297ef00a34e9
7
- data.tar.gz: 0f960257b627d5b7441045585ab267e60ab3292126a0cd7fd4929f2402c5d08bc3ffa1dee46d16ca76b86f21e5154487ba0e5f817d707a83a5e3eca57ae3ef55
6
+ metadata.gz: 1bbcf4a13d6e720b2ce38fce363d872bf14b8a26f988de0b05bf6395757f35d6d15433a7d535362700b723ec0b239ecbbe6db8350a1131bb2826c8f852295303
7
+ data.tar.gz: e2e539fd7951d0dae04cbb4c9458d85dbfe644072c05492a3999d7d27d178a860e2540da83d00bfdcde3a72de97a2f3ae2e2f2d97f8ab34c347a57d029936e5d
@@ -6,7 +6,7 @@ module Asciidoctor
6
6
  module Epub3
7
7
  # tried 8288, but it didn't work in older readers
8
8
  WordJoiner = [65279].pack 'U*'
9
- WordJoinerRx = RUBY_ENGINE_JRUBY ? /uFEFF/ : WordJoiner
9
+ WordJoinerRx = RUBY_ENGINE_JRUBY ? /\uFEFF/ : WordJoiner
10
10
 
11
11
  # Public: The main converter for the epub3 backend that handles packaging the
12
12
  # EPUB3 or KF8 publication file.
@@ -34,24 +34,34 @@ module GepubBuilderMixin
34
34
  builder = self
35
35
  format = @format
36
36
  workdir = if doc.attr? 'epub3-stylesdir'
37
- ::File.join doc.attr('docdir'), doc.attr('epub3-stylesdir')
37
+ stylesdir = doc.attr 'epub3-stylesdir'
38
+ # FIXME make this work for Windows paths!!
39
+ if stylesdir.start_with? '/'
40
+ stylesdir
41
+ else
42
+ docdir = doc.attr 'docdir', '.'
43
+ docdir = '.' if docdir.empty?
44
+ ::File.join docdir, stylesdir
45
+ end
38
46
  else
39
47
  ::File.join DATA_DIR, 'styles'
40
48
  end
41
49
 
42
50
  # TODO improve design/UX of custom theme functionality, including custom fonts
43
- resources workdir: workdir do
44
- file 'styles/epub3.css' => (builder.postprocess_css_file 'epub3.css', format)
45
- file 'styles/epub3-css3-only.css' => (builder.postprocess_css_file 'epub3-css3-only.css', format)
51
+ resources do
52
+ file 'styles/epub3.css' => (builder.postprocess_css_file ::File.join(workdir, 'epub3.css'), format)
53
+ file 'styles/epub3-css3-only.css' => (builder.postprocess_css_file ::File.join(workdir, 'epub3-css3-only.css'), format)
46
54
  end
47
55
 
48
- resources workdir: DATA_DIR do
56
+ resources do
49
57
  #file 'styles/epub3.css' => (builder.postprocess_css_file 'styles/epub3.css', format)
50
58
  #file 'styles/epub3-css3-only.css' => (builder.postprocess_css_file 'styles/epub3-css3-only.css', format)
51
- font_list, font_css = builder.select_fonts 'styles/epub3-fonts.css', (doc.attr 'scripts', 'latin')
59
+ font_files, font_css = builder.select_fonts ::File.join(DATA_DIR, 'styles/epub3-fonts.css'), (doc.attr 'scripts', 'latin')
52
60
  file 'styles/epub3-fonts.css' => font_css
53
61
  with_media_type 'application/x-font-ttf' do
54
- files(*font_list)
62
+ font_files.each do |font_file|
63
+ file font_file => ::File.join(DATA_DIR, font_file)
64
+ end
55
65
  end
56
66
  end
57
67
  end
@@ -64,14 +74,15 @@ module GepubBuilderMixin
64
74
  if front_cover_image =~ InlineImageMacroRx
65
75
  front_cover_image = %(#{imagesdir}#{$1})
66
76
  end
67
- workdir = doc.attr 'docdir'
77
+ workdir = doc.attr 'docdir', '.'
78
+ workdir = '.' if workdir.empty?
68
79
  else
69
80
  front_cover_image = DefaultCoverImage
70
81
  workdir = DATA_DIR
71
82
  end
72
83
 
73
- resources workdir: workdir do
74
- cover_image %(#{imagesdir}jacket/cover#{::File.extname front_cover_image}) => front_cover_image
84
+ resources do
85
+ cover_image %(#{imagesdir}jacket/cover#{::File.extname front_cover_image}) => ::File.join(workdir, front_cover_image)
75
86
  end
76
87
  end
77
88
 
@@ -151,7 +162,9 @@ body > svg {
151
162
  docimagesdir = (doc.attr 'imagesdir', '.').chomp '/'
152
163
  docimagesdir = (docimagesdir == '.' ? nil : %(#{docimagesdir}/))
153
164
 
154
- resources(workdir: (doc.attr 'docdir')) do
165
+ workdir = doc.attr 'docdir', '.'
166
+ workdir = '.' if workdir.empty?
167
+ resources workdir: workdir do
155
168
  images.each do |image|
156
169
  imagesdir = (image.document.attr 'imagesdir', '.').chomp '/'
157
170
  imagesdir = (imagesdir == '.' ? nil : %(#{imagesdir}/))
@@ -172,29 +185,29 @@ body > svg {
172
185
  imagesdir = (doc.attr 'imagesdir', '.').chomp '/'
173
186
  imagesdir = (imagesdir == '.' ? nil : %(#{imagesdir}/))
174
187
 
175
- resources workdir: DATA_DIR do
176
- file %(#{imagesdir}avatars/default.jpg) => %(images/default-avatar.jpg)
177
- file %(#{imagesdir}headshots/default.jpg) => %(images/default-headshot.jpg)
188
+ resources do
189
+ file %(#{imagesdir}avatars/default.jpg) => ::File.join(DATA_DIR, 'images/default-avatar.jpg')
190
+ file %(#{imagesdir}headshots/default.jpg) => ::File.join(DATA_DIR, 'images/default-headshot.jpg')
178
191
  end
179
192
 
180
- resources(workdir: (doc.attr 'docdir')) do
193
+ workdir = doc.attr 'docdir', '.'
194
+ workdir = '.' if workdir.empty?
195
+ resources do
181
196
  usernames.each do |username|
182
- if ::File.readable?(avatar = %(#{imagesdir}avatars/#{username}.jpg))
183
- file avatar
197
+ avatar = %(#{imagesdir}avatars/#{username}.jpg)
198
+ if ::File.readable?(resolved_avatar = ::File.join(workdir, avatar))
199
+ file avatar => resolved_avatar
184
200
  else
185
201
  warn %(Avatar #{avatar} not found or readable. Falling back to default avatar for #{username}.)
186
- ::Dir.chdir DATA_DIR do
187
- file avatar => %(images/default-avatar.jpg)
188
- end
202
+ file avatar => ::File.join(DATA_DIR, 'images/default-avatar.jpg')
189
203
  end
190
204
 
191
- if ::File.readable? (headshot = %(#{imagesdir}headshots/#{username}.jpg))
192
- file headshot
193
- else
205
+ headshot = %(#{imagesdir}headshots/#{username}.jpg)
206
+ if ::File.readable?(resolved_headshot = ::File.join(workdir, headshot))
207
+ file headshot => resolved_headshot
208
+ elsif doc.attr? 'builder', 'editions'
194
209
  warn %(Headshot #{headshot} not found or readable. Falling back to default headshot for #{username}.)
195
- ::Dir.chdir DATA_DIR do
196
- file headshot => %(images/default-headshot.jpg)
197
- end
210
+ file headshot => ::File.join(DATA_DIR, 'images/default-headshot.jpg')
198
211
  end
199
212
  end
200
213
  =begin
@@ -222,7 +235,9 @@ body > svg {
222
235
  builder = self
223
236
  spine = @spine
224
237
  format = @format
225
- resources(workdir: (doc.attr 'docdir')) do
238
+ workdir = doc.attr 'docdir', '.'
239
+ workdir = '.' if workdir.empty?
240
+ resources workdir: workdir do
226
241
  builder.add_images_from_front_matter
227
242
  # QUESTION should we move navigation_document to the Packager class? seems to make sense
228
243
  #nav 'nav.xhtml' => (builder.postprocess_xhtml doc.converter.navigation_document(doc, spine), format)
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Epub3
3
- VERSION = '1.0.0.alpha.2'
3
+ VERSION = '1.0.0.alpha.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,76 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-epub3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.2
4
+ version: 1.0.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
8
8
  - Sarah White
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-15 00:00:00.000000000 Z
12
+ date: 2014-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - "~>"
17
+ - - ~>
19
18
  - !ruby/object:Gem::Version
20
19
  version: '10.0'
21
- type: :development
20
+ name: rake
22
21
  prerelease: false
22
+ type: :development
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '10.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: asciidoctor
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
- - - ">="
31
+ - - '>='
33
32
  - !ruby/object:Gem::Version
34
33
  version: 1.5.0
35
- - - "<"
34
+ - - <
36
35
  - !ruby/object:Gem::Version
37
36
  version: 1.6.0
38
- type: :runtime
37
+ name: asciidoctor
39
38
  prerelease: false
39
+ type: :runtime
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: 1.5.0
45
- - - "<"
45
+ - - <
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.6.0
48
48
  - !ruby/object:Gem::Dependency
49
- name: gepub
50
49
  requirement: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - "~>"
51
+ - - ~>
53
52
  - !ruby/object:Gem::Version
54
53
  version: 0.6.9.2
55
- type: :runtime
54
+ name: gepub
56
55
  prerelease: false
56
+ type: :runtime
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.6.9.2
62
62
  - !ruby/object:Gem::Dependency
63
- name: thread_safe
64
63
  requirement: !ruby/object:Gem::Requirement
65
64
  requirements:
66
- - - "~>"
65
+ - - ~>
67
66
  - !ruby/object:Gem::Version
68
67
  version: 0.3.4
69
- type: :runtime
68
+ name: thread_safe
70
69
  prerelease: false
70
+ type: :runtime
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.3.4
76
76
  description: |
@@ -138,9 +138,9 @@ files:
138
138
  - data/samples/asciidoctor-js-introduction.adoc
139
139
  - data/samples/i18n.adoc
140
140
  - data/samples/images/asciidoctor-js-chrome-extension.png
141
- - data/samples/images/avatars/graphitefriction.png
142
- - data/samples/images/avatars/mogztter.png
143
- - data/samples/images/avatars/mojavelinux.png
141
+ - data/samples/images/avatars/graphitefriction.jpg
142
+ - data/samples/images/avatars/mogztter.jpg
143
+ - data/samples/images/avatars/mojavelinux.jpg
144
144
  - data/samples/images/correct-text-justification.png
145
145
  - data/samples/images/incorrect-text-justification.png
146
146
  - data/samples/images/screenshots/chapter-title-day.png
@@ -168,25 +168,25 @@ homepage: https://github.com/asciidoctor/asciidoctor-epub3
168
168
  licenses:
169
169
  - MIT
170
170
  metadata: {}
171
- post_install_message:
171
+ post_install_message:
172
172
  rdoc_options:
173
173
  - --charset=UTF-8 --title="Asciidoctor EPUB3" --main=README.adoc -ri
174
174
  require_paths:
175
175
  - lib
176
176
  required_ruby_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '1.9'
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - ">"
183
+ - - '>'
184
184
  - !ruby/object:Gem::Version
185
185
  version: 1.3.1
186
186
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.2.2
189
- signing_key:
187
+ rubyforge_project:
188
+ rubygems_version: 2.1.9
189
+ signing_key:
190
190
  specification_version: 4
191
191
  summary: Converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book formats
192
192
  test_files: []