html2slideshow 2.0

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.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/bin/html2slideshow +27 -0
  3. data/doc/changes.txt +162 -0
  4. data/doc/license.txt +674 -0
  5. data/lib/LANG +1 -0
  6. data/lib/about.rb +57 -0
  7. data/lib/argparser.rb +143 -0
  8. data/lib/completable.rb +157 -0
  9. data/lib/configurator.rb +155 -0
  10. data/lib/copyright.txt +22 -0
  11. data/lib/extstring.rb +75 -0
  12. data/lib/file_checking.rb +153 -0
  13. data/lib/html2slideshow.cfg +22 -0
  14. data/lib/html2slideshow.rb +132 -0
  15. data/lib/htmlbuilder.rb +267 -0
  16. data/lib/icons/failure.png +0 -0
  17. data/lib/icons/howto.png +0 -0
  18. data/lib/icons/logo.png +0 -0
  19. data/lib/icons/message.png +0 -0
  20. data/lib/icons/options.png +0 -0
  21. data/lib/icons/question.png +0 -0
  22. data/lib/icons/success.png +0 -0
  23. data/lib/image.rb +62 -0
  24. data/lib/list_fields.rb +34 -0
  25. data/lib/log.conf +60 -0
  26. data/lib/logging.rb +194 -0
  27. data/lib/slideshow_css.rb +248 -0
  28. data/lib/slideshow_images/downCursor.png +0 -0
  29. data/lib/slideshow_images/leftArrow.png +0 -0
  30. data/lib/slideshow_images/olive.png +0 -0
  31. data/lib/slideshow_images/pause.png +0 -0
  32. data/lib/slideshow_images/rightArrow.png +0 -0
  33. data/lib/slideshow_images/sizeMedium.png +0 -0
  34. data/lib/slideshow_images/sizeNormal.png +0 -0
  35. data/lib/slideshow_images/sizeSmall.png +0 -0
  36. data/lib/slideshow_images/start.png +0 -0
  37. data/lib/slideshow_images/stop.png +0 -0
  38. data/lib/slideshow_images/toggle.png +0 -0
  39. data/lib/slideshow_images/upCursor.png +0 -0
  40. data/lib/slideshow_js.rb +390 -0
  41. data/lib/slideshow_template.rb +194 -0
  42. data/lib/sourcefile.rb +191 -0
  43. data/lib/translating.rb +90 -0
  44. data/lib/translations +354 -0
  45. metadata +86 -0
