hyla 1.0.8 → 1.0.9.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDE0NzRhOTMxNTc4MWMxYTMyYTAzNTJmNWY3MWJmOTYxNWNhOTE5Yg==
4
+ MDdlM2ZjMThjYzg4MGMzYTE0ZjJlNzg3OWY2YjBlZWNkNGQ5NDFhMA==
5
5
  data.tar.gz: !binary |-
6
- NjcxMDlmNTQzMzY1ZTQ5NTM1N2M5ODVmMjc1NjdjMTM2NGE5NjYyYg==
6
+ MjMwMWZmMGY0ZjYwYjQwNjVjZWFkNDBiYWQwMTUwYzYwZDU3MmJkZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDI2ZTQxZjAzYTIzMTFhNzM2MjFiNDM0YjRjNTlkMTA2Y2I5NzI4NDVmNGMz
10
- YWY3OTk2YzFmYjkyNGI0MmNmMDRjZGI1MDBkZWM3YjNmZTBlOGVjNGNhNmRm
11
- ZThhOTk1ZmZhNzU2MjExZDc1OTQxZmUwMmZhYTFiNjY4NTgwOWQ=
9
+ ZWFhY2MzNTRiNTU4YmZiNzRhN2UwOWRkMzEzNGFjYmQzYmIwMjg1ZDM1N2Fl
10
+ ZjUzMGNlYjk4MDRjMmVmZDkxN2YzNzg0ZTNmMjFmODg2YmIxZThlNGY0NjY1
11
+ NDUxZGNlMzJlMjY4YzUxNWZiNjczZDhmYThlMTc2N2EzNGQ5YjE=
12
12
  data.tar.gz: !binary |-
13
- OWE5OWZkNGViMDJjOGY0ZjQ5ZGNlOWY5MGM3NjA3OGQyMWVhYzU0NmY3NzI1
14
- MmUxOGJlMjY4YWU2NGQxYjM5YjIxNmNmZDczMDFlOWRlMDkwMGQwOWM0NTdh
15
- NmI1MzdkODY0NDNkMjQ5YzQ1MjVlMjE5MDUwYzE2OGM1NWVhZWQ=
13
+ ZDhhNDA2OGZmM2Y0ZDE2NWQxYmIwY2IzYTk5ZTZhNjI2MTBkZGJhZjY4YTg5
14
+ NmI4MTgzOTEwMWM4NGQ2MWQzZmRlODQ0MWE0OGRjMGU0MDkwNzE0ZTQ3Zjcy
15
+ ZmU1MTNjZGM4NWNhNzk5MTcxNzZkMmNlZmM4YzFkZDExZDliOTk=
@@ -82,9 +82,11 @@ module Hyla
82
82
  end
83
83
 
84
84
  def self.safe_load_file(filename)
85
- f = File.expand_path(filename, $cmd_directory)
86
- YAML.safe_load_file(f)
87
- rescue SystemCallError
88
- puts "No configuration file retrieved for the name : #{filename}"
85
+ begin
86
+ f = File.expand_path(filename, $cmd_directory)
87
+ YAML.safe_load_file(f)
88
+ rescue SystemCallError
89
+ puts "No configuration file retrieved for the name : #{filename}"
90
+ end
89
91
  end
90
92
  end
@@ -31,15 +31,25 @@ module Hyla
31
31
 
32
32
  @destination = options[:destination]
33
33
  @source = options[:source]
34
-
34
+
35
+ # Find and append to the value of the copyright header with the BUILD TAG EN Var if it exists
36
+ attributes = options[:attributes] if options[:attributes]
37
+ attributes.each do | k, v |
38
+ if ((k.eql? "revealjs_footer_copyright") && (ENV['BUILD_TAG']))
39
+ attributes[k] = attributes[k] + " - " + ENV['BUILD_TAG']
40
+ end
41
+ end
42
+
35
43
  # Check Style to be used
44
+ attributes.store('stylesheet',self.check_style(options[:style]))
45
+
46
+
47
+ # New options
36
48
  new_asciidoctor_option = {
37
49
  :template_dirs => [self.backend_dir(options[:backend])],
38
- :attributes => {
39
- 'stylesheet' => self.check_style(options[:style])
40
- }
50
+ :attributes => attributes
41
51
  }
42
-
52
+
43
53
  merged_options = Configuration[options].deep_merge(new_asciidoctor_option)
44
54
 
45
55
  extensions = 'adoc,ad,asciidoc'
@@ -55,11 +65,22 @@ module Hyla
55
65
  @destination = options[:destination]
56
66
  @source = options[:source]
57
67
 
