asciidoctor-pdf 1.5.0.alpha.5 → 1.5.0.alpha.6

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: 3ddd0f5ebfe16661dfd20e0ef1718ea6aaa7f9fb
4
- data.tar.gz: 05a6512716b3f7f203c7ebb14e6774385eaca13a
3
+ metadata.gz: 5dc73c6c0fd12b13fd37b6a9001b0b085b3458f7
4
+ data.tar.gz: 03a98a738a9cf9703488a10380619b1f87812654
5
5
  SHA512:
6
- metadata.gz: 83698c58c5acf41e3c38e8d0c4657afe51d2aa99001d2bc278a2faefa42227534d66353aa80760d0e6ab669c30b879384599025bf97c72da730878cef0655cbc
7
- data.tar.gz: a30d39c1ae441ebe4a3e2042343b2a8bb75cbbac931a2e9d4622692283dc09d928195b9770b314b84e96cd92dc5f42c99ac870588e38c93d21ff7d494826c786
6
+ metadata.gz: 76147bac174cf98b029674ad882cb35dfb4df5ed9e69b33f1c3b5ab47993a77d9d7423e38d382ec4b6b834e6d3322ecccfb7b746f72a9031a424e6065bf857a2
7
+ data.tar.gz: 18e4f064a6af705f35ac64c03cf4b3c8850427314e97686ea834662d09507c55574613eb85eadb246cdb3f80bac4eb471b051b182991717a4dd970d181330e5d
@@ -228,6 +228,13 @@ The layout and styling of the PDF is driven by a YAML configuration file.
228
228
 
229
229
  See the files [file]_default-theme.yml_ and [file]_asciidoctor-theme.yml_ found in the [file]_data/themes_ directory for examples.
230
230
 
231
+ Specify the path to an alternate theme file with the `pdf-style` attribute. For example to use the built-in _asciidoctor_ theme:
232
+
233
+ $ ./bin/asciidoctor-pdf -a pdf-style=asciidoctor examples/example.adoc
234
+
235
+ To refer to a theme at another location you can use the `pdf-stylesdir` attribute to specify the location of themes.
236
+ If the `pdf-style` value does not end in `.yml`, then the file name is calculated as `{pdf-style}-theme.yml` located in the `pdf-stylesdir` directory (which defaults to the built-in `data/themes` directory).
237
+
231
238
  == Optional Scripts
232
239
 
233
240
  {project-name} also provides a shell script that invokes GhostScript (+gs+) to optimize and compress the generated PDF with minimal impact on quality.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require File.join File.dirname(__FILE__), '../lib/asciidoctor-pdf'
3
+ require_relative '../lib/asciidoctor-pdf'
4
4
  require 'asciidoctor/cli'
5
5
 
6
6
  options = Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true
@@ -24,7 +24,8 @@ if [ -f "$FILE_BASENAME.pdfmarks" ]; then
24
24
  fi
25
25
  DOWNSAMPLE_IMAGES=true
26
26
  if [ -z $IMAGE_DPI ]; then
27
- IMAGE_DPI=150
27
+ #IMAGE_DPI=150
28
+ IMAGE_DPI=300
28
29
  fi
29
30
 
30
31
  # /prepress defaults (see http://ghostscript.com/doc/current/Ps2pdf.htm)
@@ -37,7 +37,7 @@ Behold, the horror!
37
37
 
38
38
  .Wolpertinger, stuffed
39
39
  [.left.thumb]
40
- image::wolpertinger.jpg[Wolpertinger,width=100%,scaledwidth=55%]
40
+ image::wolpertinger.jpg[Wolpertinger,width=100%,scaledwidth=55%,link=http://en.wikipedia.org/wiki/Wolpertinger]
41
41
 
42
42
  You may not be familiar with these {wolper-uri}[ravenous beasts].
43
43
  Trust us, they'll eat your shorts and suck loops from your code.
@@ -150,7 +150,7 @@ class Converter < ::Prawn::Document
150
150
  pdf_opts = (build_pdf_options doc, theme)
151
151
  ::Prawn::Document.instance_method(:initialize).bind(self).call pdf_opts
152
152
  # QUESTION should ThemeLoader register fonts?
153
- register_fonts theme.font_catalog, (doc.attr 'scripts', 'latin')
153
+ register_fonts theme.font_catalog, (doc.attr 'scripts', 'latin'), (doc.attr 'pdf-fontsdir', ThemeLoader::FontsDir)
154
154
  @theme = theme
155
155
  @font_color = theme.base_font_color
156
156
  init_scratch_prototype
@@ -1238,9 +1238,9 @@ class Converter < ::Prawn::Document
1238
1238
  @pdfmarks.generate_file target if @pdfmarks
1239
1239
  end
1240
1240
 
1241
- def register_fonts font_catalog, scripts = 'latin'
1241
+ def register_fonts font_catalog, scripts = 'latin', fonts_dir
1242
1242
  (font_catalog || {}).each do |key, font_styles|
1243
- register_font key => font_styles.map {|style, path| [style.to_sym, (font_path path)]}.to_h
1243
+ register_font key => font_styles.map {|style, path| [style.to_sym, (font_path path, fonts_dir)]}.to_h
1244
1244
  end
1245
1245
 
1246
1246
  @fallback_fonts ||= []
@@ -1248,10 +1248,9 @@ class Converter < ::Prawn::Document
1248
1248
  default_kerning true
1249
1249
  end
1250
1250
 
1251
- # FIXME move to static method on ThemeLoader
1252
- def font_path font_file
1251
+ def font_path font_file, fonts_dir
1253
1252
  # resolve relative to built-in font dir unless path is absolute
1254
- ::File.absolute_path font_file, ThemeLoader::FontsDir
1253
+ ::File.absolute_path font_file, fonts_dir
1255
1254
  end
1256
1255
 
1257
1256
  def theme_fill_and_stroke_bounds category
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Pdf
3
- VERSION = '1.5.0.alpha.5'
3
+ VERSION = '1.5.0.alpha.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.alpha.5
4
+ version: 1.5.0.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-15 00:00:00.000000000 Z
12
+ date: 2014-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -95,6 +95,20 @@ dependencies:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
97
  version: 0.16.0
98
+ - !ruby/object:Gem::Dependency
99
+ name: thread_safe
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '='
103
+ - !ruby/object:Gem::Version
104
+ version: 0.3.4
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '='
110
+ - !ruby/object:Gem::Version
111
+ version: 0.3.4
98
112
  - !ruby/object:Gem::Dependency
99
113
  name: treetop
100
114
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
208
  version: 1.3.1
195
209
  requirements: []
196
210
  rubyforge_project:
197
- rubygems_version: 2.2.2
211
+ rubygems_version: 2.4.2
198
212
  signing_key:
199
213
  specification_version: 4
200
214
  summary: Converts AsciiDoc documents to PDF using Prawn