data/lib/log.conf ADDED
@@ -0,0 +1,60 @@
1
+ #encoding: UTF-8
2
+ =begin
3
+ /***************************************************************************
4
+ * ©2013 Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * *
6
+ * This program is free software; you can redistribute it and/or modify *
7
+ * it under the terms of the GNU General Public License as published by *
8
+ * the Free Software Foundation; either version 3 of the License, or *
9
+ * (at your option) any later version. *
10
+ * *
11
+ * This program is distributed in the hope that it will be useful, *
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
+ * GNU General Public License for more details. *
15
+ * *
16
+ * You should have received a copy of the GNU General Public License *
17
+ * along with this program; if not, write to the *
18
+ * Free Software Foundation, Inc., *
19
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
+ ***************************************************************************/
21
+
22
+ A simplified logger configuration. Set the level for each individual logger
23
+ below. Choose a different log-device or log-file if you like. Keep the
24
+ formatting intact. Do not change other sections of this file.
25
+ =end
26
+
27
+ # Do not touch from here ----->
28
+ require 'logger'
29
+
30
+ debug = Logger::DEBUG
31
+ info = Logger::INFO
32
+ error = Logger::ERROR
33
+ fatal = Logger::FATAL
34
+ warn = Logger::WARN
35
+ unknown = Logger::UNKNOWN
36
+ {
37
+ # <---------------- to here !
38
+
39
+ # Enter your settings here, but take into consideration that not all
40
+ # the named classes will really produce readable output. Well, you can
41
+ # always try... Either name just the log-level or make the log-level
42
+ # precede the output-device or output-file like in the examples.
43
+
44
+ # Example: naming a log-file
45
+ # :HtmlBuilder => [info, 'C:\temp\htmlbuilder.log']
46
+ # :HtmlBuilder => [debug, '/tmp/htmlbuilder.log'],
47
+
48
+ :Image => info,
49
+ :HtmlBuilder => info,
50
+ :OptionsTab => info,
51
+ :SourceFile => info,
52
+ :SlideShowGenerator => info,
53
+ :Configurator => info,
54
+ :GeneratorWindow => info,
55
+ :ArgParser => info,
56
+
57
+ # And ignore the remainder, too.
58
+ }
59
+
60
+ #eof
data/lib/logging.rb ADDED
@@ -0,0 +1,194 @@
1
+ #encoding: UTF-8
2
+ =begin
3
+ /***************************************************************************
4
+ * ©2011-2016 Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * *
6
+ * This program is free software; you can redistribute it and/or modify *
7
+ * it under the terms of the GNU General Public License as published by *
8
+ * the Free Software Foundation; either version 3 of the License, or *
9
+ * (at your option) any later version. *
10
+ * *
11
+ * This program is distributed in the hope that it will be useful, *
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
+ * GNU General Public License for more details. *
15
+ * *
16
+ * You should have received a copy of the GNU General Public License *
17
+ * along with this program; if not, write to the *
18
+ * Free Software Foundation, Inc., *
19
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
+ ***************************************************************************/
21
+ =end
22
+ require 'logger'
23
+ require_relative 'file_checking'
24
+
25
+ =begin Creates a member @log and precede its output with the name of the class
26
+ of the object.
27
+ Example for a class-level logger:
28
+ # --------------------
29
+ class TClass
30
+ self.extend(Logging)
31
+ @@log = init_logger(STDOUT)
32
+ def test_log
33
+ @@log.info('class-level logger called from instance: ' << @@log.to_s)
34
+ @log = @@log
35
+ @log.info('AGAIN: class-level logger called from instance: ' << @log.to_s)
36
+ end
37
+ def self::test_log
38
+ @log.info('class-level logger called from class: ' << @log.to_s)
39
+ @@log.info('AGAIN: class-level logger called from class: ' << @@log.to_s)
40
+ end
41
+ end
42
+ #---------------------
43
+ Example for a object-level logger:
44
+ ATTN! This means 1 logger per object.
45
+ # --------------------
46
+ class TClass
47
+ include Logging
48
+ def initialize
49
+ init_logger(STDOUT, Logger::DEBUG)
50
+ end
51
+ def test_log
52
+ @log.debug('called test_log() ')
53
+ end
54
+ end
55
+ =end
56
+
57
+ module Logging
58
+ include File_Checking
59
+
60
+ @@have_log = false
61
+ @@LOG_CONF = File.dirname(File.absolute_path(__FILE__)) << File::Separator << 'log.conf'
62
+
63
+ # Call this method in an instance-method (e.g. initialize() ) to define the
64
+ # object-level logger; i.e. an object-specific member @log.
65
+ # Call this method within the class-definition for a class-level logger; i.e.
66
+ # a member @log for class-level acces.
67
+ # The method returns the logger, so you can actually do what you want with it.
68
+ def init_logger(target = STDOUT, level = Logger::INFO)
69
+ # Prepare for a class-level logger. This is actually quite cool.
70
+
71
+ # ---> Ingeniuous code starts here
72
+ cn = (self.class == Class ? name : self.class.name)
73
+ # <--- Ingeniuous code ends here
74
+
75
+ # allow to override the set log-levels with an
76
+ # external configuration (log.conf).
77
+ log_conf(cn)
78
+ # Or use the defaults as set here or elsewhere...
79
+
80
+ @level ||= level
81
+ @target ||= target
82
+
83
+ @log = Logger.new(@target)
84
+ @log.level = @level
85
+
86
+ @log.formatter = proc do |severity, datetime, progname, msg|
87
+ t = Time.now
88
+ "#{cn}: #{severity} #{t.hour}-#{t.min}-#{t.sec}: #{msg}\n"
89
+ end
90
+ if ! @@have_log
91
+ @log.debug cn.dup << ' reading logging-configuration from ' << @@LOG_CONF
92
+ @@have_log = true
93
+ # @log.debug('level is ' << level.to_s)
94
+ end
95
+ return @log
96
+ end
97
+
98
+ # Set the log-target to an IO object.
99
+ def log_target=(target)
100
+ @target = target
101
+ @log = Logger.new(@@target)
102
+ @log.level = @level
103
+ end
104
+
105
+ # set the log-level
106
+ def log_level=(level)
107
+ @level = level
108
+ @log.level = @level
109
+ end
110
+
111
+ private
112
+
113
+ # Override or set the log-level and target-device, as set in a file 'log.conf'.
114
+ # I do not like the look of this, but it works just the way I want it to.
115
+ # "HEAVANS! Isn't there a standard way to do this in Ruby, for Christ's sake?", you say.
116
+ # Heck, I don't care. <= Read that again, I say.
117
+ def log_conf(cn = nil)
118
+ config = level = target = nil
119
+ # puts 'log-config is in ' << @@LOG_CONF
120
+ if(File::exist?(@@LOG_CONF) )
121
+ begin
122
+ conf = File.read(@@LOG_CONF)
123
+ config = instance_eval(conf)
124
+ rescue Exception => ex
125
+ STDERR.puts "WARNING! Cannot evaluate the logger-configuration!" << ' ' << ex.message
126
+ STDERR.puts "Default log-levels apply."
127
+ end
128
+ else
129
+ puts "Default log-levels apply."
130
+ end
131
+
132
+ if(config && config.respond_to?(:to_hash) )
133
+ config.default = nil
134
+ if cn
135
+ config = config[cn.to_sym]
136
+ else
137
+ config = config[self.class.name.to_sym]
138
+ end
139
+
140
+ if(config )
141
+ if(config.respond_to?(:to_ary) && config.size == 2)
142
+ @level, @target = config
143
+ @target.downcase!
144
+ logdir = File.dirname(@target)
145
+ msg = file_check(logdir, :exist?, :directory?, :writable?)
146
+ if(msg)
147
+ STDERR.puts "WARNING! A logfile for '%s' cannot be written to %s (%s)!" %[self.class.name, logdir, msg]
148
+ @target = nil
149
+ end
150
+ else
151
+ @level = config
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
157
+
158
+ ######### test
159
+ if __FILE__ == $0
160
+ class TClass
161
+ # class level ---->
162
+ self.extend(Logging)
163
+ @@log = init_logger(STDOUT, Logger::INFO)
164
+ # <------
165
+ # object-level ---->
166
+ include Logging
167
+ # <---------
168
+
169
+ def test_log
170
+ @@log.info('class-level logger called from instance: ' << @@log.to_s)
171
+ #@log = @@log # works too
172
+ @log = TClass.class_eval{@log}
173
+ @log.info('AGAIN: class-level logger called from instance: ' << @log.to_s)
174
+ @log.debug("you won't see this on log-level INFO")
175
+
176
+ # object-level ---->
177
+ init_logger
178
+ # <-----------
179
+ @log.info("That's a different thing: " << @log.to_s << " - object-level logger!")
180
+
181
+ end
182
+ def self::test_log
183
+ @log.info('class-level logger called from class: ' << @log.to_s)
184
+ @@log.info('AGAIN: class-level logger called from class: ' << @log.to_s)
185
+ end
186
+ end
187
+
188
+ TClass.new.test_log # class-logger + 1st object-logger
189
+ TClass.new.test_log # same class-logger + 2nd object-logger
190
+
191
+ TClass::test_log # same class-logger
192
+ puts 'And just say it once clearly: THIS IS COOOL!!'
193
+ end
194
+ #EOF
@@ -0,0 +1,248 @@
1
+ #encoding: UTF-8
2
+ $SLIDESHOW_CSS = %~ /*
3
+ * The CSS-styles used for all slideshow-pages.
4
+ */
5
+
6
+ /* The HTML-body */
7
+ body {
8
+ margin: 0;
9
+ font-size: 0.97em;
10
+ font-family: Verdana, Arial, Helvetica, Sans, Nimbus-Sans;
11
+ background-color: #000000;
12
+ color:#c0c0f0;
13
+ }
14
+
15
+
16
+ /* The page-heading */
17
+ h1 {
18
+ text-align:right;
19
+ padding-right:0.5em;
20
+ color:#2020a0;
21
+ }
22
+
23
+ /* Style of the image */
24
+ img {
25
+ border: 2px solid #5050a0;
26
+ }
27
+
28
+ /* The style of all links */
29
+ a, a:hover, a:link, a:active, a:visited {
30
+ text-decoration:none;
31
+ }
32
+
33
+ span.secLabel {
34
+ font-size:0.8em;
35
+ }
36
+ span.fwbackLabel {
37
+ float:left;
38
+ }
39
+
40
+ /* The style of all buttons*/
41
+ span.button {
42
+ border-left:1px solid #d0d0d0;
43
+ border-top:1px solid #d0d0d0;
44
+ border-bottom:1px solid #000080;
45
+ border-right:1px solid #000080;
46
+ float:left;
47
+ display:block;
48
+ background-color:#9090f0;
49
+ padding-top:0;
50
+ padding-bottom:1px;
51
+ padding-left:4px;
52
+ padding-right:4px;
53
+ margin-right:1px;
54
+ margin-left:0;
55
+ }
56
+
57
+
58
+ button {
59
+ background-color:#a0a0ff;
60
+ padding:0 0 0 0;
61
+ text-align:center;
62
+ width:28px;
63
+ height:20px;
64
+ border-color:#5050a0;
65
+ }
66
+ /* The style of button-images*/
67
+ img.button {
68
+ border:0;
69
+ margin-top:3px;
70
+ }
71
+ div.imgCount {
72
+ float:right;
73
+ }
74
+
75
+ div.toggleControls {
76
+ float:left;
77
+ margin: 0 0 1px 1px;
78
+ }
79
+
80
+ div.heading {
81
+ clear:both;
82
+ }
83
+
84
+ /* block for the image */
85
+ div.currentImage {
86
+ vertical-align:top;
87
+ text-align:left;
88
+ position:absolute;
89
+ left:16.5em;
90
+ top:0.5em;
91
+ }
92
+
93
+ div.imageData {
94
+ clear:both;
95
+ margin-left:0.5em;
96
+ margin-bottom:0.5em;
97
+ }
98
+
99
+ /* This block is used for the column of control elements */
100
+ div.controls {
101
+ margin:0.5em;
102
+ float:left;
103
+ width:15em;
104
+ text-align: right;
105
+ vertical-align: top;
106
+ padding: 0.5em 0.5em 0 0;
107
+ font-weight:bold;
108
+ border: 1px solid #5050a0;
109
+ }
110
+
111
+ div.autoControls {
112
+ float:right;
113
+ margin:0;
114
+ }
115
+
116
+ div.navigationArrows{
117
+ float:right;
118
+ margin-bottom:1em;
119
+ }
120
+
121
+ div.loadNote {
122
+ clear:both;
123
+ text-align:right;
124
+ font-size:0.8em;
125
+ }
126
+
127
+ table.spinbutton {
128
+ height:20px;
129
+ float:left;
130
+ table-layout:fixed;
131
+ border-spacing:0;
132
+ border-collapse:collapse;
133
+ margin:0;
134
+ padding:0;
135
+ }
136
+ col.spinbutton {
137
+ width:1em;
138
+ }
139
+ td.autoControls {
140
+ padding-left:1em;
141
+ }
142
+ td.waitLabel {
143
+ text-align:left;
144
+ }
145
+ td.secLabel {
146
+ padding-left:0.5em;
147
+ }
148
+ td.spinvalue {
149
+ padding:0;
150
+ }
151
+ td.spinup {
152
+ padding:1px 0 0 0;
153
+ }
154
+ td.spindown {
155
+ padding:1px 0 0 0;
156
+ }
157
+ /* The text-input field (time in seconds) */
158
+ input {
159
+ border: 2px solid #000080;
160
+ width: 50px;
161
+ height:10pt;
162
+ text-align:right;
163
+ padding:2px 3px 0px 0;
164
+ background-color:#a0a0ff;
165
+ font-family:monospace,fixed;
166
+ font-size:9pt;
167
+ margin:0;
168
+ }
169
+
170
+
171
+ img.spinbuttonDown {
172
+ border-left:1px solid #d0d0d0;
173
+ border-top:1px solid #d0d0d0;
174
+ border-right:1px solid #0000a0;
175
+ border-bottom:1px solid #0000a0;
176
+ vertical-align:top;
177
+ background-color:#a0a0ff;
178
+ padding-top:0;
179
+ padding-bottom:1px;
180
+ padding-left:4px;
181
+ padding-right:4px;
182
+ margin-right:1px;
183
+ margin-left:0;
184
+ }
185
+ img.spinbuttonUp {
186
+ border-left:1px solid #d0d0d0;
187
+ border-top:1px solid #d0d0d0;
188
+ border-right:1px solid #0000a0;
189
+ border-bottom:1px solid #0000a0;
190
+ vertical-align:bottom;
191
+ background-color:#a0a0ff;
192
+ padding-top:0;
193
+ padding-bottom:1px;
194
+ padding-left:4px;
195
+ padding-right:4px;
196
+ margin-right:1px;
197
+ margin-left:0;
198
+
199
+ }
200
+ img.currentImage {
201
+ background-color:#90f0d0;
202
+ }
203
+ /* This cell contains a static comment text */
204
+ td.comment {
205
+ color:#5050b0;
206
+ text-align: right;
207
+ vertical-align: top;
208
+ padding: 1em 1em 0 0;
209
+ font-weight:normal;
210
+ border-right: 1px solid #5050a0;
211
+ }
212
+
213
+ /* A table-cell that keeps the table in shape, even if the image on the right is small.*/
214
+ #emptyRow {
215
+ height:100%;
216
+ }
217
+
218
+ /* a text paragraph containing an alert message */
219
+ p.alert {
220
+ border: 2px dotted yellow;
221
+ padding: 1em;
222
+ color: rgb(64, 64, 240);
223
+ width: 60%;
224
+ font-weight: bold;
225
+ text-align: center;
226
+ margin: 1em;
227
+ }
228
+ p.waitLabel {
229
+ margin:0;
230
+ }
231
+ hr.progressbar {
232
+ background-repeat:no-repeat;
233
+ background-image:url(images/progress.png);
234
+ clear:both;
235
+ width:100%;
236
+ height:3px;
237
+ background-color:#005050;
238
+ border:1px solid #005050;
239
+ margin:1em 0 0 0;
240
+ }
241
+
242
+ hr.progressSlider {
243
+ width:100%;
244
+ height:5px;
245
+ background-color:black;border:0;
246
+ border-right:3px solid #00d0a0;
247
+ margin:0 0 2em 0;
248
+ } ~
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file