68
+ # Find and append to the value of the copyright header with the BUILD TAG EN Var if it exists
69
+ attributes = options[:attributes] if options[:attributes]
70
+ attributes.each do | k, v |
71
+ if ((k.eql? "revealjs_footer_copyright") && (ENV['BUILD_TAG']))
72
+ attributes[k] = attributes[k] + " - " + ENV['BUILD_TAG']
73
+ end
74
+ end
75
+
76
+ # Check Style to be used
77
+ attributes.store('stylesheet',self.check_style(options[:style]))
78
+
79
+
80
+ # New options
58
81
  new_asciidoctor_option = {
59
82
  :template_dirs => [self.backend_dir(options[:backend])],
60
- :attributes => {
61
- 'stylesheet' => self.check_style(options[:style])
62
- }
83
+ :attributes => attributes
63
84
  }
64
85
 
65
86
  merged_options = Configuration[options].deep_merge(new_asciidoctor_option)
@@ -196,7 +196,7 @@ module Hyla
196
196
  safe_load_file(f)
197
197
  rescue SystemCallError
198
198
  Hyla::logger2.error "No configuration file retrieved for : #{filename}"
199
- exit
199
+ nil
200
200
  end
201
201
 
202
202
  #
@@ -1,5 +1,5 @@
1
1
  module Hyla
2
- VERSION = '1.0.8'
2
+ VERSION = '1.0.9.pre.1'
3
3
  DESCRIPTION = 'Asciidoctor Hyla - Command Line tool to create new project, watch modifications, generate content, publish or consult it live !'
4
4
  SUMMARY = 'Asciidoctor Hyla - builder/generator of HTML5, slideshow. Watch modifications, generate content, publish or consult it live !'
5
5
  end
@@ -0,0 +1,47 @@
1
+ /**
2
+ * phantomjs script for printing presentations to PDF.
3
+ *
4
+ * Example:
5
+ * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf
6
+ *
7
+ * By Manuel Bieh (https://github.com/manuelbieh)
8
+ */
9
+
10
+ // html2pdf.js
11
+ var page = new WebPage();
12
+ var system = require( 'system' );
13
+
14
+ var slideWidth = system.args[3] ? system.args[3].split( 'x' )[0] : 960;
15
+ var slideHeight = system.args[3] ? system.args[3].split( 'x' )[1] : 700;
16
+
17
+ page.viewportSize = {
18
+ width: slideWidth,
19
+ height: slideHeight
20
+ };
21
+
22
+ // TODO
23
+ // Something is wrong with these config values. An input
24
+ // paper width of 1920px actually results in a 756px wide
25
+ // PDF.
26
+ page.paperSize = {
27
+ width: Math.round( slideWidth * 2 ),
28
+ height: Math.round( slideHeight * 2 ),
29
+ border: 0
30
+ };
31
+
32
+ var inputFile = system.args[1] || 'index.html?print-pdf';
33
+ var outputFile = system.args[2] || 'slides.pdf';
34
+
35
+ if( outputFile.match( /\.pdf$/gi ) === null ) {
36
+ outputFile += '.pdf';
37
+ }
38
+
39
+ console.log( 'Printing PDF (Paper size: '+ page.paperSize.width + 'x' + page.paperSize.height +')' );
40
+
41
+ page.open( inputFile, function( status ) {
42
+ window.setTimeout( function() {
43
+ console.log( 'Printed succesfully' );
44
+ page.render( outputFile );
45
+ phantom.exit();
46
+ }, 1000 );
47
+ } );
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyla
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Moulliard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -707,6 +707,7 @@ files:
707
707
  - lib/resources/assets/revealjs-redhat/lib/plugin/markdown/marked.js
708
708
  - lib/resources/assets/revealjs-redhat/lib/plugin/notes/notes.html
709
709
  - lib/resources/assets/revealjs-redhat/lib/plugin/notes/notes.js
710
+ - lib/resources/assets/revealjs-redhat/lib/plugin/print/print-pdf.js
710
711
  - lib/resources/assets/revealjs-redhat/lib/plugin/zoom-js/zoom.js
711
712
  - lib/resources/assets/revealjs/LICENSE
712
713
  - lib/resources/assets/revealjs/css/print/paper.css
@@ -1268,9 +1269,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1268
1269
  version: '0'
1269
1270
  required_rubygems_version: !ruby/object:Gem::Requirement
1270
1271
  requirements:
1271
- - - ! '>='
1272
+ - - ! '>'
1272
1273
  - !ruby/object:Gem::Version
1273
- version: '0'
1274
+ version: 1.3.1
1274
1275
  requirements: []
1275
1276
  rubyforge_project:
1276
1277
  rubygems_version: 2.3.0