asciidoctor-revealjs 1.1.0 → 1.1.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59739308d6f926a43ca556691f89c0c06cd59ab9
4
- data.tar.gz: d410a0166013bfa61371c43e82e9b2f37a637b62
3
+ metadata.gz: 9e028323af6c4a4b106603aec1ee4b200d77b632
4
+ data.tar.gz: 767defd25cfce4391093acfd89912e6fda55fd73
5
5
  SHA512:
6
- metadata.gz: bfbb7fa08fe665d55fe51f8594b4472c2831e7187474292755336bd85dff269b6c532b82bb905ce23e66b9c526aa550c2acecba529d16b2ae3fe44841aa30a24
7
- data.tar.gz: 7ecb489607db5f527ae2fa1f60ed1ae4edb2104581a33d6cb1151906d9f134622af48917a83b1e71795611b4a2c4bbbbee3e9467148b51cfeba87a26ad8e5808
6
+ metadata.gz: 137a1aa9943940c229fb59eb2e3210783909d61e6c68ba65552bed8fcdf2f0c30c910ced922399664c7fef921324a10b7f2e86944f5c6d5c66993a407a012feb
7
+ data.tar.gz: 2cf304e08589f8a02a8913ee0dbc4052832c578e5aea580dccc990aed317cb363c675936f6db4ad94b493b757cb3143ffd7db8538b2e603b2ac466892deb4c7d
@@ -6,6 +6,37 @@
6
6
  This document provides a high-level view of the changes introduced in {project-name} by release.
7
7
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
8
8
 
9
+ == 1.1.1 (2018-01-03)
10
+
11
+ An emergency bugfix release due to a problem in the Ruby Gem package
12
+
13
+ Enhancements::
14
+ * Documentation improvements ({uri-issue}163[#163], {uri-issue}165[#165], {uri-issue}169[#169], {uri-issue}173[#173], {uri-issue}175[#175])
15
+
16
+ Compliance::
17
+ * Code listing callouts now work properly ({uri-issue}22[#22], {uri-issue}166[#166], {uri-issue}167[#167])
18
+ * More source code listing examples and tests ({uri-issue}163[#163], {uri-issue}170[#170])
19
+
20
+ Bug fixes::
21
+ * The version 1.1.0 Ruby Gem was broken due to a packaging error ({uri-issue}172[#172])
22
+
23
+ === Release meta
24
+
25
+ * Released on: 2018-01-03
26
+ * Released by: Olivier Bilodeau
27
+ * Release beer: Croque-Mort Double IPA, À la fût
28
+
29
+ {uri-repo}/releases/tag/v1.1.1[git tag] |
30
+ {uri-repo}/compare/v1.1.0...v1.1.1[full diff] |
31
+ {uri-repo}/milestone/5[milestone]
32
+
33
+ === Credits
34
+
35
+ Thanks to the following people who contributed to this release:
36
+
37
+ Dietrich Schulten, Olivier Bilodeau
38
+
39
+
9
40
  == 1.1.0 (2017-12-25) - @obilodeau
10
41
 
11
42
  Enhancements::
@@ -1,6 +1,6 @@
1
1
  .The MIT License
2
2
  ....
3
- Copyright (C) 2012-2017 Olivier Bilodeau, Charles Moulliard, Dan Allen and the Asciidoctor Project
3
+ Copyright (C) 2012-2018 Olivier Bilodeau, Charles Moulliard, Dan Allen and the Asciidoctor Project
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -220,12 +220,18 @@ There are a few ways to have no titles on slides.
220
220
  * Adding the `notitle` option to your slide
221
221
  * Adding the `conceal` option to your slide
222
222
 
223
+ ifeval::[{safe-mode-level} >= 20]
224
+ See <<examples/concealed-slide-titles.adoc#,concealed-slide-titles.adoc>>.
225
+ endif::[]
226
+ ifeval::[{safe-mode-level} < 20]
223
227
  Here is an example of the three techniques in action:
224
228
 
225
- [source, asciidoc]
226
- ----
227
- include::test/concealed-slide-titles.adoc[]
228
- ----
229
+ .concealed-slide-titles.adoc
230
+ [source,asciidoc]
231
+ ....
232
+ include::examples/concealed-slide-titles.adoc[lines=5..-1]
233
+ ....
234
+ endif::[]
229
235
 
230
236
  NOTE: `conceal` and `notitle` have the advantage that the slide still has an id so it can be linked to.
231
237
 
@@ -383,6 +389,19 @@ To override that behavior use the `width` and `height` named attributes.
383
389
 
384
390
  === Syntax highlighting
385
391
 
392
+ Reveal.js is well integrated with https://highlightjs.org/[highlight.js] for syntax highlighting.
393
+ Asciidoctor-reveal.js supports that.
394
+ You can activate highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows:
395
+
396
+ [source, asciidoc]
397
+ ----
398
+ = Presentation Title
399
+ // [...] other document attributes
400
+ :source-highlighter: highlightjs
401
+ ----
402
+
403
+ Once enabled you can write code blocks as usual:
404
+
386
405
  [source, asciidoc]
387
406
  ....
388
407
  == Slide Five
@@ -395,7 +414,6 @@ print "Hello World"
395
414
  ----
396
415
  ....
397
416
 
398
- `revealjs` uses https://highlightjs.org/[highlight.js] to do its syntax highlighting by default.
399
417
  By default `[source]` blocks and blocks delimited by `----` will be highlighted.
400
418
  An explicit `[listing]` block will not be highlighted.
401
419
  `highlight.js` does language auto-detection but using the `language="..."` attribute will hint the highlighter.
@@ -412,27 +430,10 @@ print "$0: hello world\n"
412
430
  ....
413
431
 
414
432
  [NOTE]
415
- Currently `revealjs` uses a rather old version of https://highlightjs.org/[highlight.js] that does not handle callouts correctly.
416
- To fix this download a current version of https://highlightjs.org/[highlight.js] and copy it to `reveal.js/plugin/highlight/highlight.js`.
417
-
418
- Alternatively, you can use http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as the highlighter.
419
- These handle callouts correctly.
420
-
421
- To use http://coderay.rubychan.de[Coderay]:
433
+ Alternatively, you can use http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as syntax highlighters if you are using the Asciidoctor/Ruby/Bundler toolchain (not Asciidoctor.js/Javascript/NPM).
434
+ Check the `examples/` directory for examples and notes about what needs to be done for them to work.
435
+ They are considered unsupported by the asciidoctor-reveal.js project.
422
436
 
423
- [source, asciidoc]
424
- ----
425
- = Title slide
426
- :source-highlighter: coderay
427
- ----
428
-
429
- To use http://pygments.org[Pygments]:
430
-
431
- [source, asciidoc]
432
- ----
433
- = Title slide
434
- :source-highlighter: pygments
435
- ----
436
437
 
437
438
  === Vertical slides
438
439
 
@@ -463,20 +464,23 @@ title that look like this: `:name: value`.
463
464
  This converter supports changing the color, image, video, iframe and
464
465
  transitions of the title slide.
465
466
 
466
- Read {uri-revealjs-gh}#slide-backgrounds[the relevant
467
- reveal.js documentation] to understand what attributes need to be set.
468
- Keep in mind that for title slides you must replace `data-` with
469
- `title-slide-`.
467
+ Read {uri-revealjs-gh}#slide-backgrounds[the relevant reveal.js documentation] to understand what attributes need to be set.
468
+ Keep in mind that for title slides you must replace `data-` with `title-slide-`.
470
469
 
470
+ ifeval::[{safe-mode-level} >= 20]
471
+ See <<examples/title-slide-image.adoc#,title-slide-image.adoc>>.
472
+ endif::[]
473
+ ifeval::[{safe-mode-level} < 20]
471
474
  Here is an example:
472
475
 
473
- [source, asciidoc]
474
- ----
475
- include::test/title-slide-image.adoc[]
476
- ----
476
+ .title-slide-image.adoc
477
+ [source,asciidoc]
478
+ ....
479
+ include::examples/title-slide-image.adoc[lines=5..-1]
480
+ ....
481
+ endif::[]
477
482
 
478
- The title slide is also added a `title` CSS class to help with template
479
- customization.
483
+ The title slide is also added a `title` CSS class to help with template customization.
480
484
 
481
485
  === Content meant for multiple converters
482
486
 
@@ -725,7 +729,7 @@ activate it.
725
729
 
726
730
  == Copyright and Licensing
727
731
 
728
- Copyright (C) 2012-2017 {authors} and the Asciidoctor Project.
732
+ Copyright (C) 2012-2018 {authors} and the Asciidoctor Project.
729
733
  Free use of this software is granted under the terms of the MIT License.
730
734
 
731
735
  ifdef::env-github,env-browser[See the <<LICENSE#,LICENSE>> file for details.]
@@ -14,7 +14,12 @@ Gem::Specification.new do |s|
14
14
  s.required_ruby_version = '>= 1.9.3'
15
15
 
16
16
  files = begin
17
- (result = Open3.popen3('git ls-files -z') {|_, out| out.read }.split %(\0)).empty? ? Dir['**/*'] : result
17
+ if (result = Open3.popen3('git ls-files -z') {|_, out| out.read }.split %(\0)).empty?
18
+ Dir['**/*']
19
+ else
20
+ # converter.rb is built locally before packaging but ignored by git. Adding manually.
21
+ result + ['lib/asciidoctor-revealjs/converter.rb']
22
+ end
18
23
  rescue
19
24
  Dir['**/*']
20
25
  end
@@ -2,19 +2,17 @@
2
2
  // Demonstration of source callouts
3
3
  // :include: //div[@class="slides"]
4
4
  // :header_footer:
5
- = Presentation
6
- Me
5
+ = Source code callouts
7
6
  :icons: font
8
7
  :source-highlighter: highlightjs
9
- // FIXME coderay, pygments and rouge should also be tested
10
8
 
11
9
  == Callout
12
10
 
13
- // FIXME source callouts are broken right now
11
+ // FIXME Callout with `:icons: font` not styled as a numbered ball (#168)
14
12
  [source, rust]
15
13
  ----
16
14
  fn main() {
17
15
  println!("Hello World!"); // <1>
18
- }
16
+ }
19
17
  ----
20
18
  <1> `println!` is a macro.
@@ -0,0 +1,33 @@
1
+ // .source-coderay
2
+ // Demonstration of source highlighting with coderay
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = Source Code with Coderay
6
+ :icons: font
7
+ :source-highlighter: coderay
8
+ :coderay-css: style
9
+
10
+ == Requirements
11
+
12
+ WARNING: This will not work from Asciidoctor.js
13
+
14
+ [NOTE]
15
+ ====
16
+ For this to work. You need to add:
17
+
18
+ gem 'coderay'
19
+
20
+ to your `Gemfile` and re-run:
21
+
22
+ bundle install
23
+ ====
24
+
25
+ == Use the Source
26
+
27
+ [source, ruby]
28
+ ----
29
+ # My first Ruby program
30
+ # On my way to Ruby fame & fortune!
31
+
32
+ puts 'Hello, world!'
33
+ ----
@@ -0,0 +1,22 @@
1
+ // .source-highlightjs-html
2
+ // Avoiding regressions with HTML source code inside source block
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = HTML Source Code with Highlight.JS
6
+ :icons: font
7
+ :source-highlighter: highlightjs
8
+
9
+ == Use the Source
10
+
11
+ [source, html]
12
+ ----
13
+ <b>This should be source code and not bold</b>
14
+ ----
15
+
16
+ == Callouts
17
+
18
+ [source, html]
19
+ ----
20
+ <b>complex code</b> <!--1-->
21
+ ----
22
+ <1> complex code needs a callout
@@ -0,0 +1,16 @@
1
+ // .source-highlightjs
2
+ // Demonstration of source highlighting with highlightjs
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = Source Code with Highlight.JS
6
+ :icons: font
7
+ :source-highlighter: highlightjs
8
+
9
+ == Use the Source
10
+
11
+ [source, rust]
12
+ ----
13
+ fn main() {
14
+ println!("Hello World!");
15
+ }
16
+ ----
@@ -0,0 +1,16 @@
1
+ // .source-prettify
2
+ // Demonstration of source highlighting with prettify
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = Source Code with Prettify
6
+ :icons: font
7
+ :source-highlighter: prettify
8
+
9
+ == Use the Source
10
+
11
+ [source, rust]
12
+ ----
13
+ fn main() {
14
+ println!("Hello World!");
15
+ }
16
+ ----
@@ -0,0 +1,32 @@
1
+ // .source-pygments
2
+ // Demonstration of source highlighting with pygments
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = Source Code with Pygments
6
+ :icons: font
7
+ :source-highlighter: pygments
8
+ :pygments-style: paraiso-dark
9
+
10
+ == Requirements
11
+
12
+ WARNING: This will not work from Asciidoctor.js
13
+
14
+ [NOTE]
15
+ ====
16
+ For this to work. You need to add:
17
+
18
+ gem 'pygments.rb'
19
+
20
+ to your `Gemfile` and re-run:
21
+
22
+ bundle install
23
+ ====
24
+
25
+ == Use the Source
26
+
27
+ [source, rust]
28
+ ----
29
+ fn main() {
30
+ println!("Hello World!");
31
+ }
32
+ ----
@@ -0,0 +1,3922 @@
1
+ # This file has been generated!
2
+
3
+ module Asciidoctor; module Revealjs; end end
4
+ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
5
+
6
+ #------------------------------ Begin of Helpers ------------------------------#
7
+
8
+ unless RUBY_ENGINE == 'opal'
9
+ # This helper file borrows from the Bespoke converter
10
+ # https://github.com/asciidoctor/asciidoctor-bespoke
11
+ require 'asciidoctor'
12
+ end
13
+
14
+ # This module gets mixed in to every node (the context of the template) at the
15
+ # time the node is being converted. The properties and methods in this module
16
+ # effectively become direct members of the template.
17
+ module Helpers
18
+
19
+ EOL = %(\n)
20
+ SliceHintRx = / +/
21
+
22
+ def slice_text str, active = nil
23
+ if (active || (active.nil? && (option? :slice))) && (str.include? ' ')
24
+ (str.split SliceHintRx).map {|line| %(<span class="line">#{line}</span>) }.join EOL
25
+ else
26
+ str
27
+ end
28
+ end
29
+
30
+ def to_boolean val
31
+ val && val != 'false' && val.to_s != '0' || false
32
+ end
33
+
34
+ ##
35
+ # These constants and functions are from the asciidictor-html5s project
36
+ # https://github.com/jirutka/asciidoctor-html5s/blob/a71db48a1dd5196b668b3a3d93693c5d877c5bf3/data/templates/helpers.rb
37
+
38
+ # Defaults
39
+ DEFAULT_TOCLEVELS = 2
40
+ DEFAULT_SECTNUMLEVELS = 3
41
+
42
+
43
+ VOID_ELEMENTS = %w(area base br col command embed hr img input keygen link
44
+ meta param source track wbr)
45
+
46
+ ##
47
+ # Creates an HTML tag with the given name and optionally attributes. Can take
48
+ # a block that will run between the opening and closing tags.
49
+ #
50
+ # @param name [#to_s] the name of the tag.
51
+ # @param attributes [Hash] (default: {})
52
+ # @param content [#to_s] the content; +nil+ to call the block. (default: nil).
53
+ # @yield The block of Slim/HTML code within the tag (optional).
54
+ # @return [String] a rendered HTML element.
55
+ #
56
+
57
+ def html_tag(name, attributes = {}, content = nil)
58
+ attrs = attributes.inject([]) do |attrs, (k, v)|
59
+ next attrs if !v || v.nil_or_empty?
60
+ v = v.compact.join(' ') if v.is_a? Array
61
+ attrs << (v == true ? k : %(#{k}="#{v}"))
62
+ end
63
+ attrs_str = attrs.empty? ? '' : attrs.join(' ').prepend(' ')
64
+
65
+
66
+ if VOID_ELEMENTS.include? name.to_s
67
+ %(<#{name}#{attrs_str}>)
68
+ else
69
+ content ||= yield if block_given?
70
+ %(<#{name}#{attrs_str}>#{content}</#{name}>)
71
+ end
72
+ end
73
+
74
+
75
+ ##
76
+ # Returns corrected section level.
77
+ #
78
+ # @param sec [Asciidoctor::Section] the section node (default: self).
79
+ # @return [Integer]
80
+ #
81
+ def section_level(sec = self)
82
+ @_section_level ||= (sec.level == 0 && sec.special) ? 1 : sec.level
83
+ end
84
+
85
+
86
+ ##
87
+ # Returns the captioned section's title, optionally numbered.
88
+ #
89
+ # @param sec [Asciidoctor::Section] the section node (default: self).
90
+ # @return [String]
91
+ #
92
+ def section_title(sec = self)
93
+ sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i
94
+
95
+ if sec.numbered && !sec.caption && sec.level <= sectnumlevels
96
+ [sec.sectnum, sec.captioned_title].join(' ')
97
+ else
98
+ sec.captioned_title
99
+ end
100
+ end
101
+
102
+ end
103
+
104
+ # More custom functions can be added in another namespace if required
105
+ #module Helpers
106
+ #end
107
+
108
+
109
+ # Make Helpers' constants accessible from transform methods.
110
+ Helpers.constants.each do |const|
111
+ const_set(const, Helpers.const_get(const))
112
+ end
113
+
114
+ #------------------------------- End of Helpers -------------------------------#
115
+
116
+
117
+ register_for "revealjs"
118
+
119
+ def initialize(backend, opts = {})
120
+ super
121
+ basebackend "html"
122
+ outfilesuffix ".html"
123
+ filetype "html"
124
+
125
+ delegate_backend = (opts[:delegate_backend] || "html5").to_s
126
+ factory = ::Asciidoctor::Converter::Factory
127
+
128
+ converter = factory.create(delegate_backend, backend_info)
129
+ @delegate_converter = if converter == self
130
+ factory.new.create(delegate_backend, backend_info)
131
+ else
132
+ converter
133
+ end
134
+ end
135
+
136
+ def convert(node, transform = nil, opts = {})
137
+ transform ||= node.node_name
138
+ converter = respond_to?(transform) ? self : @delegate_converter
139
+
140
+ if opts.empty?
141
+ converter.send(transform, node)
142
+ else
143
+ converter.send(transform, node, opts)
144
+ end
145
+ end
146
+
147
+ #----------------- Begin of generated transformation methods -----------------#
148
+
149
+
150
+ def inline_footnote(node, opts = {})
151
+ node.extend(Helpers)
152
+ node.instance_eval do
153
+ converter.set_local_variables(binding, opts) unless opts.empty?
154
+ _buf = ''
155
+ if @type == :xref
156
+ _buf << ("<span class=\"footnoteref\">[<a class=\"footnote\" href=\"#_footnote_".freeze)
157
+ _buf << ((attr :index).to_s)
158
+ _buf << ("\" title=\"View footnote.\">".freeze)
159
+ _buf << ((attr :index).to_s)
160
+ _buf << ("</a>]</span>".freeze)
161
+ else
162
+ _buf << ("<span class=\"footnote\"".freeze)
163
+ _slim_codeattributes1 = ("_footnote_#{@id}" if @id)
164
+ if _slim_codeattributes1
165
+ if _slim_codeattributes1 == true
166
+ _buf << (" id".freeze)
167
+ else
168
+ _buf << (" id=\"".freeze)
169
+ _buf << ((_slim_codeattributes1).to_s)
170
+ _buf << ("\"".freeze)
171
+ end
172
+ end
173
+ _buf << (">[<a id=\"_footnoteref_".freeze)
174
+ _buf << ((attr :index).to_s)
175
+ _buf << ("\" class=\"footnote\" href=\"#_footnote_".freeze)
176
+ _buf << ((attr :index).to_s)
177
+ _buf << ("\" title=\"View footnote.\">".freeze)
178
+ _buf << ((attr :index).to_s)
179
+ _buf << ("</a>]</span>".freeze)
180
+ end
181
+ _buf
182
+ end
183
+ end
184
+
185
+ def stem(node, opts = {})
186
+ node.extend(Helpers)
187
+ node.instance_eval do
188
+ converter.set_local_variables(binding, opts) unless opts.empty?
189
+ _buf = ''
190
+ open, close = Asciidoctor::BLOCK_MATH_DELIMITERS[@style.to_sym]
191
+ equation = content.strip
192
+ if (@subs.nil? || @subs.empty?) && !(attr? 'subs')
193
+ equation = sub_specialcharacters equation
194
+ end
195
+ unless (equation.start_with? open) && (equation.end_with? close)
196
+ equation = %(#{open}#{equation}#{close})
197
+ end
198
+ _buf << ("<div".freeze)
199
+ _temple_html_attributeremover1 = ''
200
+ _temple_html_attributemerger1 = []
201
+ _temple_html_attributemerger1[0] = "stemblock"
202
+ _temple_html_attributemerger1[1] = ''
203
+ _slim_codeattributes1 = role
204
+ if Array === _slim_codeattributes1
205
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
206
+ _slim_codeattributes1.map!(&:to_s)
207
+ _slim_codeattributes1.reject!(&:empty?)
208
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
209
+ else
210
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
211
+ end
212
+ _temple_html_attributemerger1[1]
213
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
214
+ _temple_html_attributeremover1
215
+ if !_temple_html_attributeremover1.empty?
216
+ _buf << (" class=\"".freeze)
217
+ _buf << ((_temple_html_attributeremover1).to_s)
218
+ _buf << ("\"".freeze)
219
+ end
220
+ _slim_codeattributes2 = @id
221
+ if _slim_codeattributes2
222
+ if _slim_codeattributes2 == true
223
+ _buf << (" id".freeze)
224
+ else
225
+ _buf << (" id=\"".freeze)
226
+ _buf << ((_slim_codeattributes2).to_s)
227
+ _buf << ("\"".freeze)
228
+ end
229
+ end
230
+ _buf << (">".freeze)
231
+ if title?
232
+ _buf << ("<div class=\"title\">".freeze)
233
+ _buf << ((title).to_s)
234
+ _buf << ("</div>".freeze)
235
+ end
236
+ _buf << ("<div class=\"content\">".freeze)
237
+ _buf << ((equation).to_s)
238
+ _buf << ("</div></div>".freeze)
239
+ _buf
240
+ end
241
+ end
242
+
243
+ def inline_image(node, opts = {})
244
+ node.extend(Helpers)
245
+ node.instance_eval do
246
+ converter.set_local_variables(binding, opts) unless opts.empty?
247
+ _buf = ''
248
+ _buf << ("<span".freeze)
249
+ _temple_html_attributeremover1 = ''
250
+ _slim_codeattributes1 = [@type,role]
251
+ if Array === _slim_codeattributes1
252
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
253
+ _slim_codeattributes1.map!(&:to_s)
254
+ _slim_codeattributes1.reject!(&:empty?)
255
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
256
+ else
257
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
258
+ end
259
+ _temple_html_attributeremover1
260
+ if !_temple_html_attributeremover1.empty?
261
+ _buf << (" class=\"".freeze)
262
+ _buf << ((_temple_html_attributeremover1).to_s)
263
+ _buf << ("\"".freeze)
264
+ end
265
+ _slim_codeattributes2 = ("float: #{attr :float}" if attr? :float)
266
+ if _slim_codeattributes2
267
+ if _slim_codeattributes2 == true
268
+ _buf << (" style".freeze)
269
+ else
270
+ _buf << (" style=\"".freeze)
271
+ _buf << ((_slim_codeattributes2).to_s)
272
+ _buf << ("\"".freeze)
273
+ end
274
+ end
275
+ _buf << (">".freeze)
276
+ if @type == 'icon' && (@document.attr? :icons, 'font')
277
+ style_class = ["fa fa-#{@target}"]
278
+ style_class << "fa-#{attr :size}" if attr? :size
279
+ style_class << "fa-rotate-#{attr :rotate}" if attr? :rotate
280
+ style_class << "fa-flip-#{attr :flip}" if attr? :flip
281
+ if attr? :link
282
+ _buf << ("<a class=\"image\"".freeze)
283
+ _slim_codeattributes3 = (attr :link)
284
+ if _slim_codeattributes3
285
+ if _slim_codeattributes3 == true
286
+ _buf << (" href".freeze)
287
+ else
288
+ _buf << (" href=\"".freeze)
289
+ _buf << ((_slim_codeattributes3).to_s)
290
+ _buf << ("\"".freeze)
291
+ end
292
+ end
293
+ _slim_codeattributes4 = (attr :window)
294
+ if _slim_codeattributes4
295
+ if _slim_codeattributes4 == true
296
+ _buf << (" target".freeze)
297
+ else
298
+ _buf << (" target=\"".freeze)
299
+ _buf << ((_slim_codeattributes4).to_s)
300
+ _buf << ("\"".freeze)
301
+ end
302
+ end
303
+ _buf << ("><i".freeze)
304
+ _temple_html_attributeremover2 = ''
305
+ _slim_codeattributes5 = style_class
306
+ if Array === _slim_codeattributes5
307
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
308
+ _slim_codeattributes5.map!(&:to_s)
309
+ _slim_codeattributes5.reject!(&:empty?)
310
+ _temple_html_attributeremover2 << ((_slim_codeattributes5.join(" ")).to_s)
311
+ else
312
+ _temple_html_attributeremover2 << ((_slim_codeattributes5).to_s)
313
+ end
314
+ _temple_html_attributeremover2
315
+ if !_temple_html_attributeremover2.empty?
316
+ _buf << (" class=\"".freeze)
317
+ _buf << ((_temple_html_attributeremover2).to_s)
318
+ _buf << ("\"".freeze)
319
+ end
320
+ _slim_codeattributes6 = (attr :title)
321
+ if _slim_codeattributes6
322
+ if _slim_codeattributes6 == true
323
+ _buf << (" title".freeze)
324
+ else
325
+ _buf << (" title=\"".freeze)
326
+ _buf << ((_slim_codeattributes6).to_s)
327
+ _buf << ("\"".freeze)
328
+ end
329
+ end
330
+ _buf << ("></i></a>".freeze)
331
+ else
332
+ _buf << ("<i".freeze)
333
+ _temple_html_attributeremover3 = ''
334
+ _slim_codeattributes7 = style_class
335
+ if Array === _slim_codeattributes7
336
+ _slim_codeattributes7 = _slim_codeattributes7.flatten
337
+ _slim_codeattributes7.map!(&:to_s)
338
+ _slim_codeattributes7.reject!(&:empty?)
339
+ _temple_html_attributeremover3 << ((_slim_codeattributes7.join(" ")).to_s)
340
+ else
341
+ _temple_html_attributeremover3 << ((_slim_codeattributes7).to_s)
342
+ end
343
+ _temple_html_attributeremover3
344
+ if !_temple_html_attributeremover3.empty?
345
+ _buf << (" class=\"".freeze)
346
+ _buf << ((_temple_html_attributeremover3).to_s)
347
+ _buf << ("\"".freeze)
348
+ end
349
+ _slim_codeattributes8 = (attr :title)
350
+ if _slim_codeattributes8
351
+ if _slim_codeattributes8 == true
352
+ _buf << (" title".freeze)
353
+ else
354
+ _buf << (" title=\"".freeze)
355
+ _buf << ((_slim_codeattributes8).to_s)
356
+ _buf << ("\"".freeze)
357
+ end
358
+ end
359
+ _buf << ("></i>".freeze)
360
+ end
361
+ elsif @type == 'icon' && !(@document.attr? :icons)
362
+ if attr? :link
363
+ _buf << ("<a class=\"image\"".freeze)
364
+ _slim_codeattributes9 = (attr :link)
365
+ if _slim_codeattributes9
366
+ if _slim_codeattributes9 == true
367
+ _buf << (" href".freeze)
368
+ else
369
+ _buf << (" href=\"".freeze)
370
+ _buf << ((_slim_codeattributes9).to_s)
371
+ _buf << ("\"".freeze)
372
+ end
373
+ end
374
+ _slim_codeattributes10 = (attr :window)
375
+ if _slim_codeattributes10
376
+ if _slim_codeattributes10 == true
377
+ _buf << (" target".freeze)
378
+ else
379
+ _buf << (" target=\"".freeze)
380
+ _buf << ((_slim_codeattributes10).to_s)
381
+ _buf << ("\"".freeze)
382
+ end
383
+ end
384
+ _buf << (">[".freeze)
385
+ _buf << ((attr :alt).to_s)
386
+ _buf << ("]</a>".freeze)
387
+ else
388
+ _buf << ("[".freeze)
389
+ _buf << ((attr :alt).to_s)
390
+ _buf << ("]".freeze)
391
+ end
392
+ else
393
+ src = (@type == 'icon' ? (icon_uri @target) : (image_uri @target))
394
+ if attr? :link
395
+ _buf << ("<a class=\"image\"".freeze)
396
+ _slim_codeattributes11 = (attr :link)
397
+ if _slim_codeattributes11
398
+ if _slim_codeattributes11 == true
399
+ _buf << (" href".freeze)
400
+ else
401
+ _buf << (" href=\"".freeze)
402
+ _buf << ((_slim_codeattributes11).to_s)
403
+ _buf << ("\"".freeze)
404
+ end
405
+ end
406
+ _slim_codeattributes12 = (attr :window)
407
+ if _slim_codeattributes12
408
+ if _slim_codeattributes12 == true
409
+ _buf << (" target".freeze)
410
+ else
411
+ _buf << (" target=\"".freeze)
412
+ _buf << ((_slim_codeattributes12).to_s)
413
+ _buf << ("\"".freeze)
414
+ end
415
+ end
416
+ _buf << ("><img".freeze)
417
+ _slim_codeattributes13 = src
418
+ if _slim_codeattributes13
419
+ if _slim_codeattributes13 == true
420
+ _buf << (" src".freeze)
421
+ else
422
+ _buf << (" src=\"".freeze)
423
+ _buf << ((_slim_codeattributes13).to_s)
424
+ _buf << ("\"".freeze)
425
+ end
426
+ end
427
+ _slim_codeattributes14 = (attr :alt)
428
+ if _slim_codeattributes14
429
+ if _slim_codeattributes14 == true
430
+ _buf << (" alt".freeze)
431
+ else
432
+ _buf << (" alt=\"".freeze)
433
+ _buf << ((_slim_codeattributes14).to_s)
434
+ _buf << ("\"".freeze)
435
+ end
436
+ end
437
+ _slim_codeattributes15 = (attr :width)
438
+ if _slim_codeattributes15
439
+ if _slim_codeattributes15 == true
440
+ _buf << (" width".freeze)
441
+ else
442
+ _buf << (" width=\"".freeze)
443
+ _buf << ((_slim_codeattributes15).to_s)
444
+ _buf << ("\"".freeze)
445
+ end
446
+ end
447
+ _slim_codeattributes16 = (attr :height)
448
+ if _slim_codeattributes16
449
+ if _slim_codeattributes16 == true
450
+ _buf << (" height".freeze)
451
+ else
452
+ _buf << (" height=\"".freeze)
453
+ _buf << ((_slim_codeattributes16).to_s)
454
+ _buf << ("\"".freeze)
455
+ end
456
+ end
457
+ _slim_codeattributes17 = (attr :title)
458
+ if _slim_codeattributes17
459
+ if _slim_codeattributes17 == true
460
+ _buf << (" title".freeze)
461
+ else
462
+ _buf << (" title=\"".freeze)
463
+ _buf << ((_slim_codeattributes17).to_s)
464
+ _buf << ("\"".freeze)
465
+ end
466
+ end
467
+ _buf << ("></a>".freeze)
468
+ else
469
+ _buf << ("<img".freeze)
470
+ _slim_codeattributes18 = src
471
+ if _slim_codeattributes18
472
+ if _slim_codeattributes18 == true
473
+ _buf << (" src".freeze)
474
+ else
475
+ _buf << (" src=\"".freeze)
476
+ _buf << ((_slim_codeattributes18).to_s)
477
+ _buf << ("\"".freeze)
478
+ end
479
+ end
480
+ _slim_codeattributes19 = (attr :alt)
481
+ if _slim_codeattributes19
482
+ if _slim_codeattributes19 == true
483
+ _buf << (" alt".freeze)
484
+ else
485
+ _buf << (" alt=\"".freeze)
486
+ _buf << ((_slim_codeattributes19).to_s)
487
+ _buf << ("\"".freeze)
488
+ end
489
+ end
490
+ _slim_codeattributes20 = (attr :width)
491
+ if _slim_codeattributes20
492
+ if _slim_codeattributes20 == true
493
+ _buf << (" width".freeze)
494
+ else
495
+ _buf << (" width=\"".freeze)
496
+ _buf << ((_slim_codeattributes20).to_s)
497
+ _buf << ("\"".freeze)
498
+ end
499
+ end
500
+ _slim_codeattributes21 = (attr :height)
501
+ if _slim_codeattributes21
502
+ if _slim_codeattributes21 == true
503
+ _buf << (" height".freeze)
504
+ else
505
+ _buf << (" height=\"".freeze)
506
+ _buf << ((_slim_codeattributes21).to_s)
507
+ _buf << ("\"".freeze)
508
+ end
509
+ end
510
+ _slim_codeattributes22 = (attr :title)
511
+ if _slim_codeattributes22
512
+ if _slim_codeattributes22 == true
513
+ _buf << (" title".freeze)
514
+ else
515
+ _buf << (" title=\"".freeze)
516
+ _buf << ((_slim_codeattributes22).to_s)
517
+ _buf << ("\"".freeze)
518
+ end
519
+ end
520
+ _buf << (">".freeze)
521
+ end
522
+ end
523
+ _buf << ("</span>".freeze)
524
+ _buf
525
+ end
526
+ end
527
+
528
+ def toc(node, opts = {})
529
+ node.extend(Helpers)
530
+ node.instance_eval do
531
+ converter.set_local_variables(binding, opts) unless opts.empty?
532
+ _buf = ''
533
+ _buf << ("<div id=\"toc\"".freeze)
534
+ _temple_html_attributeremover1 = ''
535
+ _slim_codeattributes1 = (attr 'toc-class', 'toc')
536
+ if Array === _slim_codeattributes1
537
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
538
+ _slim_codeattributes1.map!(&:to_s)
539
+ _slim_codeattributes1.reject!(&:empty?)
540
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
541
+ else
542
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
543
+ end
544
+ _temple_html_attributeremover1
545
+ if !_temple_html_attributeremover1.empty?
546
+ _buf << (" class=\"".freeze)
547
+ _buf << ((_temple_html_attributeremover1).to_s)
548
+ _buf << ("\"".freeze)
549
+ end
550
+ _buf << ("><div id=\"toctitle\">".freeze)
551
+ _buf << (((attr 'toc-title')).to_s)
552
+ _buf << ("</div>".freeze)
553
+ _buf << ((converter.convert document, 'outline').to_s)
554
+ _buf << ("</div>".freeze)
555
+ _buf
556
+ end
557
+ end
558
+
559
+ def inline_indexterm(node, opts = {})
560
+ node.extend(Helpers)
561
+ node.instance_eval do
562
+ converter.set_local_variables(binding, opts) unless opts.empty?
563
+ _buf = ''
564
+ if @type == :visible
565
+ _buf << ((@text).to_s)
566
+ end
567
+ _buf
568
+ end
569
+ end
570
+
571
+ def pass(node, opts = {})
572
+ node.extend(Helpers)
573
+ node.instance_eval do
574
+ converter.set_local_variables(binding, opts) unless opts.empty?
575
+ _buf = ''
576
+ _buf << ((content).to_s)
577
+ _buf
578
+ end
579
+ end
580
+
581
+ def inline_button(node, opts = {})
582
+ node.extend(Helpers)
583
+ node.instance_eval do
584
+ converter.set_local_variables(binding, opts) unless opts.empty?
585
+ _buf = ''
586
+ _buf << ("<b class=\"button\">".freeze)
587
+ _buf << ((@text).to_s)
588
+ _buf << ("</b>".freeze)
589
+ _buf
590
+ end
591
+ end
592
+
593
+ def paragraph(node, opts = {})
594
+ node.extend(Helpers)
595
+ node.instance_eval do
596
+ converter.set_local_variables(binding, opts) unless opts.empty?
597
+ _buf = ''
598
+ _buf << ("<div".freeze)
599
+ _temple_html_attributeremover1 = ''
600
+ _temple_html_attributemerger1 = []
601
+ _temple_html_attributemerger1[0] = "paragraph"
602
+ _temple_html_attributemerger1[1] = ''
603
+ _slim_codeattributes1 = role
604
+ if Array === _slim_codeattributes1
605
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
606
+ _slim_codeattributes1.map!(&:to_s)
607
+ _slim_codeattributes1.reject!(&:empty?)
608
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
609
+ else
610
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
611
+ end
612
+ _temple_html_attributemerger1[1]
613
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
614
+ _temple_html_attributeremover1
615
+ if !_temple_html_attributeremover1.empty?
616
+ _buf << (" class=\"".freeze)
617
+ _buf << ((_temple_html_attributeremover1).to_s)
618
+ _buf << ("\"".freeze)
619
+ end
620
+ _slim_codeattributes2 = @id
621
+ if _slim_codeattributes2
622
+ if _slim_codeattributes2 == true
623
+ _buf << (" id".freeze)
624
+ else
625
+ _buf << (" id=\"".freeze)
626
+ _buf << ((_slim_codeattributes2).to_s)
627
+ _buf << ("\"".freeze)
628
+ end
629
+ end
630
+ _buf << (">".freeze)
631
+ if title?
632
+ _buf << ("<div class=\"title\">".freeze)
633
+ _buf << ((title).to_s)
634
+ _buf << ("</div>".freeze)
635
+ end
636
+ if has_role? 'small'
637
+ _buf << ("<small>".freeze)
638
+ _buf << ((content).to_s)
639
+ _buf << ("</small>".freeze)
640
+ else
641
+ _buf << ("<p>".freeze)
642
+ _buf << ((content).to_s)
643
+ _buf << ("</p>".freeze)
644
+ end
645
+ _buf << ("</div>".freeze)
646
+ _buf
647
+ end
648
+ end
649
+
650
+ def example(node, opts = {})
651
+ node.extend(Helpers)
652
+ node.instance_eval do
653
+ converter.set_local_variables(binding, opts) unless opts.empty?
654
+ _buf = ''
655
+ _buf << ("<div".freeze)
656
+ _temple_html_attributeremover1 = ''
657
+ _temple_html_attributemerger1 = []
658
+ _temple_html_attributemerger1[0] = "exampleblock"
659
+ _temple_html_attributemerger1[1] = ''
660
+ _slim_codeattributes1 = role
661
+ if Array === _slim_codeattributes1
662
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
663
+ _slim_codeattributes1.map!(&:to_s)
664
+ _slim_codeattributes1.reject!(&:empty?)
665
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
666
+ else
667
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
668
+ end
669
+ _temple_html_attributemerger1[1]
670
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
671
+ _temple_html_attributeremover1
672
+ if !_temple_html_attributeremover1.empty?
673
+ _buf << (" class=\"".freeze)
674
+ _buf << ((_temple_html_attributeremover1).to_s)
675
+ _buf << ("\"".freeze)
676
+ end
677
+ _slim_codeattributes2 = @id
678
+ if _slim_codeattributes2
679
+ if _slim_codeattributes2 == true
680
+ _buf << (" id".freeze)
681
+ else
682
+ _buf << (" id=\"".freeze)
683
+ _buf << ((_slim_codeattributes2).to_s)
684
+ _buf << ("\"".freeze)
685
+ end
686
+ end
687
+ _buf << (">".freeze)
688
+ if title?
689
+ _buf << ("<div class=\"title\">".freeze)
690
+ _buf << ((captioned_title).to_s)
691
+ _buf << ("</div>".freeze)
692
+ end
693
+ _buf << ("<div class=\"content\">".freeze)
694
+ _buf << ((content).to_s)
695
+ _buf << ("</div></div>".freeze)
696
+ _buf
697
+ end
698
+ end
699
+
700
+ def dlist(node, opts = {})
701
+ node.extend(Helpers)
702
+ node.instance_eval do
703
+ converter.set_local_variables(binding, opts) unless opts.empty?
704
+ _buf = ''
705
+ case @style
706
+ when 'qanda'
707
+ _buf << ("<div".freeze)
708
+ _temple_html_attributeremover1 = ''
709
+ _temple_html_attributemerger1 = []
710
+ _temple_html_attributemerger1[0] = "qlist"
711
+ _temple_html_attributemerger1[1] = ''
712
+ _slim_codeattributes1 = ['qanda',role]
713
+ if Array === _slim_codeattributes1
714
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
715
+ _slim_codeattributes1.map!(&:to_s)
716
+ _slim_codeattributes1.reject!(&:empty?)
717
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
718
+ else
719
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
720
+ end
721
+ _temple_html_attributemerger1[1]
722
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
723
+ _temple_html_attributeremover1
724
+ if !_temple_html_attributeremover1.empty?
725
+ _buf << (" class=\"".freeze)
726
+ _buf << ((_temple_html_attributeremover1).to_s)
727
+ _buf << ("\"".freeze)
728
+ end
729
+ _slim_codeattributes2 = @id
730
+ if _slim_codeattributes2
731
+ if _slim_codeattributes2 == true
732
+ _buf << (" id".freeze)
733
+ else
734
+ _buf << (" id=\"".freeze)
735
+ _buf << ((_slim_codeattributes2).to_s)
736
+ _buf << ("\"".freeze)
737
+ end
738
+ end
739
+ _buf << (">".freeze)
740
+ if title?
741
+ _buf << ("<div class=\"title\">".freeze)
742
+ _buf << ((title).to_s)
743
+ _buf << ("</div>".freeze)
744
+ end
745
+ _buf << ("<ol>".freeze)
746
+ items.each do |questions, answer|
747
+ _buf << ("<li>".freeze)
748
+ [*questions].each do |question|
749
+ _buf << ("<p><em>".freeze)
750
+ _buf << ((question.text).to_s)
751
+ _buf << ("</em></p>".freeze)
752
+ end
753
+ unless answer.nil?
754
+ if answer.text?
755
+ _buf << ("<p>".freeze)
756
+ _buf << ((answer.text).to_s)
757
+ _buf << ("</p>".freeze)
758
+ end
759
+ if answer.blocks?
760
+ _buf << ((answer.content).to_s)
761
+ end
762
+ end
763
+ _buf << ("</li>".freeze)
764
+ end
765
+ _buf << ("</ol></div>".freeze)
766
+ when 'horizontal'
767
+ _buf << ("<div".freeze)
768
+ _temple_html_attributeremover2 = ''
769
+ _temple_html_attributemerger2 = []
770
+ _temple_html_attributemerger2[0] = "hdlist"
771
+ _temple_html_attributemerger2[1] = ''
772
+ _slim_codeattributes3 = role
773
+ if Array === _slim_codeattributes3
774
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
775
+ _slim_codeattributes3.map!(&:to_s)
776
+ _slim_codeattributes3.reject!(&:empty?)
777
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes3.join(" ")).to_s)
778
+ else
779
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes3).to_s)
780
+ end
781
+ _temple_html_attributemerger2[1]
782
+ _temple_html_attributeremover2 << ((_temple_html_attributemerger2.reject(&:empty?).join(" ")).to_s)
783
+ _temple_html_attributeremover2
784
+ if !_temple_html_attributeremover2.empty?
785
+ _buf << (" class=\"".freeze)
786
+ _buf << ((_temple_html_attributeremover2).to_s)
787
+ _buf << ("\"".freeze)
788
+ end
789
+ _slim_codeattributes4 = @id
790
+ if _slim_codeattributes4
791
+ if _slim_codeattributes4 == true
792
+ _buf << (" id".freeze)
793
+ else
794
+ _buf << (" id=\"".freeze)
795
+ _buf << ((_slim_codeattributes4).to_s)
796
+ _buf << ("\"".freeze)
797
+ end
798
+ end
799
+ _buf << (">".freeze)
800
+ if title?
801
+ _buf << ("<div class=\"title\">".freeze)
802
+ _buf << ((title).to_s)
803
+ _buf << ("</div>".freeze)
804
+ end
805
+ _buf << ("<table>".freeze)
806
+ if (attr? :labelwidth) || (attr? :itemwidth)
807
+ _buf << ("<colgroup><col".freeze)
808
+ _slim_codeattributes5 = ((attr? :labelwidth) ? %(width:#{(attr :labelwidth).chomp '%'}%;) : nil)
809
+ if _slim_codeattributes5
810
+ if _slim_codeattributes5 == true
811
+ _buf << (" style".freeze)
812
+ else
813
+ _buf << (" style=\"".freeze)
814
+ _buf << ((_slim_codeattributes5).to_s)
815
+ _buf << ("\"".freeze)
816
+ end
817
+ end
818
+ _buf << ("><col".freeze)
819
+ _slim_codeattributes6 = ((attr? :itemwidth) ? %(width:#{(attr :itemwidth).chomp '%'}%;) : nil)
820
+ if _slim_codeattributes6
821
+ if _slim_codeattributes6 == true
822
+ _buf << (" style".freeze)
823
+ else
824
+ _buf << (" style=\"".freeze)
825
+ _buf << ((_slim_codeattributes6).to_s)
826
+ _buf << ("\"".freeze)
827
+ end
828
+ end
829
+ _buf << ("></colgroup>".freeze)
830
+ end
831
+ items.each do |terms, dd|
832
+ _buf << ("<tr><td".freeze)
833
+ _temple_html_attributeremover3 = ''
834
+ _slim_codeattributes7 = ['hdlist1',('strong' if option? 'strong')]
835
+ if Array === _slim_codeattributes7
836
+ _slim_codeattributes7 = _slim_codeattributes7.flatten
837
+ _slim_codeattributes7.map!(&:to_s)
838
+ _slim_codeattributes7.reject!(&:empty?)
839
+ _temple_html_attributeremover3 << ((_slim_codeattributes7.join(" ")).to_s)
840
+ else
841
+ _temple_html_attributeremover3 << ((_slim_codeattributes7).to_s)
842
+ end
843
+ _temple_html_attributeremover3
844
+ if !_temple_html_attributeremover3.empty?
845
+ _buf << (" class=\"".freeze)
846
+ _buf << ((_temple_html_attributeremover3).to_s)
847
+ _buf << ("\"".freeze)
848
+ end
849
+ _buf << (">".freeze)
850
+ terms = [*terms]
851
+ last_term = terms.last
852
+ terms.each do |dt|
853
+ _buf << ((dt.text).to_s)
854
+ if dt != last_term
855
+ _buf << ("<br>".freeze)
856
+ end
857
+ end
858
+ _buf << ("</td><td class=\"hdlist2\">".freeze)
859
+ unless dd.nil?
860
+ if dd.text?
861
+ _buf << ("<p>".freeze)
862
+ _buf << ((dd.text).to_s)
863
+ _buf << ("</p>".freeze)
864
+ end
865
+ if dd.blocks?
866
+ _buf << ((dd.content).to_s)
867
+ end
868
+ end
869
+ _buf << ("</td></tr>".freeze)
870
+ end
871
+ _buf << ("</table></div>".freeze)
872
+ else
873
+ _buf << ("<div".freeze)
874
+ _temple_html_attributeremover4 = ''
875
+ _temple_html_attributemerger3 = []
876
+ _temple_html_attributemerger3[0] = "dlist"
877
+ _temple_html_attributemerger3[1] = ''
878
+ _slim_codeattributes8 = [@style,role]
879
+ if Array === _slim_codeattributes8
880
+ _slim_codeattributes8 = _slim_codeattributes8.flatten
881
+ _slim_codeattributes8.map!(&:to_s)
882
+ _slim_codeattributes8.reject!(&:empty?)
883
+ _temple_html_attributemerger3[1] << ((_slim_codeattributes8.join(" ")).to_s)
884
+ else
885
+ _temple_html_attributemerger3[1] << ((_slim_codeattributes8).to_s)
886
+ end
887
+ _temple_html_attributemerger3[1]
888
+ _temple_html_attributeremover4 << ((_temple_html_attributemerger3.reject(&:empty?).join(" ")).to_s)
889
+ _temple_html_attributeremover4
890
+ if !_temple_html_attributeremover4.empty?
891
+ _buf << (" class=\"".freeze)
892
+ _buf << ((_temple_html_attributeremover4).to_s)
893
+ _buf << ("\"".freeze)
894
+ end
895
+ _slim_codeattributes9 = @id
896
+ if _slim_codeattributes9
897
+ if _slim_codeattributes9 == true
898
+ _buf << (" id".freeze)
899
+ else
900
+ _buf << (" id=\"".freeze)
901
+ _buf << ((_slim_codeattributes9).to_s)
902
+ _buf << ("\"".freeze)
903
+ end
904
+ end
905
+ _buf << (">".freeze)
906
+ if title?
907
+ _buf << ("<div class=\"title\">".freeze)
908
+ _buf << ((title).to_s)
909
+ _buf << ("</div>".freeze)
910
+ end
911
+ _buf << ("<dl>".freeze)
912
+ items.each do |terms, dd|
913
+ [*terms].each do |dt|
914
+ _buf << ("<dt".freeze)
915
+ _temple_html_attributeremover5 = ''
916
+ _slim_codeattributes10 = ('hdlist1' unless @style)
917
+ if Array === _slim_codeattributes10
918
+ _slim_codeattributes10 = _slim_codeattributes10.flatten
919
+ _slim_codeattributes10.map!(&:to_s)
920
+ _slim_codeattributes10.reject!(&:empty?)
921
+ _temple_html_attributeremover5 << ((_slim_codeattributes10.join(" ")).to_s)
922
+ else
923
+ _temple_html_attributeremover5 << ((_slim_codeattributes10).to_s)
924
+ end
925
+ _temple_html_attributeremover5
926
+ if !_temple_html_attributeremover5.empty?
927
+ _buf << (" class=\"".freeze)
928
+ _buf << ((_temple_html_attributeremover5).to_s)
929
+ _buf << ("\"".freeze)
930
+ end
931
+ _buf << (">".freeze)
932
+ _buf << ((dt.text).to_s)
933
+ _buf << ("</dt>".freeze)
934
+ end
935
+ unless dd.nil?
936
+ _buf << ("<dd>".freeze)
937
+ if dd.text?
938
+ _buf << ("<p>".freeze)
939
+ _buf << ((dd.text).to_s)
940
+ _buf << ("</p>".freeze)
941
+ end
942
+ if dd.blocks?
943
+ _buf << ((dd.content).to_s)
944
+ end
945
+ _buf << ("</dd>".freeze)
946
+ end
947
+ end
948
+ _buf << ("</dl></div>".freeze)
949
+ end
950
+ _buf
951
+ end
952
+ end
953
+
954
+ def colist(node, opts = {})
955
+ node.extend(Helpers)
956
+ node.instance_eval do
957
+ converter.set_local_variables(binding, opts) unless opts.empty?
958
+ _buf = ''
959
+ _buf << ("<div".freeze)
960
+ _temple_html_attributeremover1 = ''
961
+ _temple_html_attributemerger1 = []
962
+ _temple_html_attributemerger1[0] = "colist"
963
+ _temple_html_attributemerger1[1] = ''
964
+ _slim_codeattributes1 = [@style,role]
965
+ if Array === _slim_codeattributes1
966
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
967
+ _slim_codeattributes1.map!(&:to_s)
968
+ _slim_codeattributes1.reject!(&:empty?)
969
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
970
+ else
971
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
972
+ end
973
+ _temple_html_attributemerger1[1]
974
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
975
+ _temple_html_attributeremover1
976
+ if !_temple_html_attributeremover1.empty?
977
+ _buf << (" class=\"".freeze)
978
+ _buf << ((_temple_html_attributeremover1).to_s)
979
+ _buf << ("\"".freeze)
980
+ end
981
+ _slim_codeattributes2 = @id
982
+ if _slim_codeattributes2
983
+ if _slim_codeattributes2 == true
984
+ _buf << (" id".freeze)
985
+ else
986
+ _buf << (" id=\"".freeze)
987
+ _buf << ((_slim_codeattributes2).to_s)
988
+ _buf << ("\"".freeze)
989
+ end
990
+ end
991
+ _buf << (">".freeze)
992
+ if title?
993
+ _buf << ("<div class=\"title\">".freeze)
994
+ _buf << ((title).to_s)
995
+ _buf << ("</div>".freeze)
996
+ end
997
+ if @document.attr? :icons
998
+ font_icons = @document.attr? :icons, 'font'
999
+ _buf << ("<table>".freeze)
1000
+ items.each_with_index do |item, i|
1001
+ num = i + 1
1002
+ _buf << ("<tr><td>".freeze)
1003
+ if font_icons
1004
+ _buf << ("<i class=\"conum\"".freeze)
1005
+ _slim_codeattributes3 = num
1006
+ if _slim_codeattributes3
1007
+ if _slim_codeattributes3 == true
1008
+ _buf << (" data-value".freeze)
1009
+ else
1010
+ _buf << (" data-value=\"".freeze)
1011
+ _buf << ((_slim_codeattributes3).to_s)
1012
+ _buf << ("\"".freeze)
1013
+ end
1014
+ end
1015
+ _buf << ("></i><b>".freeze)
1016
+ _buf << ((num).to_s)
1017
+ _buf << ("</b>".freeze)
1018
+ else
1019
+ _buf << ("<img".freeze)
1020
+ _slim_codeattributes4 = icon_uri("callouts/#{num}")
1021
+ if _slim_codeattributes4
1022
+ if _slim_codeattributes4 == true
1023
+ _buf << (" src".freeze)
1024
+ else
1025
+ _buf << (" src=\"".freeze)
1026
+ _buf << ((_slim_codeattributes4).to_s)
1027
+ _buf << ("\"".freeze)
1028
+ end
1029
+ end
1030
+ _slim_codeattributes5 = num
1031
+ if _slim_codeattributes5
1032
+ if _slim_codeattributes5 == true
1033
+ _buf << (" alt".freeze)
1034
+ else
1035
+ _buf << (" alt=\"".freeze)
1036
+ _buf << ((_slim_codeattributes5).to_s)
1037
+ _buf << ("\"".freeze)
1038
+ end
1039
+ end
1040
+ _buf << (">".freeze)
1041
+ end
1042
+ _buf << ("</td><td>".freeze)
1043
+ _buf << ((item.text).to_s)
1044
+ _buf << ("</td></tr>".freeze)
1045
+ end
1046
+ _buf << ("</table>".freeze)
1047
+ else
1048
+ _buf << ("<ol>".freeze)
1049
+ items.each do |item|
1050
+ _buf << ("<li><p>".freeze)
1051
+ _buf << ((item.text).to_s)
1052
+ _buf << ("</p></li>".freeze)
1053
+ end
1054
+ _buf << ("</ol>".freeze)
1055
+ end
1056
+ _buf << ("</div>".freeze)
1057
+ _buf
1058
+ end
1059
+ end
1060
+
1061
+ def inline_kbd(node, opts = {})
1062
+ node.extend(Helpers)
1063
+ node.instance_eval do
1064
+ converter.set_local_variables(binding, opts) unless opts.empty?
1065
+ _buf = ''
1066
+ if (keys = attr 'keys').size == 1
1067
+ _buf << ("<kbd>".freeze)
1068
+ _buf << ((keys.first).to_s)
1069
+ _buf << ("</kbd>".freeze)
1070
+ else
1071
+ _buf << ("<span class=\"keyseq\">".freeze)
1072
+ keys.each_with_index do |key, idx|
1073
+ unless idx.zero?
1074
+ _buf << ("+".freeze)
1075
+ end
1076
+ _buf << ("<kbd>".freeze)
1077
+ _buf << ((key).to_s)
1078
+ _buf << ("</kbd>".freeze)
1079
+ end
1080
+ _buf << ("</span>".freeze)
1081
+ end
1082
+ _buf
1083
+ end
1084
+ end
1085
+
1086
+ def inline_callout(node, opts = {})
1087
+ node.extend(Helpers)
1088
+ node.instance_eval do
1089
+ converter.set_local_variables(binding, opts) unless opts.empty?
1090
+ _buf = ''
1091
+ if @document.attr? :icons, 'font'
1092
+ _buf << ("<i class=\"conum\"".freeze)
1093
+ _slim_codeattributes1 = @text
1094
+ if _slim_codeattributes1
1095
+ if _slim_codeattributes1 == true
1096
+ _buf << (" data-value".freeze)
1097
+ else
1098
+ _buf << (" data-value=\"".freeze)
1099
+ _buf << ((_slim_codeattributes1).to_s)
1100
+ _buf << ("\"".freeze)
1101
+ end
1102
+ end
1103
+ _buf << ("></i><b>".freeze)
1104
+ _buf << (("(#{@text})").to_s)
1105
+ _buf << ("</b>".freeze)
1106
+ elsif @document.attr? :icons
1107
+ _buf << ("<img".freeze)
1108
+ _slim_codeattributes2 = icon_uri("callouts/#{@text}")
1109
+ if _slim_codeattributes2
1110
+ if _slim_codeattributes2 == true
1111
+ _buf << (" src".freeze)
1112
+ else
1113
+ _buf << (" src=\"".freeze)
1114
+ _buf << ((_slim_codeattributes2).to_s)
1115
+ _buf << ("\"".freeze)
1116
+ end
1117
+ end
1118
+ _slim_codeattributes3 = @text
1119
+ if _slim_codeattributes3
1120
+ if _slim_codeattributes3 == true
1121
+ _buf << (" alt".freeze)
1122
+ else
1123
+ _buf << (" alt=\"".freeze)
1124
+ _buf << ((_slim_codeattributes3).to_s)
1125
+ _buf << ("\"".freeze)
1126
+ end
1127
+ end
1128
+ _buf << (">".freeze)
1129
+ else
1130
+ _buf << ("<b>".freeze)
1131
+ _buf << (("(#{@text})").to_s)
1132
+ _buf << ("</b>".freeze)
1133
+ end
1134
+ _buf
1135
+ end
1136
+ end
1137
+
1138
+ def preamble(node, opts = {})
1139
+ node.extend(Helpers)
1140
+ node.instance_eval do
1141
+ converter.set_local_variables(binding, opts) unless opts.empty?
1142
+ _buf = ''
1143
+ _buf
1144
+ end
1145
+ end
1146
+
1147
+ def inline_quoted(node, opts = {})
1148
+ node.extend(Helpers)
1149
+ node.instance_eval do
1150
+ converter.set_local_variables(binding, opts) unless opts.empty?
1151
+ _buf = ''
1152
+ unless @id.nil?
1153
+ _buf << ("<a".freeze)
1154
+ _slim_codeattributes1 = @id
1155
+ if _slim_codeattributes1
1156
+ if _slim_codeattributes1 == true
1157
+ _buf << (" id".freeze)
1158
+ else
1159
+ _buf << (" id=\"".freeze)
1160
+ _buf << ((_slim_codeattributes1).to_s)
1161
+ _buf << ("\"".freeze)
1162
+ end
1163
+ end
1164
+ _buf << ("></a>".freeze)
1165
+ end
1166
+ case @type
1167
+ when :emphasis
1168
+ _buf << ("<em".freeze)
1169
+ _temple_html_attributeremover1 = ''
1170
+ _slim_codeattributes2 = role
1171
+ if Array === _slim_codeattributes2
1172
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
1173
+ _slim_codeattributes2.map!(&:to_s)
1174
+ _slim_codeattributes2.reject!(&:empty?)
1175
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
1176
+ else
1177
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
1178
+ end
1179
+ _temple_html_attributeremover1
1180
+ if !_temple_html_attributeremover1.empty?
1181
+ _buf << (" class=\"".freeze)
1182
+ _buf << ((_temple_html_attributeremover1).to_s)
1183
+ _buf << ("\"".freeze)
1184
+ end
1185
+ _buf << (">".freeze)
1186
+ _buf << ((@text).to_s)
1187
+ _buf << ("</em>".freeze)
1188
+ when :strong
1189
+ _buf << ("<strong".freeze)
1190
+ _temple_html_attributeremover2 = ''
1191
+ _slim_codeattributes3 = role
1192
+ if Array === _slim_codeattributes3
1193
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
1194
+ _slim_codeattributes3.map!(&:to_s)
1195
+ _slim_codeattributes3.reject!(&:empty?)
1196
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
1197
+ else
1198
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
1199
+ end
1200
+ _temple_html_attributeremover2
1201
+ if !_temple_html_attributeremover2.empty?
1202
+ _buf << (" class=\"".freeze)
1203
+ _buf << ((_temple_html_attributeremover2).to_s)
1204
+ _buf << ("\"".freeze)
1205
+ end
1206
+ _buf << (">".freeze)
1207
+ _buf << ((@text).to_s)
1208
+ _buf << ("</strong>".freeze)
1209
+ when :monospaced
1210
+ _buf << ("<code".freeze)
1211
+ _temple_html_attributeremover3 = ''
1212
+ _slim_codeattributes4 = role
1213
+ if Array === _slim_codeattributes4
1214
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
1215
+ _slim_codeattributes4.map!(&:to_s)
1216
+ _slim_codeattributes4.reject!(&:empty?)
1217
+ _temple_html_attributeremover3 << ((_slim_codeattributes4.join(" ")).to_s)
1218
+ else
1219
+ _temple_html_attributeremover3 << ((_slim_codeattributes4).to_s)
1220
+ end
1221
+ _temple_html_attributeremover3
1222
+ if !_temple_html_attributeremover3.empty?
1223
+ _buf << (" class=\"".freeze)
1224
+ _buf << ((_temple_html_attributeremover3).to_s)
1225
+ _buf << ("\"".freeze)
1226
+ end
1227
+ _buf << (">".freeze)
1228
+ _buf << ((@text).to_s)
1229
+ _buf << ("</code>".freeze)
1230
+ when :superscript
1231
+ _buf << ("<sup".freeze)
1232
+ _temple_html_attributeremover4 = ''
1233
+ _slim_codeattributes5 = role
1234
+ if Array === _slim_codeattributes5
1235
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
1236
+ _slim_codeattributes5.map!(&:to_s)
1237
+ _slim_codeattributes5.reject!(&:empty?)
1238
+ _temple_html_attributeremover4 << ((_slim_codeattributes5.join(" ")).to_s)
1239
+ else
1240
+ _temple_html_attributeremover4 << ((_slim_codeattributes5).to_s)
1241
+ end
1242
+ _temple_html_attributeremover4
1243
+ if !_temple_html_attributeremover4.empty?
1244
+ _buf << (" class=\"".freeze)
1245
+ _buf << ((_temple_html_attributeremover4).to_s)
1246
+ _buf << ("\"".freeze)
1247
+ end
1248
+ _buf << (">".freeze)
1249
+ _buf << ((@text).to_s)
1250
+ _buf << ("</sup>".freeze)
1251
+ when :subscript
1252
+ _buf << ("<sub".freeze)
1253
+ _temple_html_attributeremover5 = ''
1254
+ _slim_codeattributes6 = role
1255
+ if Array === _slim_codeattributes6
1256
+ _slim_codeattributes6 = _slim_codeattributes6.flatten
1257
+ _slim_codeattributes6.map!(&:to_s)
1258
+ _slim_codeattributes6.reject!(&:empty?)
1259
+ _temple_html_attributeremover5 << ((_slim_codeattributes6.join(" ")).to_s)
1260
+ else
1261
+ _temple_html_attributeremover5 << ((_slim_codeattributes6).to_s)
1262
+ end
1263
+ _temple_html_attributeremover5
1264
+ if !_temple_html_attributeremover5.empty?
1265
+ _buf << (" class=\"".freeze)
1266
+ _buf << ((_temple_html_attributeremover5).to_s)
1267
+ _buf << ("\"".freeze)
1268
+ end
1269
+ _buf << (">".freeze)
1270
+ _buf << ((@text).to_s)
1271
+ _buf << ("</sub>".freeze)
1272
+ when :double
1273
+ _buf << ((role? ? %(<span class="#{role}">&#8220;#{@text}&#8221;</span>) : %(&#8220;#{@text}&#8221;)).to_s)
1274
+ when :single
1275
+ _buf << ((role? ? %(<span class="#{role}">&#8216;#{@text}&#8217;</span>) : %(&#8216;#{@text}&#8217;)).to_s)
1276
+ when :asciimath, :latexmath
1277
+ open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]
1278
+ _buf << ((open).to_s)
1279
+ _buf << ((@text).to_s)
1280
+ _buf << ((close).to_s)
1281
+ else
1282
+ _buf << ((role? ? %(<span class="#{role}">#{@text}</span>) : @text).to_s)
1283
+ end
1284
+ _buf
1285
+ end
1286
+ end
1287
+
1288
+ def olist(node, opts = {})
1289
+ node.extend(Helpers)
1290
+ node.instance_eval do
1291
+ converter.set_local_variables(binding, opts) unless opts.empty?
1292
+ _buf = ''
1293
+ _buf << ("<div".freeze)
1294
+ _temple_html_attributeremover1 = ''
1295
+ _temple_html_attributemerger1 = []
1296
+ _temple_html_attributemerger1[0] = "olist"
1297
+ _temple_html_attributemerger1[1] = ''
1298
+ _slim_codeattributes1 = [@style,role]
1299
+ if Array === _slim_codeattributes1
1300
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
1301
+ _slim_codeattributes1.map!(&:to_s)
1302
+ _slim_codeattributes1.reject!(&:empty?)
1303
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
1304
+ else
1305
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
1306
+ end
1307
+ _temple_html_attributemerger1[1]
1308
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
1309
+ _temple_html_attributeremover1
1310
+ if !_temple_html_attributeremover1.empty?
1311
+ _buf << (" class=\"".freeze)
1312
+ _buf << ((_temple_html_attributeremover1).to_s)
1313
+ _buf << ("\"".freeze)
1314
+ end
1315
+ _slim_codeattributes2 = @id
1316
+ if _slim_codeattributes2
1317
+ if _slim_codeattributes2 == true
1318
+ _buf << (" id".freeze)
1319
+ else
1320
+ _buf << (" id=\"".freeze)
1321
+ _buf << ((_slim_codeattributes2).to_s)
1322
+ _buf << ("\"".freeze)
1323
+ end
1324
+ end
1325
+ _buf << (">".freeze)
1326
+ if title?
1327
+ _buf << ("<div class=\"title\">".freeze)
1328
+ _buf << ((title).to_s)
1329
+ _buf << ("</div>".freeze)
1330
+ end
1331
+ _buf << ("<ol".freeze)
1332
+ _temple_html_attributeremover2 = ''
1333
+ _slim_codeattributes3 = @style
1334
+ if Array === _slim_codeattributes3
1335
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
1336
+ _slim_codeattributes3.map!(&:to_s)
1337
+ _slim_codeattributes3.reject!(&:empty?)
1338
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
1339
+ else
1340
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
1341
+ end
1342
+ _temple_html_attributeremover2
1343
+ if !_temple_html_attributeremover2.empty?
1344
+ _buf << (" class=\"".freeze)
1345
+ _buf << ((_temple_html_attributeremover2).to_s)
1346
+ _buf << ("\"".freeze)
1347
+ end
1348
+ _slim_codeattributes4 = (attr :start)
1349
+ if _slim_codeattributes4
1350
+ if _slim_codeattributes4 == true
1351
+ _buf << (" start".freeze)
1352
+ else
1353
+ _buf << (" start=\"".freeze)
1354
+ _buf << ((_slim_codeattributes4).to_s)
1355
+ _buf << ("\"".freeze)
1356
+ end
1357
+ end
1358
+ _slim_codeattributes5 = list_marker_keyword
1359
+ if _slim_codeattributes5
1360
+ if _slim_codeattributes5 == true
1361
+ _buf << (" type".freeze)
1362
+ else
1363
+ _buf << (" type=\"".freeze)
1364
+ _buf << ((_slim_codeattributes5).to_s)
1365
+ _buf << ("\"".freeze)
1366
+ end
1367
+ end
1368
+ _buf << (">".freeze)
1369
+ items.each do |item|
1370
+ _buf << ("<li".freeze)
1371
+ _temple_html_attributeremover3 = ''
1372
+ _slim_codeattributes6 = ('fragment' if (option? :step) or (has_role? 'step'))
1373
+ if Array === _slim_codeattributes6
1374
+ _slim_codeattributes6 = _slim_codeattributes6.flatten
1375
+ _slim_codeattributes6.map!(&:to_s)
1376
+ _slim_codeattributes6.reject!(&:empty?)
1377
+ _temple_html_attributeremover3 << ((_slim_codeattributes6.join(" ")).to_s)
1378
+ else
1379
+ _temple_html_attributeremover3 << ((_slim_codeattributes6).to_s)
1380
+ end
1381
+ _temple_html_attributeremover3
1382
+ if !_temple_html_attributeremover3.empty?
1383
+ _buf << (" class=\"".freeze)
1384
+ _buf << ((_temple_html_attributeremover3).to_s)
1385
+ _buf << ("\"".freeze)
1386
+ end
1387
+ _buf << ("><p>".freeze)
1388
+ _buf << ((item.text).to_s)
1389
+ _buf << ("</p>".freeze)
1390
+ if item.blocks?
1391
+ _buf << ((item.content).to_s)
1392
+ end
1393
+ _buf << ("</li>".freeze)
1394
+ end
1395
+ _buf << ("</ol></div>".freeze)
1396
+ _buf
1397
+ end
1398
+ end
1399
+
1400
+ def inline_anchor(node, opts = {})
1401
+ node.extend(Helpers)
1402
+ node.instance_eval do
1403
+ converter.set_local_variables(binding, opts) unless opts.empty?
1404
+ _buf = ''
1405
+ case @type
1406
+ when :xref
1407
+ refid = (attr :refid) || @target
1408
+ _buf << ("<a".freeze)
1409
+ _slim_codeattributes1 = @target
1410
+ if _slim_codeattributes1
1411
+ if _slim_codeattributes1 == true
1412
+ _buf << (" href".freeze)
1413
+ else
1414
+ _buf << (" href=\"".freeze)
1415
+ _buf << ((_slim_codeattributes1).to_s)
1416
+ _buf << ("\"".freeze)
1417
+ end
1418
+ end
1419
+ _buf << (">".freeze)
1420
+ _buf << (((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')).to_s)
1421
+ _buf << ("</a>".freeze)
1422
+ when :ref
1423
+ _buf << ("<a".freeze)
1424
+ _slim_codeattributes2 = @target
1425
+ if _slim_codeattributes2
1426
+ if _slim_codeattributes2 == true
1427
+ _buf << (" id".freeze)
1428
+ else
1429
+ _buf << (" id=\"".freeze)
1430
+ _buf << ((_slim_codeattributes2).to_s)
1431
+ _buf << ("\"".freeze)
1432
+ end
1433
+ end
1434
+ _buf << ("></a>".freeze)
1435
+ when :bibref
1436
+ _buf << ("<a".freeze)
1437
+ _slim_codeattributes3 = @target
1438
+ if _slim_codeattributes3
1439
+ if _slim_codeattributes3 == true
1440
+ _buf << (" id".freeze)
1441
+ else
1442
+ _buf << (" id=\"".freeze)
1443
+ _buf << ((_slim_codeattributes3).to_s)
1444
+ _buf << ("\"".freeze)
1445
+ end
1446
+ end
1447
+ _buf << ("></a>[".freeze)
1448
+ _buf << ((@target).to_s)
1449
+ _buf << ("]".freeze)
1450
+ else
1451
+ _buf << ("<a".freeze)
1452
+ _slim_codeattributes4 = @target
1453
+ if _slim_codeattributes4
1454
+ if _slim_codeattributes4 == true
1455
+ _buf << (" href".freeze)
1456
+ else
1457
+ _buf << (" href=\"".freeze)
1458
+ _buf << ((_slim_codeattributes4).to_s)
1459
+ _buf << ("\"".freeze)
1460
+ end
1461
+ end
1462
+ _temple_html_attributeremover1 = ''
1463
+ _slim_codeattributes5 = role
1464
+ if Array === _slim_codeattributes5
1465
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
1466
+ _slim_codeattributes5.map!(&:to_s)
1467
+ _slim_codeattributes5.reject!(&:empty?)
1468
+ _temple_html_attributeremover1 << ((_slim_codeattributes5.join(" ")).to_s)
1469
+ else
1470
+ _temple_html_attributeremover1 << ((_slim_codeattributes5).to_s)
1471
+ end
1472
+ _temple_html_attributeremover1
1473
+ if !_temple_html_attributeremover1.empty?
1474
+ _buf << (" class=\"".freeze)
1475
+ _buf << ((_temple_html_attributeremover1).to_s)
1476
+ _buf << ("\"".freeze)
1477
+ end
1478
+ _slim_codeattributes6 = (attr :window)
1479
+ if _slim_codeattributes6
1480
+ if _slim_codeattributes6 == true
1481
+ _buf << (" target".freeze)
1482
+ else
1483
+ _buf << (" target=\"".freeze)
1484
+ _buf << ((_slim_codeattributes6).to_s)
1485
+ _buf << ("\"".freeze)
1486
+ end
1487
+ end
1488
+ _buf << (">".freeze)
1489
+ _buf << ((@text).to_s)
1490
+ _buf << ("</a>".freeze)
1491
+ end
1492
+ _buf
1493
+ end
1494
+ end
1495
+
1496
+ def document(node, opts = {})
1497
+ node.extend(Helpers)
1498
+ node.instance_eval do
1499
+ converter.set_local_variables(binding, opts) unless opts.empty?
1500
+ _buf = ''
1501
+ _buf << ("<!DOCTYPE html><html".freeze)
1502
+ _slim_codeattributes1 = (attr :lang, 'en' unless attr? :nolang)
1503
+ if _slim_codeattributes1
1504
+ if _slim_codeattributes1 == true
1505
+ _buf << (" lang".freeze)
1506
+ else
1507
+ _buf << (" lang=\"".freeze)
1508
+ _buf << ((_slim_codeattributes1).to_s)
1509
+ _buf << ("\"".freeze)
1510
+ end
1511
+ end
1512
+ _buf << ("><head><meta charset=\"utf-8\">".freeze)
1513
+ revealjsdir = (attr :revealjsdir, 'reveal.js')
1514
+ unless (asset_uri_scheme = (attr 'asset-uri-scheme', 'https')).empty?
1515
+ asset_uri_scheme = %(#{asset_uri_scheme}:)
1516
+ end
1517
+ cdn_base = %(#{asset_uri_scheme}//cdnjs.cloudflare.com/ajax/libs)
1518
+ [:description, :keywords, :author, :copyright].each do |key|
1519
+ if attr? key
1520
+ _buf << ("<meta".freeze)
1521
+ _slim_codeattributes2 = key
1522
+ if _slim_codeattributes2
1523
+ if _slim_codeattributes2 == true
1524
+ _buf << (" name".freeze)
1525
+ else
1526
+ _buf << (" name=\"".freeze)
1527
+ _buf << ((_slim_codeattributes2).to_s)
1528
+ _buf << ("\"".freeze)
1529
+ end
1530
+ end
1531
+ _slim_codeattributes3 = (attr key)
1532
+ if _slim_codeattributes3
1533
+ if _slim_codeattributes3 == true
1534
+ _buf << (" content".freeze)
1535
+ else
1536
+ _buf << (" content=\"".freeze)
1537
+ _buf << ((_slim_codeattributes3).to_s)
1538
+ _buf << ("\"".freeze)
1539
+ end
1540
+ end
1541
+ _buf << (">".freeze)
1542
+ end
1543
+ end
1544
+ _buf << ("<title>".freeze)
1545
+ _buf << (((doctitle sanitize: true, use_fallback: true)).to_s)
1546
+ _buf << ("</title><meta content=\"yes\" name=\"apple-mobile-web-app-capable\"><meta content=\"black-translucent\" name=\"apple-mobile-web-app-status-bar-style\"><meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui\" name=\"viewport\"><link href=\"".freeze)
1547
+ _buf << ((revealjsdir).to_s)
1548
+ _buf << ("/css/reveal.css\" rel=\"stylesheet\">".freeze)
1549
+ if attr? :revealjs_customtheme
1550
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1551
+ _slim_codeattributes4 = (attr :revealjs_customtheme)
1552
+ if _slim_codeattributes4
1553
+ if _slim_codeattributes4 == true
1554
+ _buf << (" href".freeze)
1555
+ else
1556
+ _buf << (" href=\"".freeze)
1557
+ _buf << ((_slim_codeattributes4).to_s)
1558
+ _buf << ("\"".freeze)
1559
+ end
1560
+ end
1561
+ _buf << (" id=\"theme\">".freeze)
1562
+ else
1563
+ _buf << ("<link rel=\"stylesheet\" href=\"".freeze)
1564
+ _buf << ((revealjsdir).to_s)
1565
+ _buf << ("/css/theme/".freeze)
1566
+ _buf << ((attr 'revealjs_theme', 'black').to_s)
1567
+ _buf << (".css\" id=\"theme\">".freeze)
1568
+ end
1569
+ if attr? :icons, 'font'
1570
+ if attr? 'iconfont-remote'
1571
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1572
+ _slim_codeattributes5 = (attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/4.3.0/css/font-awesome.min.css))
1573
+ if _slim_codeattributes5
1574
+ if _slim_codeattributes5 == true
1575
+ _buf << (" href".freeze)
1576
+ else
1577
+ _buf << (" href=\"".freeze)
1578
+ _buf << ((_slim_codeattributes5).to_s)
1579
+ _buf << ("\"".freeze)
1580
+ end
1581
+ end
1582
+ _buf << (">".freeze)
1583
+ else
1584
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1585
+ _slim_codeattributes6 = (normalize_web_path %(#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', ''), false)
1586
+ if _slim_codeattributes6
1587
+ if _slim_codeattributes6 == true
1588
+ _buf << (" href".freeze)
1589
+ else
1590
+ _buf << (" href=\"".freeze)
1591
+ _buf << ((_slim_codeattributes6).to_s)
1592
+ _buf << ("\"".freeze)
1593
+ end
1594
+ end
1595
+ _buf << (">".freeze)
1596
+ end
1597
+ end
1598
+ if attr? :stem
1599
+ eqnums_val = (attr 'eqnums', 'none')
1600
+ eqnums_val = 'AMS' if eqnums_val == ''
1601
+ eqnums_opt = %( equationNumbers: { autoNumber: "#{eqnums_val}" } )
1602
+ _buf << ("<script type=\"text/x-mathjax-config\">MathJax.Hub.Config({\ntex2jax: {\n inlineMath: [".freeze)
1603
+ _buf << ((Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath].to_s).to_s)
1604
+ _buf << ("],\n displayMath: [".freeze)
1605
+ _buf << ((Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath].to_s).to_s)
1606
+ _buf << ("],\n ignoreClass: \"nostem|nolatexmath\"\n},\nasciimath2jax: {\n delimiters: [".freeze)
1607
+ _buf << ((Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath].to_s).to_s)
1608
+ _buf << ("],\n ignoreClass: \"nostem|noasciimath\"\n},\nTeX: {".freeze)
1609
+ _buf << ((eqnums_opt).to_s)
1610
+ _buf << ("}\n});</script><script src=\"".freeze)
1611
+ _buf << ((cdn_base).to_s)
1612
+ _buf << ("/mathjax/2.4.0/MathJax.js?config=TeX-MML-AM_HTMLorMML\"></script>".freeze)
1613
+ end
1614
+ case attr 'source-highlighter'
1615
+ when 'coderay'
1616
+ if (attr 'coderay-css', 'class') == 'class'
1617
+ if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss)
1618
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1619
+ _slim_codeattributes7 = normalize_web_path('asciidoctor-coderay.css', (attr :stylesdir, ''))
1620
+ if _slim_codeattributes7
1621
+ if _slim_codeattributes7 == true
1622
+ _buf << (" href".freeze)
1623
+ else
1624
+ _buf << (" href=\"".freeze)
1625
+ _buf << ((_slim_codeattributes7).to_s)
1626
+ _buf << ("\"".freeze)
1627
+ end
1628
+ end
1629
+ _buf << (">".freeze)
1630
+ else
1631
+ _buf << ("<style>".freeze)
1632
+ _buf << ((Asciidoctor::Stylesheets.instance.coderay_stylesheet_data).to_s)
1633
+ _buf << ("</style>".freeze)
1634
+ end
1635
+ end
1636
+ when 'pygments'
1637
+ if (attr 'pygments-css', 'class') == 'class'
1638
+ if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss)
1639
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1640
+ _slim_codeattributes8 = normalize_web_path('asciidoctor-pygments.css', (attr :stylesdir, ''))
1641
+ if _slim_codeattributes8
1642
+ if _slim_codeattributes8 == true
1643
+ _buf << (" href".freeze)
1644
+ else
1645
+ _buf << (" href=\"".freeze)
1646
+ _buf << ((_slim_codeattributes8).to_s)
1647
+ _buf << ("\"".freeze)
1648
+ end
1649
+ end
1650
+ _buf << (">".freeze)
1651
+ else
1652
+ _buf << ("<style>".freeze)
1653
+ _buf << ((Asciidoctor::Stylesheets.instance.pygments_stylesheet_data(attr 'pygments-style')).to_s)
1654
+ _buf << ("</style>".freeze)
1655
+ end
1656
+ end
1657
+ end
1658
+ if attr? 'highlightjs-theme'
1659
+ _buf << ("<link".freeze)
1660
+ _slim_codeattributes9 = (attr 'highlightjs-theme')
1661
+ if _slim_codeattributes9
1662
+ if _slim_codeattributes9 == true
1663
+ _buf << (" href".freeze)
1664
+ else
1665
+ _buf << (" href=\"".freeze)
1666
+ _buf << ((_slim_codeattributes9).to_s)
1667
+ _buf << ("\"".freeze)
1668
+ end
1669
+ end
1670
+ _buf << (" rel=\"stylesheet\">".freeze)
1671
+ else
1672
+ _buf << ("<link href=\"".freeze)
1673
+ _buf << ((revealjsdir).to_s)
1674
+ _buf << ("/lib/css/zenburn.css\" rel=\"stylesheet\">".freeze)
1675
+ end
1676
+ _buf << ("<script>var link = document.createElement( 'link' );\nlink.rel = 'stylesheet';\nlink.type = 'text/css';\nlink.href = window.location.search.match( /print-pdf/gi ) ? \"".freeze)
1677
+ _buf << ((revealjsdir).to_s)
1678
+ _buf << ("/css/print/pdf.css\" : \"".freeze)
1679
+ _buf << ((revealjsdir).to_s)
1680
+ _buf << ("/css/print/paper.css\";\ndocument.getElementsByTagName( 'head' )[0].appendChild( link );</script><!--[if lt IE 9]><script src=\"".freeze)
1681
+ _buf << ((revealjsdir).to_s)
1682
+ _buf << ("/lib/js/html5shiv.js\"></script><![endif]-->".freeze)
1683
+ unless (docinfo_content = docinfo :header, '.html').empty?
1684
+ _buf << ((docinfo_content).to_s)
1685
+ end
1686
+ if attr? :customcss
1687
+ _buf << ("<link rel=\"stylesheet\"".freeze)
1688
+ _slim_codeattributes10 = ((customcss = attr :customcss).empty? ? 'asciidoctor-revealjs.css' : customcss)
1689
+ if _slim_codeattributes10
1690
+ if _slim_codeattributes10 == true
1691
+ _buf << (" href".freeze)
1692
+ else
1693
+ _buf << (" href=\"".freeze)
1694
+ _buf << ((_slim_codeattributes10).to_s)
1695
+ _buf << ("\"".freeze)
1696
+ end
1697
+ end
1698
+ _buf << (">".freeze)
1699
+ end
1700
+ _buf << ("</head><body><div class=\"reveal\"><div class=\"slides\">".freeze)
1701
+ unless notitle || !has_header?
1702
+ bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil
1703
+ bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil
1704
+ _buf << ("<section".freeze)
1705
+ _temple_html_attributeremover1 = ''
1706
+ _temple_html_attributemerger1 = []
1707
+ _temple_html_attributemerger1[0] = "title"
1708
+ _temple_html_attributemerger1[1] = ''
1709
+ _slim_codeattributes11 = role
1710
+ if Array === _slim_codeattributes11
1711
+ _slim_codeattributes11 = _slim_codeattributes11.flatten
1712
+ _slim_codeattributes11.map!(&:to_s)
1713
+ _slim_codeattributes11.reject!(&:empty?)
1714
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes11.join(" ")).to_s)
1715
+ else
1716
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes11).to_s)
1717
+ end
1718
+ _temple_html_attributemerger1[1]
1719
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
1720
+ _temple_html_attributeremover1
1721
+ if !_temple_html_attributeremover1.empty?
1722
+ _buf << (" class=\"".freeze)
1723
+ _buf << ((_temple_html_attributeremover1).to_s)
1724
+ _buf << ("\"".freeze)
1725
+ end
1726
+ _buf << (" data-state=\"title\"".freeze)
1727
+ _slim_codeattributes12 = (attr 'title-slide-transition')
1728
+ if _slim_codeattributes12
1729
+ if _slim_codeattributes12 == true
1730
+ _buf << (" data-transition".freeze)
1731
+ else
1732
+ _buf << (" data-transition=\"".freeze)
1733
+ _buf << ((_slim_codeattributes12).to_s)
1734
+ _buf << ("\"".freeze)
1735
+ end
1736
+ end
1737
+ _slim_codeattributes13 = (attr 'title-slide-transition-speed')
1738
+ if _slim_codeattributes13
1739
+ if _slim_codeattributes13 == true
1740
+ _buf << (" data-transition-speed".freeze)
1741
+ else
1742
+ _buf << (" data-transition-speed=\"".freeze)
1743
+ _buf << ((_slim_codeattributes13).to_s)
1744
+ _buf << ("\"".freeze)
1745
+ end
1746
+ end
1747
+ _slim_codeattributes14 = (attr 'title-slide-background')
1748
+ if _slim_codeattributes14
1749
+ if _slim_codeattributes14 == true
1750
+ _buf << (" data-background".freeze)
1751
+ else
1752
+ _buf << (" data-background=\"".freeze)
1753
+ _buf << ((_slim_codeattributes14).to_s)
1754
+ _buf << ("\"".freeze)
1755
+ end
1756
+ end
1757
+ _slim_codeattributes15 = (attr 'title-slide-background-size')
1758
+ if _slim_codeattributes15
1759
+ if _slim_codeattributes15 == true
1760
+ _buf << (" data-background-size".freeze)
1761
+ else
1762
+ _buf << (" data-background-size=\"".freeze)
1763
+ _buf << ((_slim_codeattributes15).to_s)
1764
+ _buf << ("\"".freeze)
1765
+ end
1766
+ end
1767
+ _slim_codeattributes16 = bg_image
1768
+ if _slim_codeattributes16
1769
+ if _slim_codeattributes16 == true
1770
+ _buf << (" data-background-image".freeze)
1771
+ else
1772
+ _buf << (" data-background-image=\"".freeze)
1773
+ _buf << ((_slim_codeattributes16).to_s)
1774
+ _buf << ("\"".freeze)
1775
+ end
1776
+ end
1777
+ _slim_codeattributes17 = bg_video
1778
+ if _slim_codeattributes17
1779
+ if _slim_codeattributes17 == true
1780
+ _buf << (" data-background-video".freeze)
1781
+ else
1782
+ _buf << (" data-background-video=\"".freeze)
1783
+ _buf << ((_slim_codeattributes17).to_s)
1784
+ _buf << ("\"".freeze)
1785
+ end
1786
+ end
1787
+ _slim_codeattributes18 = (attr 'title-slide-background-video-loop')
1788
+ if _slim_codeattributes18
1789
+ if _slim_codeattributes18 == true
1790
+ _buf << (" data-background-video-loop".freeze)
1791
+ else
1792
+ _buf << (" data-background-video-loop=\"".freeze)
1793
+ _buf << ((_slim_codeattributes18).to_s)
1794
+ _buf << ("\"".freeze)
1795
+ end
1796
+ end
1797
+ _slim_codeattributes19 = (attr 'title-slide-background-video-muted')
1798
+ if _slim_codeattributes19
1799
+ if _slim_codeattributes19 == true
1800
+ _buf << (" data-background-video-muted".freeze)
1801
+ else
1802
+ _buf << (" data-background-video-muted=\"".freeze)
1803
+ _buf << ((_slim_codeattributes19).to_s)
1804
+ _buf << ("\"".freeze)
1805
+ end
1806
+ end
1807
+ _slim_codeattributes20 = (attr 'title-slide-background-iframe')
1808
+ if _slim_codeattributes20
1809
+ if _slim_codeattributes20 == true
1810
+ _buf << (" data-background-iframe".freeze)
1811
+ else
1812
+ _buf << (" data-background-iframe=\"".freeze)
1813
+ _buf << ((_slim_codeattributes20).to_s)
1814
+ _buf << ("\"".freeze)
1815
+ end
1816
+ end
1817
+ _slim_codeattributes21 = (attr 'title-slide-background-color')
1818
+ if _slim_codeattributes21
1819
+ if _slim_codeattributes21 == true
1820
+ _buf << (" data-background-color".freeze)
1821
+ else
1822
+ _buf << (" data-background-color=\"".freeze)
1823
+ _buf << ((_slim_codeattributes21).to_s)
1824
+ _buf << ("\"".freeze)
1825
+ end
1826
+ end
1827
+ _slim_codeattributes22 = (attr 'title-slide-background-repeat')
1828
+ if _slim_codeattributes22
1829
+ if _slim_codeattributes22 == true
1830
+ _buf << (" data-background-repeat".freeze)
1831
+ else
1832
+ _buf << (" data-background-repeat=\"".freeze)
1833
+ _buf << ((_slim_codeattributes22).to_s)
1834
+ _buf << ("\"".freeze)
1835
+ end
1836
+ end
1837
+ _slim_codeattributes23 = (attr 'title-slide-background-position')
1838
+ if _slim_codeattributes23
1839
+ if _slim_codeattributes23 == true
1840
+ _buf << (" data-background-position".freeze)
1841
+ else
1842
+ _buf << (" data-background-position=\"".freeze)
1843
+ _buf << ((_slim_codeattributes23).to_s)
1844
+ _buf << ("\"".freeze)
1845
+ end
1846
+ end
1847
+ _slim_codeattributes24 = (attr 'title-slide-background-transition')
1848
+ if _slim_codeattributes24
1849
+ if _slim_codeattributes24 == true
1850
+ _buf << (" data-background-transition".freeze)
1851
+ else
1852
+ _buf << (" data-background-transition=\"".freeze)
1853
+ _buf << ((_slim_codeattributes24).to_s)
1854
+ _buf << ("\"".freeze)
1855
+ end
1856
+ end
1857
+ _buf << (">".freeze)
1858
+ if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?
1859
+ _buf << ("<h1>".freeze)
1860
+ _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s)
1861
+ _buf << ("</h1><h2>".freeze)
1862
+ _buf << ((slice_text _title_obj.subtitle, _slice).to_s)
1863
+ _buf << ("</h2>".freeze)
1864
+ else
1865
+ _buf << ("<h1>".freeze)
1866
+ _buf << ((@header.title).to_s)
1867
+ _buf << ("</h1>".freeze)
1868
+ end
1869
+ preamble = @document.find_by context: :preamble
1870
+ unless preamble.nil? or preamble.length == 0
1871
+ _buf << ("<div class=\"preamble\">".freeze)
1872
+ _buf << ((preamble.pop.content).to_s)
1873
+ _buf << ("</div>".freeze)
1874
+ end
1875
+ unless author.nil?
1876
+ _buf << ("<p class=\"author\"><small>".freeze)
1877
+ _buf << ((author).to_s)
1878
+ _buf << ("</small></p>".freeze)
1879
+ end
1880
+ _buf << ("</section>".freeze)
1881
+ end
1882
+ _buf << ((content).to_s)
1883
+ _buf << ("</div></div><script src=\"".freeze)
1884
+ _buf << ((revealjsdir).to_s)
1885
+ _buf << ("/lib/js/head.min.js\"></script><script src=\"".freeze)
1886
+ _buf << ((revealjsdir).to_s)
1887
+ _buf << ("/js/reveal.js\"></script><script>// See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options\nReveal.initialize({\n // Display controls in the bottom right corner\n controls: ".freeze)
1888
+ _buf << ((to_boolean(attr 'revealjs_controls', true)).to_s)
1889
+ _buf << (",\n // Display a presentation progress bar\n progress: ".freeze)
1890
+ _buf << ((to_boolean(attr 'revealjs_progress', true)).to_s)
1891
+ _buf << (",\n // Set a per-slide timing for speaker notes, null means none\n defaultTiming: ".freeze)
1892
+ _buf << ((attr 'revealjs_defaultTiming', 'null').to_s)
1893
+ _buf << (",\n // Display the page number of the current slide\n slideNumber: ".freeze)
1894
+ _buf << ((to_boolean(attr 'revealjs_slidenumber', false)).to_s)
1895
+ _buf << (",\n // Push each slide change to the browser history\n history: ".freeze)
1896
+ _buf << ((to_boolean(attr 'revealjs_history', false)).to_s)
1897
+ _buf << (",\n // Enable keyboard shortcuts for navigation\n keyboard: ".freeze)
1898
+ _buf << ((to_boolean(attr 'revealjs_keyboard', true)).to_s)
1899
+ _buf << (",\n // Enable the slide overview mode\n overview: ".freeze)
1900
+ _buf << ((to_boolean(attr 'revealjs_overview', true)).to_s)
1901
+ _buf << (",\n // Vertical centering of slides\n center: ".freeze)
1902
+ _buf << ((to_boolean(attr 'revealjs_center', true)).to_s)
1903
+ _buf << (",\n // Enables touch navigation on devices with touch input\n touch: ".freeze)
1904
+ _buf << ((to_boolean(attr 'revealjs_touch', true)).to_s)
1905
+ _buf << (",\n // Loop the presentation\n loop: ".freeze)
1906
+ _buf << ((to_boolean(attr 'revealjs_loop', false)).to_s)
1907
+ _buf << (",\n // Change the presentation direction to be RTL\n rtl: ".freeze)
1908
+ _buf << ((to_boolean(attr 'revealjs_rtl', false)).to_s)
1909
+ _buf << (",\n // Randomizes the order of slides each time the presentation loads\n shuffle: ".freeze)
1910
+ _buf << ((to_boolean(attr 'revealjs_shuffle', false)).to_s)
1911
+ _buf << (",\n // Turns fragments on and off globally\n fragments: ".freeze)
1912
+ _buf << ((to_boolean(attr 'revealjs_fragments', true)).to_s)
1913
+ _buf << (",\n // Flags if the presentation is running in an embedded mode,\n // i.e. contained within a limited portion of the screen\n embedded: ".freeze)
1914
+ _buf << ((to_boolean(attr 'revealjs_embedded', false)).to_s)
1915
+ _buf << (",\n // Flags if we should show a help overlay when the questionmark\n // key is pressed\n help: ".freeze)
1916
+ _buf << ((to_boolean(attr 'revealjs_help', true)).to_s)
1917
+ _buf << (",\n // Flags if speaker notes should be visible to all viewers\n showNotes: ".freeze)
1918
+ _buf << ((to_boolean(attr 'revealjs_showNotes', false)).to_s)
1919
+ _buf << (",\n // Global override for autolaying embedded media (video/audio/iframe)\n // - null: Media will only autoplay if data-autoplay is present\n // - true: All media will autoplay, regardless of individual setting\n // - false: No media will autoplay, regardless of individual setting\n autoPlayMedia: ".freeze)
1920
+ _buf << ((attr 'revealjs_autoPlayMedia', 'null').to_s)
1921
+ _buf << (",\n // Number of milliseconds between automatically proceeding to the\n // next slide, disabled when set to 0, this value can be overwritten\n // by using a data-autoslide attribute on your slides\n autoSlide: ".freeze)
1922
+ _buf << ((attr 'revealjs_autoslide', 0).to_s)
1923
+ _buf << (",\n // Stop auto-sliding after user input\n autoSlideStoppable: ".freeze)
1924
+ _buf << ((to_boolean(attr 'revealjs_autoslidestoppable', true)).to_s)
1925
+ _buf << (",\n // Enable slide navigation via mouse wheel\n mouseWheel: ".freeze)
1926
+ _buf << ((to_boolean(attr 'revealjs_mousewheel', false)).to_s)
1927
+ _buf << (",\n // Hides the address bar on mobile devices\n hideAddressBar: ".freeze)
1928
+ _buf << ((to_boolean(attr 'revealjs_hideaddressbar', true)).to_s)
1929
+ _buf << (",\n // Opens links in an iframe preview overlay\n previewLinks: ".freeze)
1930
+ _buf << ((to_boolean(attr 'revealjs_previewlinks', false)).to_s)
1931
+ _buf << (",\n // Theme (e.g., beige, black, league, night, serif, simple, sky, solarized, white)\n // NOTE setting the theme in the config no longer works in reveal.js 3.x\n //theme: Reveal.getQueryHash().theme || '".freeze)
1932
+ _buf << ((attr 'revealjs_theme', 'black').to_s)
1933
+ _buf << ("',\n // Transition style (e.g., none, fade, slide, convex, concave, zoom)\n transition: Reveal.getQueryHash().transition || '".freeze)
1934
+ _buf << ((attr 'revealjs_transition', 'slide').to_s)
1935
+ _buf << ("',\n // Transition speed (e.g., default, fast, slow)\n transitionSpeed: '".freeze)
1936
+ _buf << ((attr 'revealjs_transitionspeed', 'default').to_s)
1937
+ _buf << ("',\n // Transition style for full page slide backgrounds (e.g., none, fade, slide, convex, concave, zoom)\n backgroundTransition: '".freeze)
1938
+ _buf << ((attr 'revealjs_backgroundtransition', 'fade').to_s)
1939
+ _buf << ("',\n // Number of slides away from the current that are visible\n viewDistance: ".freeze)
1940
+ _buf << ((attr 'revealjs_viewdistance', 3).to_s)
1941
+ _buf << (",\n // Parallax background image (e.g., \"'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'\")\n parallaxBackgroundImage: '".freeze)
1942
+ _buf << ((attr 'revealjs_parallaxbackgroundimage', '').to_s)
1943
+ _buf << ("',\n // Parallax background size in CSS syntax (e.g., \"2100px 900px\")\n parallaxBackgroundSize: '".freeze)
1944
+ _buf << ((attr 'revealjs_parallaxbackgroundsize', '').to_s)
1945
+ _buf << ("',\n\n // The \"normal\" size of the presentation, aspect ratio will be preserved\n // when the presentation is scaled to fit different resolutions. Can be\n // specified using percentage units.\n width: ".freeze)
1946
+ _buf << ((attr 'revealjs_width', 960).to_s)
1947
+ _buf << (",\n height: ".freeze)
1948
+ _buf << ((attr 'revealjs_height', 700).to_s)
1949
+ _buf << (",\n\n // Factor of the display size that should remain empty around the content\n margin: ".freeze)
1950
+ _buf << ((attr 'revealjs_margin', 0.1).to_s)
1951
+ _buf << (",\n\n // Bounds for smallest/largest possible scale to apply to content\n minScale: ".freeze)
1952
+ _buf << ((attr 'revealjs_minscale', 0.2).to_s)
1953
+ _buf << (",\n maxScale: ".freeze)
1954
+ _buf << ((attr 'revealjs_maxscale', 1.5).to_s)
1955
+ _buf << (",\n\n // Optional libraries used to extend on reveal.js\n dependencies: [\n { src: '".freeze)
1956
+ _buf << ((revealjsdir).to_s)
1957
+ _buf << ("/lib/js/classList.js', condition: function() { return !document.body.classList; } },\n { src: '".freeze)
1958
+ _buf << ((revealjsdir).to_s)
1959
+ _buf << ("/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },\n { src: '".freeze)
1960
+ _buf << ((revealjsdir).to_s)
1961
+ _buf << ("/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },\n ".freeze)
1962
+ _buf << (((attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : nil).to_s)
1963
+ _buf << ("\n { src: '".freeze)
1964
+ _buf << ((revealjsdir).to_s)
1965
+ _buf << ("/plugin/zoom-js/zoom.js', async: true },\n { src: '".freeze)
1966
+ _buf << ((revealjsdir).to_s)
1967
+ _buf << ("/plugin/notes/notes.js', async: true }\n ]\n});</script>".freeze)
1968
+ unless (docinfo_content = (docinfo :footer, '.html')).empty?
1969
+ _buf << ((docinfo_content).to_s)
1970
+ end
1971
+ _buf << ("</body></html>".freeze)
1972
+ _buf
1973
+ end
1974
+ end
1975
+
1976
+ def ulist(node, opts = {})
1977
+ node.extend(Helpers)
1978
+ node.instance_eval do
1979
+ converter.set_local_variables(binding, opts) unless opts.empty?
1980
+ _buf = ''
1981
+ if (checklist = (option? :checklist) ? 'checklist' : nil)
1982
+ if option? :interactive
1983
+ marker_checked = '<input type="checkbox" data-item-complete="1" checked>'
1984
+ marker_unchecked = '<input type="checkbox" data-item-complete="0">'
1985
+ else
1986
+ if @document.attr? :icons, 'font'
1987
+ marker_checked = '<i class="icon-check"></i>'
1988
+ marker_unchecked = '<i class="icon-check-empty"></i>'
1989
+ else
1990
+ marker_checked = '<input type="checkbox" data-item-complete="1" checked disabled>'
1991
+ marker_unchecked = '<input type="checkbox" data-item-complete="0" disabled>'
1992
+ end
1993
+ end
1994
+ end
1995
+ _buf << ("<div".freeze)
1996
+ _temple_html_attributeremover1 = ''
1997
+ _temple_html_attributemerger1 = []
1998
+ _temple_html_attributemerger1[0] = "ulist"
1999
+ _temple_html_attributemerger1[1] = ''
2000
+ _slim_codeattributes1 = [checklist,@style,role]
2001
+ if Array === _slim_codeattributes1
2002
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2003
+ _slim_codeattributes1.map!(&:to_s)
2004
+ _slim_codeattributes1.reject!(&:empty?)
2005
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2006
+ else
2007
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2008
+ end
2009
+ _temple_html_attributemerger1[1]
2010
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2011
+ _temple_html_attributeremover1
2012
+ if !_temple_html_attributeremover1.empty?
2013
+ _buf << (" class=\"".freeze)
2014
+ _buf << ((_temple_html_attributeremover1).to_s)
2015
+ _buf << ("\"".freeze)
2016
+ end
2017
+ _slim_codeattributes2 = @id
2018
+ if _slim_codeattributes2
2019
+ if _slim_codeattributes2 == true
2020
+ _buf << (" id".freeze)
2021
+ else
2022
+ _buf << (" id=\"".freeze)
2023
+ _buf << ((_slim_codeattributes2).to_s)
2024
+ _buf << ("\"".freeze)
2025
+ end
2026
+ end
2027
+ _buf << (">".freeze)
2028
+ if title?
2029
+ _buf << ("<div class=\"title\">".freeze)
2030
+ _buf << ((title).to_s)
2031
+ _buf << ("</div>".freeze)
2032
+ end
2033
+ _buf << ("<ul".freeze)
2034
+ _temple_html_attributeremover2 = ''
2035
+ _slim_codeattributes3 = (checklist || @style)
2036
+ if Array === _slim_codeattributes3
2037
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
2038
+ _slim_codeattributes3.map!(&:to_s)
2039
+ _slim_codeattributes3.reject!(&:empty?)
2040
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
2041
+ else
2042
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
2043
+ end
2044
+ _temple_html_attributeremover2
2045
+ if !_temple_html_attributeremover2.empty?
2046
+ _buf << (" class=\"".freeze)
2047
+ _buf << ((_temple_html_attributeremover2).to_s)
2048
+ _buf << ("\"".freeze)
2049
+ end
2050
+ _buf << (">".freeze)
2051
+ items.each do |item|
2052
+ _buf << ("<li".freeze)
2053
+ _temple_html_attributeremover3 = ''
2054
+ _slim_codeattributes4 = ('fragment' if (option? :step) || (has_role? 'step'))
2055
+ if Array === _slim_codeattributes4
2056
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
2057
+ _slim_codeattributes4.map!(&:to_s)
2058
+ _slim_codeattributes4.reject!(&:empty?)
2059
+ _temple_html_attributeremover3 << ((_slim_codeattributes4.join(" ")).to_s)
2060
+ else
2061
+ _temple_html_attributeremover3 << ((_slim_codeattributes4).to_s)
2062
+ end
2063
+ _temple_html_attributeremover3
2064
+ if !_temple_html_attributeremover3.empty?
2065
+ _buf << (" class=\"".freeze)
2066
+ _buf << ((_temple_html_attributeremover3).to_s)
2067
+ _buf << ("\"".freeze)
2068
+ end
2069
+ _buf << ("><p>".freeze)
2070
+ if checklist && (item.attr? :checkbox)
2071
+ _buf << ((%(#{(item.attr? :checked) ? marker_checked : marker_unchecked}#{item.text})).to_s)
2072
+ else
2073
+ _buf << ((item.text).to_s)
2074
+ end
2075
+ _buf << ("</p>".freeze)
2076
+ if item.blocks?
2077
+ _buf << ((item.content).to_s)
2078
+ end
2079
+ _buf << ("</li>".freeze)
2080
+ end
2081
+ _buf << ("</ul></div>".freeze)
2082
+ _buf
2083
+ end
2084
+ end
2085
+
2086
+ def inline_menu(node, opts = {})
2087
+ node.extend(Helpers)
2088
+ node.instance_eval do
2089
+ converter.set_local_variables(binding, opts) unless opts.empty?
2090
+ _buf = ''
2091
+ menu = attr 'menu'
2092
+ menuitem = attr 'menuitem'
2093
+ if !(submenus = attr 'submenus').empty?
2094
+ _buf << ("<span class=\"menuseq\"><span class=\"menu\">".freeze)
2095
+ _buf << ((menu).to_s)
2096
+ _buf << ("</span>&#160;&#9656;&#32;".freeze)
2097
+ _buf << ((submenus.map {|submenu| %(<span class="submenu">#{submenu}</span>&#160;&#9656;&#32;) }.join).to_s)
2098
+ _buf << ("<span class=\"menuitem\">".freeze)
2099
+ _buf << ((menuitem).to_s)
2100
+ _buf << ("</span></span>".freeze)
2101
+ elsif !menuitem.nil?
2102
+ _buf << ("<span class=\"menuseq\"><span class=\"menu\">".freeze)
2103
+ _buf << ((menu).to_s)
2104
+ _buf << ("</span>&#160;&#9656;&#32;<span class=\"menuitem\">".freeze)
2105
+ _buf << ((menuitem).to_s)
2106
+ _buf << ("</span></span>".freeze)
2107
+ else
2108
+ _buf << ("<span class=\"menu\">".freeze)
2109
+ _buf << ((menu).to_s)
2110
+ _buf << ("</span>".freeze)
2111
+ end
2112
+ _buf
2113
+ end
2114
+ end
2115
+
2116
+ def sidebar(node, opts = {})
2117
+ node.extend(Helpers)
2118
+ node.instance_eval do
2119
+ converter.set_local_variables(binding, opts) unless opts.empty?
2120
+ _buf = ''
2121
+ _buf << ("<div".freeze)
2122
+ _temple_html_attributeremover1 = ''
2123
+ _temple_html_attributemerger1 = []
2124
+ _temple_html_attributemerger1[0] = "sidebarblock"
2125
+ _temple_html_attributemerger1[1] = ''
2126
+ _slim_codeattributes1 = role
2127
+ if Array === _slim_codeattributes1
2128
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2129
+ _slim_codeattributes1.map!(&:to_s)
2130
+ _slim_codeattributes1.reject!(&:empty?)
2131
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2132
+ else
2133
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2134
+ end
2135
+ _temple_html_attributemerger1[1]
2136
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2137
+ _temple_html_attributeremover1
2138
+ if !_temple_html_attributeremover1.empty?
2139
+ _buf << (" class=\"".freeze)
2140
+ _buf << ((_temple_html_attributeremover1).to_s)
2141
+ _buf << ("\"".freeze)
2142
+ end
2143
+ _slim_codeattributes2 = @id
2144
+ if _slim_codeattributes2
2145
+ if _slim_codeattributes2 == true
2146
+ _buf << (" id".freeze)
2147
+ else
2148
+ _buf << (" id=\"".freeze)
2149
+ _buf << ((_slim_codeattributes2).to_s)
2150
+ _buf << ("\"".freeze)
2151
+ end
2152
+ end
2153
+ _buf << ("><div class=\"content\">".freeze)
2154
+ if title?
2155
+ _buf << ("<div class=\"title\">".freeze)
2156
+ _buf << ((title).to_s)
2157
+ _buf << ("</div>".freeze)
2158
+ end
2159
+ _buf << ((content).to_s)
2160
+ _buf << ("</div></div>".freeze)
2161
+ _buf
2162
+ end
2163
+ end
2164
+
2165
+ def page_break(node, opts = {})
2166
+ node.extend(Helpers)
2167
+ node.instance_eval do
2168
+ converter.set_local_variables(binding, opts) unless opts.empty?
2169
+ _buf = ''
2170
+ _buf << ("<div style=\"page-break-after: always;\"></div>".freeze)
2171
+ _buf
2172
+ end
2173
+ end
2174
+
2175
+ def open(node, opts = {})
2176
+ node.extend(Helpers)
2177
+ node.instance_eval do
2178
+ converter.set_local_variables(binding, opts) unless opts.empty?
2179
+ _buf = ''
2180
+ if @style == 'abstract'
2181
+ if @parent == @document && @document.doctype == 'book'
2182
+ puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
2183
+ else
2184
+ _buf << ("<div".freeze)
2185
+ _temple_html_attributeremover1 = ''
2186
+ _temple_html_attributemerger1 = []
2187
+ _temple_html_attributemerger1[0] = "quoteblock"
2188
+ _temple_html_attributemerger1[1] = "abstract"
2189
+ _temple_html_attributemerger1[2] = ''
2190
+ _slim_codeattributes1 = role
2191
+ if Array === _slim_codeattributes1
2192
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2193
+ _slim_codeattributes1.map!(&:to_s)
2194
+ _slim_codeattributes1.reject!(&:empty?)
2195
+ _temple_html_attributemerger1[2] << ((_slim_codeattributes1.join(" ")).to_s)
2196
+ else
2197
+ _temple_html_attributemerger1[2] << ((_slim_codeattributes1).to_s)
2198
+ end
2199
+ _temple_html_attributemerger1[2]
2200
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2201
+ _temple_html_attributeremover1
2202
+ if !_temple_html_attributeremover1.empty?
2203
+ _buf << (" class=\"".freeze)
2204
+ _buf << ((_temple_html_attributeremover1).to_s)
2205
+ _buf << ("\"".freeze)
2206
+ end
2207
+ _slim_codeattributes2 = @id
2208
+ if _slim_codeattributes2
2209
+ if _slim_codeattributes2 == true
2210
+ _buf << (" id".freeze)
2211
+ else
2212
+ _buf << (" id=\"".freeze)
2213
+ _buf << ((_slim_codeattributes2).to_s)
2214
+ _buf << ("\"".freeze)
2215
+ end
2216
+ end
2217
+ _buf << (">".freeze)
2218
+ if title?
2219
+ _buf << ("<div class=\"title\">".freeze)
2220
+ _buf << ((title).to_s)
2221
+ _buf << ("</div>".freeze)
2222
+ end
2223
+ _buf << ("<blockquote>".freeze)
2224
+ _buf << ((content).to_s)
2225
+ _buf << ("</blockquote></div>".freeze)
2226
+ end
2227
+ elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book')
2228
+ puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\'s a child of a book part. Excluding block content.'
2229
+ else
2230
+ _buf << ("<div".freeze)
2231
+ _temple_html_attributeremover2 = ''
2232
+ _temple_html_attributemerger2 = []
2233
+ _temple_html_attributemerger2[0] = "openblock"
2234
+ _temple_html_attributemerger2[1] = ''
2235
+ _slim_codeattributes3 = [(@style != 'open' ? @style : nil),role]
2236
+ if Array === _slim_codeattributes3
2237
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
2238
+ _slim_codeattributes3.map!(&:to_s)
2239
+ _slim_codeattributes3.reject!(&:empty?)
2240
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes3.join(" ")).to_s)
2241
+ else
2242
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes3).to_s)
2243
+ end
2244
+ _temple_html_attributemerger2[1]
2245
+ _temple_html_attributeremover2 << ((_temple_html_attributemerger2.reject(&:empty?).join(" ")).to_s)
2246
+ _temple_html_attributeremover2
2247
+ if !_temple_html_attributeremover2.empty?
2248
+ _buf << (" class=\"".freeze)
2249
+ _buf << ((_temple_html_attributeremover2).to_s)
2250
+ _buf << ("\"".freeze)
2251
+ end
2252
+ _slim_codeattributes4 = @id
2253
+ if _slim_codeattributes4
2254
+ if _slim_codeattributes4 == true
2255
+ _buf << (" id".freeze)
2256
+ else
2257
+ _buf << (" id=\"".freeze)
2258
+ _buf << ((_slim_codeattributes4).to_s)
2259
+ _buf << ("\"".freeze)
2260
+ end
2261
+ end
2262
+ _buf << (">".freeze)
2263
+ if title?
2264
+ _buf << ("<div class=\"title\">".freeze)
2265
+ _buf << ((title).to_s)
2266
+ _buf << ("</div>".freeze)
2267
+ end
2268
+ _buf << ("<div class=\"content\">".freeze)
2269
+ _buf << ((content).to_s)
2270
+ _buf << ("</div></div>".freeze)
2271
+ end
2272
+ _buf
2273
+ end
2274
+ end
2275
+
2276
+ def audio(node, opts = {})
2277
+ node.extend(Helpers)
2278
+ node.instance_eval do
2279
+ converter.set_local_variables(binding, opts) unless opts.empty?
2280
+ _buf = ''
2281
+ _buf << ("<div".freeze)
2282
+ _temple_html_attributeremover1 = ''
2283
+ _temple_html_attributemerger1 = []
2284
+ _temple_html_attributemerger1[0] = "audioblock"
2285
+ _temple_html_attributemerger1[1] = ''
2286
+ _slim_codeattributes1 = [@style,role]
2287
+ if Array === _slim_codeattributes1
2288
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2289
+ _slim_codeattributes1.map!(&:to_s)
2290
+ _slim_codeattributes1.reject!(&:empty?)
2291
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2292
+ else
2293
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2294
+ end
2295
+ _temple_html_attributemerger1[1]
2296
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2297
+ _temple_html_attributeremover1
2298
+ if !_temple_html_attributeremover1.empty?
2299
+ _buf << (" class=\"".freeze)
2300
+ _buf << ((_temple_html_attributeremover1).to_s)
2301
+ _buf << ("\"".freeze)
2302
+ end
2303
+ _slim_codeattributes2 = @id
2304
+ if _slim_codeattributes2
2305
+ if _slim_codeattributes2 == true
2306
+ _buf << (" id".freeze)
2307
+ else
2308
+ _buf << (" id=\"".freeze)
2309
+ _buf << ((_slim_codeattributes2).to_s)
2310
+ _buf << ("\"".freeze)
2311
+ end
2312
+ end
2313
+ _buf << (">".freeze)
2314
+ if title?
2315
+ _buf << ("<div class=\"title\">".freeze)
2316
+ _buf << ((captioned_title).to_s)
2317
+ _buf << ("</div>".freeze)
2318
+ end
2319
+ _buf << ("<div class=\"content\"><audio".freeze)
2320
+ _slim_codeattributes3 = media_uri(attr :target)
2321
+ if _slim_codeattributes3
2322
+ if _slim_codeattributes3 == true
2323
+ _buf << (" src".freeze)
2324
+ else
2325
+ _buf << (" src=\"".freeze)
2326
+ _buf << ((_slim_codeattributes3).to_s)
2327
+ _buf << ("\"".freeze)
2328
+ end
2329
+ end
2330
+ _slim_codeattributes4 = (option? 'autoplay')
2331
+ if _slim_codeattributes4
2332
+ if _slim_codeattributes4 == true
2333
+ _buf << (" autoplay".freeze)
2334
+ else
2335
+ _buf << (" autoplay=\"".freeze)
2336
+ _buf << ((_slim_codeattributes4).to_s)
2337
+ _buf << ("\"".freeze)
2338
+ end
2339
+ end
2340
+ _slim_codeattributes5 = !(option? 'nocontrols')
2341
+ if _slim_codeattributes5
2342
+ if _slim_codeattributes5 == true
2343
+ _buf << (" controls".freeze)
2344
+ else
2345
+ _buf << (" controls=\"".freeze)
2346
+ _buf << ((_slim_codeattributes5).to_s)
2347
+ _buf << ("\"".freeze)
2348
+ end
2349
+ end
2350
+ _slim_codeattributes6 = (option? 'loop')
2351
+ if _slim_codeattributes6
2352
+ if _slim_codeattributes6 == true
2353
+ _buf << (" loop".freeze)
2354
+ else
2355
+ _buf << (" loop=\"".freeze)
2356
+ _buf << ((_slim_codeattributes6).to_s)
2357
+ _buf << ("\"".freeze)
2358
+ end
2359
+ end
2360
+ _buf << (">Your browser does not support the audio tag.</audio></div></div>".freeze)
2361
+ _buf
2362
+ end
2363
+ end
2364
+
2365
+ def listing(node, opts = {})
2366
+ node.extend(Helpers)
2367
+ node.instance_eval do
2368
+ converter.set_local_variables(binding, opts) unless opts.empty?
2369
+ _buf = ''
2370
+ _buf << ("<div".freeze)
2371
+ _temple_html_attributeremover1 = ''
2372
+ _temple_html_attributemerger1 = []
2373
+ _temple_html_attributemerger1[0] = "listingblock"
2374
+ _temple_html_attributemerger1[1] = ''
2375
+ _slim_codeattributes1 = role
2376
+ if Array === _slim_codeattributes1
2377
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2378
+ _slim_codeattributes1.map!(&:to_s)
2379
+ _slim_codeattributes1.reject!(&:empty?)
2380
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2381
+ else
2382
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2383
+ end
2384
+ _temple_html_attributemerger1[1]
2385
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2386
+ _temple_html_attributeremover1
2387
+ if !_temple_html_attributeremover1.empty?
2388
+ _buf << (" class=\"".freeze)
2389
+ _buf << ((_temple_html_attributeremover1).to_s)
2390
+ _buf << ("\"".freeze)
2391
+ end
2392
+ _slim_codeattributes2 = @id
2393
+ if _slim_codeattributes2
2394
+ if _slim_codeattributes2 == true
2395
+ _buf << (" id".freeze)
2396
+ else
2397
+ _buf << (" id=\"".freeze)
2398
+ _buf << ((_slim_codeattributes2).to_s)
2399
+ _buf << ("\"".freeze)
2400
+ end
2401
+ end
2402
+ _buf << (">".freeze)
2403
+ if title?
2404
+ _buf << ("<div class=\"title\">".freeze)
2405
+ _buf << ((captioned_title).to_s)
2406
+ _buf << ("</div>".freeze)
2407
+ end
2408
+ _buf << ("<div class=\"content\">".freeze)
2409
+ nowrap = !(@document.attr? :prewrap) || (option? 'nowrap')
2410
+ if @style == 'source' || (@style == 'listing' && attributes[1] != 'listing')
2411
+ language = attr :language
2412
+ code_class = language ? [language, "language-#{language}"] : nil
2413
+ pre_class = ['highlight']
2414
+ pre_lang = nil
2415
+ code_noescape = false
2416
+ case attr 'source-highlighter'
2417
+ when 'coderay'
2418
+ pre_class = ['CodeRay']
2419
+ when 'pygments'
2420
+ pre_class = ['pygments','highlight']
2421
+ when 'prettify'
2422
+ pre_class = ['prettyprint']
2423
+ pre_class << 'linenums' if attr? :linenums
2424
+ pre_class << language if language
2425
+ pre_class << "language-#{language}" if language
2426
+ code_class = nil
2427
+ when 'html-pipeline'
2428
+ pre_lang = language
2429
+ pre_class = code_class = nil
2430
+ nowrap = false
2431
+ when 'highlightjs', 'highlight.js'
2432
+ code_noescape=true
2433
+ end
2434
+ pre_class << 'nowrap' if nowrap
2435
+ _buf << ("<pre".freeze)
2436
+ _temple_html_attributeremover2 = ''
2437
+ _slim_codeattributes3 = pre_class
2438
+ if Array === _slim_codeattributes3
2439
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
2440
+ _slim_codeattributes3.map!(&:to_s)
2441
+ _slim_codeattributes3.reject!(&:empty?)
2442
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
2443
+ else
2444
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
2445
+ end
2446
+ _temple_html_attributeremover2
2447
+ if !_temple_html_attributeremover2.empty?
2448
+ _buf << (" class=\"".freeze)
2449
+ _buf << ((_temple_html_attributeremover2).to_s)
2450
+ _buf << ("\"".freeze)
2451
+ end
2452
+ _slim_codeattributes4 = pre_lang
2453
+ if _slim_codeattributes4
2454
+ if _slim_codeattributes4 == true
2455
+ _buf << (" lang".freeze)
2456
+ else
2457
+ _buf << (" lang=\"".freeze)
2458
+ _buf << ((_slim_codeattributes4).to_s)
2459
+ _buf << ("\"".freeze)
2460
+ end
2461
+ end
2462
+ _buf << ("><code".freeze)
2463
+ _slim_codeattributes5 = code_noescape
2464
+ if _slim_codeattributes5
2465
+ if _slim_codeattributes5 == true
2466
+ _buf << (" data-noescape".freeze)
2467
+ else
2468
+ _buf << (" data-noescape=\"".freeze)
2469
+ _buf << ((_slim_codeattributes5).to_s)
2470
+ _buf << ("\"".freeze)
2471
+ end
2472
+ end
2473
+ _temple_html_attributeremover3 = ''
2474
+ _slim_codeattributes6 = code_class
2475
+ if Array === _slim_codeattributes6
2476
+ _slim_codeattributes6 = _slim_codeattributes6.flatten
2477
+ _slim_codeattributes6.map!(&:to_s)
2478
+ _slim_codeattributes6.reject!(&:empty?)
2479
+ _temple_html_attributeremover3 << ((_slim_codeattributes6.join(" ")).to_s)
2480
+ else
2481
+ _temple_html_attributeremover3 << ((_slim_codeattributes6).to_s)
2482
+ end
2483
+ _temple_html_attributeremover3
2484
+ if !_temple_html_attributeremover3.empty?
2485
+ _buf << (" class=\"".freeze)
2486
+ _buf << ((_temple_html_attributeremover3).to_s)
2487
+ _buf << ("\"".freeze)
2488
+ end
2489
+ _buf << (">".freeze)
2490
+ _buf << ((content).to_s)
2491
+ _buf << ("</code></pre>".freeze)
2492
+ else
2493
+ _buf << ("<pre".freeze)
2494
+ _temple_html_attributeremover4 = ''
2495
+ _slim_codeattributes7 = (nowrap ? 'nowrap' : nil)
2496
+ if Array === _slim_codeattributes7
2497
+ _slim_codeattributes7 = _slim_codeattributes7.flatten
2498
+ _slim_codeattributes7.map!(&:to_s)
2499
+ _slim_codeattributes7.reject!(&:empty?)
2500
+ _temple_html_attributeremover4 << ((_slim_codeattributes7.join(" ")).to_s)
2501
+ else
2502
+ _temple_html_attributeremover4 << ((_slim_codeattributes7).to_s)
2503
+ end
2504
+ _temple_html_attributeremover4
2505
+ if !_temple_html_attributeremover4.empty?
2506
+ _buf << (" class=\"".freeze)
2507
+ _buf << ((_temple_html_attributeremover4).to_s)
2508
+ _buf << ("\"".freeze)
2509
+ end
2510
+ _buf << (">".freeze)
2511
+ _buf << ((content).to_s)
2512
+ _buf << ("</pre>".freeze)
2513
+ end
2514
+ _buf << ("</div></div>".freeze)
2515
+ _buf
2516
+ end
2517
+ end
2518
+
2519
+ def admonition(node, opts = {})
2520
+ node.extend(Helpers)
2521
+ node.instance_eval do
2522
+ converter.set_local_variables(binding, opts) unless opts.empty?
2523
+ _buf = ''
2524
+ if (has_role? 'aside') or (has_role? 'speaker')
2525
+ _buf << ("<aside class=\"notes\">".freeze)
2526
+ _buf << ((content).to_s)
2527
+ _buf << ("</aside>".freeze)
2528
+ else
2529
+ _buf << ("<div".freeze)
2530
+ _temple_html_attributeremover1 = ''
2531
+ _temple_html_attributemerger1 = []
2532
+ _temple_html_attributemerger1[0] = "admonitionblock"
2533
+ _temple_html_attributemerger1[1] = ''
2534
+ _slim_codeattributes1 = [(attr :name),role]
2535
+ if Array === _slim_codeattributes1
2536
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2537
+ _slim_codeattributes1.map!(&:to_s)
2538
+ _slim_codeattributes1.reject!(&:empty?)
2539
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2540
+ else
2541
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2542
+ end
2543
+ _temple_html_attributemerger1[1]
2544
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2545
+ _temple_html_attributeremover1
2546
+ if !_temple_html_attributeremover1.empty?
2547
+ _buf << (" class=\"".freeze)
2548
+ _buf << ((_temple_html_attributeremover1).to_s)
2549
+ _buf << ("\"".freeze)
2550
+ end
2551
+ _slim_codeattributes2 = @id
2552
+ if _slim_codeattributes2
2553
+ if _slim_codeattributes2 == true
2554
+ _buf << (" id".freeze)
2555
+ else
2556
+ _buf << (" id=\"".freeze)
2557
+ _buf << ((_slim_codeattributes2).to_s)
2558
+ _buf << ("\"".freeze)
2559
+ end
2560
+ end
2561
+ _buf << ("><table><tr><td class=\"icon\">".freeze)
2562
+ if @document.attr? :icons, 'font'
2563
+ icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning']
2564
+ _buf << ("<i".freeze)
2565
+ _temple_html_attributeremover2 = ''
2566
+ _slim_codeattributes3 = %(fa fa-#{icon_mapping[attr :name]})
2567
+ if Array === _slim_codeattributes3
2568
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
2569
+ _slim_codeattributes3.map!(&:to_s)
2570
+ _slim_codeattributes3.reject!(&:empty?)
2571
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
2572
+ else
2573
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
2574
+ end
2575
+ _temple_html_attributeremover2
2576
+ if !_temple_html_attributeremover2.empty?
2577
+ _buf << (" class=\"".freeze)
2578
+ _buf << ((_temple_html_attributeremover2).to_s)
2579
+ _buf << ("\"".freeze)
2580
+ end
2581
+ _slim_codeattributes4 = (attr :textlabel || @caption)
2582
+ if _slim_codeattributes4
2583
+ if _slim_codeattributes4 == true
2584
+ _buf << (" title".freeze)
2585
+ else
2586
+ _buf << (" title=\"".freeze)
2587
+ _buf << ((_slim_codeattributes4).to_s)
2588
+ _buf << ("\"".freeze)
2589
+ end
2590
+ end
2591
+ _buf << ("></i>".freeze)
2592
+ elsif @document.attr? :icons
2593
+ _buf << ("<img".freeze)
2594
+ _slim_codeattributes5 = icon_uri(attr :name)
2595
+ if _slim_codeattributes5
2596
+ if _slim_codeattributes5 == true
2597
+ _buf << (" src".freeze)
2598
+ else
2599
+ _buf << (" src=\"".freeze)
2600
+ _buf << ((_slim_codeattributes5).to_s)
2601
+ _buf << ("\"".freeze)
2602
+ end
2603
+ end
2604
+ _slim_codeattributes6 = @caption
2605
+ if _slim_codeattributes6
2606
+ if _slim_codeattributes6 == true
2607
+ _buf << (" alt".freeze)
2608
+ else
2609
+ _buf << (" alt=\"".freeze)
2610
+ _buf << ((_slim_codeattributes6).to_s)
2611
+ _buf << ("\"".freeze)
2612
+ end
2613
+ end
2614
+ _buf << (">".freeze)
2615
+ else
2616
+ _buf << ("<div class=\"title\">".freeze)
2617
+ _buf << (((attr :textlabel) || @caption).to_s)
2618
+ _buf << ("</div>".freeze)
2619
+ end
2620
+ _buf << ("</td><td class=\"content\">".freeze)
2621
+ if title?
2622
+ _buf << ("<div class=\"title\">".freeze)
2623
+ _buf << ((title).to_s)
2624
+ _buf << ("</div>".freeze)
2625
+ end
2626
+ _buf << ((content).to_s)
2627
+ _buf << ("</td></tr></table></div>".freeze)
2628
+ end
2629
+ _buf
2630
+ end
2631
+ end
2632
+
2633
+ def embedded(node, opts = {})
2634
+ node.extend(Helpers)
2635
+ node.instance_eval do
2636
+ converter.set_local_variables(binding, opts) unless opts.empty?
2637
+ _buf = ''
2638
+ unless notitle || !has_header?
2639
+ _buf << ("<h1".freeze)
2640
+ _slim_codeattributes1 = @id
2641
+ if _slim_codeattributes1
2642
+ if _slim_codeattributes1 == true
2643
+ _buf << (" id".freeze)
2644
+ else
2645
+ _buf << (" id=\"".freeze)
2646
+ _buf << ((_slim_codeattributes1).to_s)
2647
+ _buf << ("\"".freeze)
2648
+ end
2649
+ end
2650
+ _buf << (">".freeze)
2651
+ _buf << ((@header.title).to_s)
2652
+ _buf << ("</h1>".freeze)
2653
+ end
2654
+ _buf << ((content).to_s)
2655
+ unless !footnotes? || attr?(:nofootnotes)
2656
+ _buf << ("<div id=\"footnotes\"><hr>".freeze)
2657
+ footnotes.each do |fn|
2658
+ _buf << ("<div class=\"footnote\" id=\"_footnote_".freeze)
2659
+ _buf << ((fn.index).to_s)
2660
+ _buf << ("\"><a href=\"#_footnoteref_".freeze)
2661
+ _buf << ((fn.index).to_s)
2662
+ _buf << ("\">".freeze)
2663
+ _buf << ((fn.index).to_s)
2664
+ _buf << ("</a>. ".freeze)
2665
+ _buf << ((fn.text).to_s)
2666
+ _buf << ("</div>".freeze)
2667
+ end
2668
+ _buf << ("</div>".freeze)
2669
+ end
2670
+ _buf
2671
+ end
2672
+ end
2673
+
2674
+ def outline(node, opts = {})
2675
+ node.extend(Helpers)
2676
+ node.instance_eval do
2677
+ converter.set_local_variables(binding, opts) unless opts.empty?
2678
+ _buf = ''
2679
+ unless sections.empty?
2680
+ toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i
2681
+ slevel = section_level sections.first
2682
+ _buf << ("<ol class=\"sectlevel".freeze)
2683
+ _buf << ((slevel).to_s)
2684
+ _buf << ("\">".freeze)
2685
+ sections.each do |sec|
2686
+ _buf << ("<li><a href=\"#".freeze)
2687
+ _buf << ((sec.id).to_s)
2688
+ _buf << ("\">".freeze)
2689
+ _buf << ((section_title sec).to_s)
2690
+ _buf << ("</a>".freeze)
2691
+ if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline')
2692
+ _buf << ((child_toc).to_s)
2693
+ end
2694
+ _buf << ("</li>".freeze)
2695
+ end
2696
+ _buf << ("</ol>".freeze)
2697
+ end
2698
+ _buf
2699
+ end
2700
+ end
2701
+
2702
+ def thematic_break(node, opts = {})
2703
+ node.extend(Helpers)
2704
+ node.instance_eval do
2705
+ converter.set_local_variables(binding, opts) unless opts.empty?
2706
+ _buf = ''
2707
+ _buf << ("<hr>".freeze)
2708
+ _buf
2709
+ end
2710
+ end
2711
+
2712
+ def table(node, opts = {})
2713
+ node.extend(Helpers)
2714
+ node.instance_eval do
2715
+ converter.set_local_variables(binding, opts) unless opts.empty?
2716
+ _buf = ''
2717
+ _buf << ("<table".freeze)
2718
+ _slim_codeattributes1 = @id
2719
+ if _slim_codeattributes1
2720
+ if _slim_codeattributes1 == true
2721
+ _buf << (" id".freeze)
2722
+ else
2723
+ _buf << (" id=\"".freeze)
2724
+ _buf << ((_slim_codeattributes1).to_s)
2725
+ _buf << ("\"".freeze)
2726
+ end
2727
+ end
2728
+ _temple_html_attributeremover1 = ''
2729
+ _slim_codeattributes2 = ['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :grid, 'all'}",role]
2730
+ if Array === _slim_codeattributes2
2731
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
2732
+ _slim_codeattributes2.map!(&:to_s)
2733
+ _slim_codeattributes2.reject!(&:empty?)
2734
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
2735
+ else
2736
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
2737
+ end
2738
+ _temple_html_attributeremover1
2739
+ if !_temple_html_attributeremover1.empty?
2740
+ _buf << (" class=\"".freeze)
2741
+ _buf << ((_temple_html_attributeremover1).to_s)
2742
+ _buf << ("\"".freeze)
2743
+ end
2744
+ _slim_codeattributes3 = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'),("float:#{attr :float}" if attr? :float)].compact.join('; ')
2745
+ if _slim_codeattributes3
2746
+ if _slim_codeattributes3 == true
2747
+ _buf << (" style".freeze)
2748
+ else
2749
+ _buf << (" style=\"".freeze)
2750
+ _buf << ((_slim_codeattributes3).to_s)
2751
+ _buf << ("\"".freeze)
2752
+ end
2753
+ end
2754
+ _buf << (">".freeze)
2755
+ if title?
2756
+ _buf << ("<caption class=\"title\">".freeze)
2757
+ _buf << ((captioned_title).to_s)
2758
+ _buf << ("</caption>".freeze)
2759
+ end
2760
+ unless (attr :rowcount).zero?
2761
+ _buf << ("<colgroup>".freeze)
2762
+ if option? 'autowidth'
2763
+ @columns.each do
2764
+ _buf << ("<col>".freeze)
2765
+ end
2766
+ else
2767
+ @columns.each do |col|
2768
+ _buf << ("<col style=\"width:".freeze)
2769
+ _buf << ((col.attr :colpcwidth).to_s)
2770
+ _buf << ("%\">".freeze)
2771
+ end
2772
+ end
2773
+ _buf << ("</colgroup>".freeze)
2774
+ [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|
2775
+ _buf << ("<t".freeze)
2776
+ _buf << ((tblsec).to_s)
2777
+ _buf << (">".freeze)
2778
+ @rows[tblsec].each do |row|
2779
+ _buf << ("<tr>".freeze)
2780
+ row.each do |cell|
2781
+ if tblsec == :head
2782
+ cell_content = cell.text
2783
+ else
2784
+ case cell.style
2785
+ when :verse, :literal
2786
+ cell_content = cell.text
2787
+ else
2788
+ cell_content = cell.content
2789
+ end
2790
+ end
2791
+ _slim_controls1 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
2792
+ :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
2793
+ :colspan=>cell.colspan, :rowspan=>cell.rowspan,
2794
+ :style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do
2795
+ _slim_controls2 = ''
2796
+ if tblsec == :head
2797
+ _slim_controls2 << ((cell_content).to_s)
2798
+ else
2799
+ case cell.style
2800
+ when :asciidoc
2801
+ _slim_controls2 << ("<div>".freeze)
2802
+ _slim_controls2 << ((cell_content).to_s)
2803
+ _slim_controls2 << ("</div>".freeze)
2804
+ when :verse
2805
+ _slim_controls2 << ("<div class=\"verse\">".freeze)
2806
+ _slim_controls2 << ((cell_content).to_s)
2807
+ _slim_controls2 << ("</div>".freeze)
2808
+ when :literal
2809
+ _slim_controls2 << ("<div class=\"literal\"><pre>".freeze)
2810
+ _slim_controls2 << ((cell_content).to_s)
2811
+ _slim_controls2 << ("</pre></div>".freeze)
2812
+ when :header
2813
+ cell_content.each do |text|
2814
+ _slim_controls2 << ("<p class=\"tableblock header\">".freeze)
2815
+ _slim_controls2 << ((text).to_s)
2816
+ _slim_controls2 << ("</p>".freeze)
2817
+ end
2818
+ else
2819
+ cell_content.each do |text|
2820
+ _slim_controls2 << ("<p class=\"tableblock\">".freeze)
2821
+ _slim_controls2 << ((text).to_s)
2822
+ _slim_controls2 << ("</p>".freeze)
2823
+ end
2824
+ end
2825
+ end
2826
+ _slim_controls2
2827
+ end
2828
+ _buf << ((_slim_controls1).to_s)
2829
+ end
2830
+ _buf << ("</tr>".freeze)
2831
+ end
2832
+ end
2833
+ end
2834
+ _buf << ("</table>".freeze)
2835
+ _buf
2836
+ end
2837
+ end
2838
+
2839
+ def verse(node, opts = {})
2840
+ node.extend(Helpers)
2841
+ node.instance_eval do
2842
+ converter.set_local_variables(binding, opts) unless opts.empty?
2843
+ _buf = ''
2844
+ _buf << ("<div".freeze)
2845
+ _temple_html_attributeremover1 = ''
2846
+ _temple_html_attributemerger1 = []
2847
+ _temple_html_attributemerger1[0] = "verseblock"
2848
+ _temple_html_attributemerger1[1] = ''
2849
+ _slim_codeattributes1 = role
2850
+ if Array === _slim_codeattributes1
2851
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2852
+ _slim_codeattributes1.map!(&:to_s)
2853
+ _slim_codeattributes1.reject!(&:empty?)
2854
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2855
+ else
2856
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2857
+ end
2858
+ _temple_html_attributemerger1[1]
2859
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2860
+ _temple_html_attributeremover1
2861
+ if !_temple_html_attributeremover1.empty?
2862
+ _buf << (" class=\"".freeze)
2863
+ _buf << ((_temple_html_attributeremover1).to_s)
2864
+ _buf << ("\"".freeze)
2865
+ end
2866
+ _slim_codeattributes2 = @id
2867
+ if _slim_codeattributes2
2868
+ if _slim_codeattributes2 == true
2869
+ _buf << (" id".freeze)
2870
+ else
2871
+ _buf << (" id=\"".freeze)
2872
+ _buf << ((_slim_codeattributes2).to_s)
2873
+ _buf << ("\"".freeze)
2874
+ end
2875
+ end
2876
+ _buf << (">".freeze)
2877
+ if title?
2878
+ _buf << ("<div class=\"title\">".freeze)
2879
+ _buf << ((title).to_s)
2880
+ _buf << ("</div>".freeze)
2881
+ end
2882
+ _buf << ("<pre class=\"content\">".freeze)
2883
+ _buf << ((content).to_s)
2884
+ _buf << ("</pre>".freeze)
2885
+ attribution = (attr? :attribution) ? (attr :attribution) : nil
2886
+ citetitle = (attr? :citetitle) ? (attr :citetitle) : nil
2887
+ if attribution || citetitle
2888
+ _buf << ("<div class=\"attribution\">".freeze)
2889
+ if citetitle
2890
+ _buf << ("<cite>".freeze)
2891
+ _buf << ((citetitle).to_s)
2892
+ _buf << ("</cite>".freeze)
2893
+ end
2894
+ if attribution
2895
+ if citetitle
2896
+ _buf << ("<br>".freeze)
2897
+ end
2898
+ _buf << ("&#8212; ".freeze)
2899
+ _buf << ((attribution).to_s)
2900
+ end
2901
+ _buf << ("</div>".freeze)
2902
+ end
2903
+ _buf << ("</div>".freeze)
2904
+ _buf
2905
+ end
2906
+ end
2907
+
2908
+ def quote(node, opts = {})
2909
+ node.extend(Helpers)
2910
+ node.instance_eval do
2911
+ converter.set_local_variables(binding, opts) unless opts.empty?
2912
+ _buf = ''
2913
+ _buf << ("<div".freeze)
2914
+ _temple_html_attributeremover1 = ''
2915
+ _temple_html_attributemerger1 = []
2916
+ _temple_html_attributemerger1[0] = "quoteblock"
2917
+ _temple_html_attributemerger1[1] = ''
2918
+ _slim_codeattributes1 = role
2919
+ if Array === _slim_codeattributes1
2920
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2921
+ _slim_codeattributes1.map!(&:to_s)
2922
+ _slim_codeattributes1.reject!(&:empty?)
2923
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2924
+ else
2925
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2926
+ end
2927
+ _temple_html_attributemerger1[1]
2928
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2929
+ _temple_html_attributeremover1
2930
+ if !_temple_html_attributeremover1.empty?
2931
+ _buf << (" class=\"".freeze)
2932
+ _buf << ((_temple_html_attributeremover1).to_s)
2933
+ _buf << ("\"".freeze)
2934
+ end
2935
+ _slim_codeattributes2 = @id
2936
+ if _slim_codeattributes2
2937
+ if _slim_codeattributes2 == true
2938
+ _buf << (" id".freeze)
2939
+ else
2940
+ _buf << (" id=\"".freeze)
2941
+ _buf << ((_slim_codeattributes2).to_s)
2942
+ _buf << ("\"".freeze)
2943
+ end
2944
+ end
2945
+ _buf << (">".freeze)
2946
+ if title?
2947
+ _buf << ("<div class=\"title\">".freeze)
2948
+ _buf << ((title).to_s)
2949
+ _buf << ("</div>".freeze)
2950
+ end
2951
+ _buf << ("<blockquote>".freeze)
2952
+ _buf << ((content).to_s)
2953
+ _buf << ("</blockquote>".freeze)
2954
+ attribution = (attr? :attribution) ? (attr :attribution) : nil
2955
+ citetitle = (attr? :citetitle) ? (attr :citetitle) : nil
2956
+ if attribution || citetitle
2957
+ _buf << ("<div class=\"attribution\">".freeze)
2958
+ if citetitle
2959
+ _buf << ("<cite>".freeze)
2960
+ _buf << ((citetitle).to_s)
2961
+ _buf << ("</cite>".freeze)
2962
+ end
2963
+ if attribution
2964
+ if citetitle
2965
+ _buf << ("<br>".freeze)
2966
+ end
2967
+ _buf << ("&#8212; ".freeze)
2968
+ _buf << ((attribution).to_s)
2969
+ end
2970
+ _buf << ("</div>".freeze)
2971
+ end
2972
+ _buf << ("</div>".freeze)
2973
+ _buf
2974
+ end
2975
+ end
2976
+
2977
+ def inline_break(node, opts = {})
2978
+ node.extend(Helpers)
2979
+ node.instance_eval do
2980
+ converter.set_local_variables(binding, opts) unless opts.empty?
2981
+ _buf = ''
2982
+ _buf << ((@text).to_s)
2983
+ _buf << ("<br>".freeze)
2984
+ _buf
2985
+ end
2986
+ end
2987
+
2988
+ def ruler(node, opts = {})
2989
+ node.extend(Helpers)
2990
+ node.instance_eval do
2991
+ converter.set_local_variables(binding, opts) unless opts.empty?
2992
+ _buf = ''
2993
+ _buf << ("<hr>".freeze)
2994
+ _buf
2995
+ end
2996
+ end
2997
+
2998
+ def video(node, opts = {})
2999
+ node.extend(Helpers)
3000
+ node.instance_eval do
3001
+ converter.set_local_variables(binding, opts) unless opts.empty?
3002
+ _buf = ''
3003
+ no_stretch = ((attr? :width) || (attr? :height))
3004
+ width = (attr? :width) ? (attr :width) : "100%"
3005
+ height = (attr? :height) ? (attr :height) : "100%"
3006
+ _buf << ("<div".freeze)
3007
+ _temple_html_attributeremover1 = ''
3008
+ _temple_html_attributemerger1 = []
3009
+ _temple_html_attributemerger1[0] = "videoblock"
3010
+ _temple_html_attributemerger1[1] = ''
3011
+ _slim_codeattributes1 = [@style,role,(no_stretch ? nil : "stretch")]
3012
+ if Array === _slim_codeattributes1
3013
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
3014
+ _slim_codeattributes1.map!(&:to_s)
3015
+ _slim_codeattributes1.reject!(&:empty?)
3016
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
3017
+ else
3018
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
3019
+ end
3020
+ _temple_html_attributemerger1[1]
3021
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
3022
+ _temple_html_attributeremover1
3023
+ if !_temple_html_attributeremover1.empty?
3024
+ _buf << (" class=\"".freeze)
3025
+ _buf << ((_temple_html_attributeremover1).to_s)
3026
+ _buf << ("\"".freeze)
3027
+ end
3028
+ _slim_codeattributes2 = @id
3029
+ if _slim_codeattributes2
3030
+ if _slim_codeattributes2 == true
3031
+ _buf << (" id".freeze)
3032
+ else
3033
+ _buf << (" id=\"".freeze)
3034
+ _buf << ((_slim_codeattributes2).to_s)
3035
+ _buf << ("\"".freeze)
3036
+ end
3037
+ end
3038
+ _buf << (">".freeze)
3039
+ if title?
3040
+ _buf << ("<div class=\"title\">".freeze)
3041
+ _buf << ((captioned_title).to_s)
3042
+ _buf << ("</div>".freeze)
3043
+ end
3044
+ case attr :poster
3045
+ when 'vimeo'
3046
+ unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?
3047
+ asset_uri_scheme = %(#{asset_uri_scheme}:)
3048
+ end
3049
+ start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil
3050
+ delimiter = '?'
3051
+ loop_param = (option? 'loop') ? "#{delimiter}loop=1" : nil
3052
+ src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{start_anchor}#{loop_param})
3053
+ _buf << ("<iframe".freeze)
3054
+ _slim_codeattributes3 = (width)
3055
+ if _slim_codeattributes3
3056
+ if _slim_codeattributes3 == true
3057
+ _buf << (" width".freeze)
3058
+ else
3059
+ _buf << (" width=\"".freeze)
3060
+ _buf << ((_slim_codeattributes3).to_s)
3061
+ _buf << ("\"".freeze)
3062
+ end
3063
+ end
3064
+ _slim_codeattributes4 = (height)
3065
+ if _slim_codeattributes4
3066
+ if _slim_codeattributes4 == true
3067
+ _buf << (" height".freeze)
3068
+ else
3069
+ _buf << (" height=\"".freeze)
3070
+ _buf << ((_slim_codeattributes4).to_s)
3071
+ _buf << ("\"".freeze)
3072
+ end
3073
+ end
3074
+ _slim_codeattributes5 = src
3075
+ if _slim_codeattributes5
3076
+ if _slim_codeattributes5 == true
3077
+ _buf << (" src".freeze)
3078
+ else
3079
+ _buf << (" src=\"".freeze)
3080
+ _buf << ((_slim_codeattributes5).to_s)
3081
+ _buf << ("\"".freeze)
3082
+ end
3083
+ end
3084
+ _slim_codeattributes6 = 0
3085
+ if _slim_codeattributes6
3086
+ if _slim_codeattributes6 == true
3087
+ _buf << (" frameborder".freeze)
3088
+ else
3089
+ _buf << (" frameborder=\"".freeze)
3090
+ _buf << ((_slim_codeattributes6).to_s)
3091
+ _buf << ("\"".freeze)
3092
+ end
3093
+ end
3094
+ _buf << (" webkitAllowFullScreen mozallowfullscreen allowFullScreen".freeze)
3095
+ _slim_codeattributes7 = (option? 'autoplay')
3096
+ if _slim_codeattributes7
3097
+ if _slim_codeattributes7 == true
3098
+ _buf << (" data-autoplay".freeze)
3099
+ else
3100
+ _buf << (" data-autoplay=\"".freeze)
3101
+ _buf << ((_slim_codeattributes7).to_s)
3102
+ _buf << ("\"".freeze)
3103
+ end
3104
+ end
3105
+ _buf << ("></iframe>".freeze)
3106
+ when 'youtube'
3107
+ unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?
3108
+ asset_uri_scheme = %(#{asset_uri_scheme}:)
3109
+ end
3110
+ params = ['rel=0']
3111
+ params << "start=#{attr :start}" if attr? :start
3112
+ params << "end=#{attr :end}" if attr? :end
3113
+ params << "loop=1" if option? 'loop'
3114
+ params << "controls=0" if option? 'nocontrols'
3115
+ src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&amp;'})
3116
+ _buf << ("<iframe".freeze)
3117
+ _slim_codeattributes8 = (width)
3118
+ if _slim_codeattributes8
3119
+ if _slim_codeattributes8 == true
3120
+ _buf << (" width".freeze)
3121
+ else
3122
+ _buf << (" width=\"".freeze)
3123
+ _buf << ((_slim_codeattributes8).to_s)
3124
+ _buf << ("\"".freeze)
3125
+ end
3126
+ end
3127
+ _slim_codeattributes9 = (height)
3128
+ if _slim_codeattributes9
3129
+ if _slim_codeattributes9 == true
3130
+ _buf << (" height".freeze)
3131
+ else
3132
+ _buf << (" height=\"".freeze)
3133
+ _buf << ((_slim_codeattributes9).to_s)
3134
+ _buf << ("\"".freeze)
3135
+ end
3136
+ end
3137
+ _slim_codeattributes10 = src
3138
+ if _slim_codeattributes10
3139
+ if _slim_codeattributes10 == true
3140
+ _buf << (" src".freeze)
3141
+ else
3142
+ _buf << (" src=\"".freeze)
3143
+ _buf << ((_slim_codeattributes10).to_s)
3144
+ _buf << ("\"".freeze)
3145
+ end
3146
+ end
3147
+ _slim_codeattributes11 = 0
3148
+ if _slim_codeattributes11
3149
+ if _slim_codeattributes11 == true
3150
+ _buf << (" frameborder".freeze)
3151
+ else
3152
+ _buf << (" frameborder=\"".freeze)
3153
+ _buf << ((_slim_codeattributes11).to_s)
3154
+ _buf << ("\"".freeze)
3155
+ end
3156
+ end
3157
+ _slim_codeattributes12 = !(option? 'nofullscreen')
3158
+ if _slim_codeattributes12
3159
+ if _slim_codeattributes12 == true
3160
+ _buf << (" allowfullscreen".freeze)
3161
+ else
3162
+ _buf << (" allowfullscreen=\"".freeze)
3163
+ _buf << ((_slim_codeattributes12).to_s)
3164
+ _buf << ("\"".freeze)
3165
+ end
3166
+ end
3167
+ _slim_codeattributes13 = (option? 'autoplay')
3168
+ if _slim_codeattributes13
3169
+ if _slim_codeattributes13 == true
3170
+ _buf << (" data-autoplay".freeze)
3171
+ else
3172
+ _buf << (" data-autoplay=\"".freeze)
3173
+ _buf << ((_slim_codeattributes13).to_s)
3174
+ _buf << ("\"".freeze)
3175
+ end
3176
+ end
3177
+ _buf << ("></iframe>".freeze)
3178
+ else
3179
+ _buf << ("<video".freeze)
3180
+ _slim_codeattributes14 = media_uri(attr :target)
3181
+ if _slim_codeattributes14
3182
+ if _slim_codeattributes14 == true
3183
+ _buf << (" src".freeze)
3184
+ else
3185
+ _buf << (" src=\"".freeze)
3186
+ _buf << ((_slim_codeattributes14).to_s)
3187
+ _buf << ("\"".freeze)
3188
+ end
3189
+ end
3190
+ _slim_codeattributes15 = (width)
3191
+ if _slim_codeattributes15
3192
+ if _slim_codeattributes15 == true
3193
+ _buf << (" width".freeze)
3194
+ else
3195
+ _buf << (" width=\"".freeze)
3196
+ _buf << ((_slim_codeattributes15).to_s)
3197
+ _buf << ("\"".freeze)
3198
+ end
3199
+ end
3200
+ _slim_codeattributes16 = (height)
3201
+ if _slim_codeattributes16
3202
+ if _slim_codeattributes16 == true
3203
+ _buf << (" height".freeze)
3204
+ else
3205
+ _buf << (" height=\"".freeze)
3206
+ _buf << ((_slim_codeattributes16).to_s)
3207
+ _buf << ("\"".freeze)
3208
+ end
3209
+ end
3210
+ _slim_codeattributes17 = ((attr :poster) ? media_uri(attr :poster) : nil)
3211
+ if _slim_codeattributes17
3212
+ if _slim_codeattributes17 == true
3213
+ _buf << (" poster".freeze)
3214
+ else
3215
+ _buf << (" poster=\"".freeze)
3216
+ _buf << ((_slim_codeattributes17).to_s)
3217
+ _buf << ("\"".freeze)
3218
+ end
3219
+ end
3220
+ _slim_codeattributes18 = (option? 'autoplay')
3221
+ if _slim_codeattributes18
3222
+ if _slim_codeattributes18 == true
3223
+ _buf << (" data-autoplay".freeze)
3224
+ else
3225
+ _buf << (" data-autoplay=\"".freeze)
3226
+ _buf << ((_slim_codeattributes18).to_s)
3227
+ _buf << ("\"".freeze)
3228
+ end
3229
+ end
3230
+ _slim_codeattributes19 = !(option? 'nocontrols')
3231
+ if _slim_codeattributes19
3232
+ if _slim_codeattributes19 == true
3233
+ _buf << (" controls".freeze)
3234
+ else
3235
+ _buf << (" controls=\"".freeze)
3236
+ _buf << ((_slim_codeattributes19).to_s)
3237
+ _buf << ("\"".freeze)
3238
+ end
3239
+ end
3240
+ _slim_codeattributes20 = (option? 'loop')
3241
+ if _slim_codeattributes20
3242
+ if _slim_codeattributes20 == true
3243
+ _buf << (" loop".freeze)
3244
+ else
3245
+ _buf << (" loop=\"".freeze)
3246
+ _buf << ((_slim_codeattributes20).to_s)
3247
+ _buf << ("\"".freeze)
3248
+ end
3249
+ end
3250
+ _buf << (">Your browser does not support the video tag.</video>".freeze)
3251
+ end;_buf << ("</div>".freeze);_buf
3252
+ end
3253
+ end
3254
+
3255
+ def section(node, opts = {})
3256
+ node.extend(Helpers)
3257
+ node.instance_eval do
3258
+ converter.set_local_variables(binding, opts) unless opts.empty?
3259
+ _buf = ''
3260
+ _id = id.gsub(/[^a-zA-Z0-9\-\_\:\.]/, '').gsub(/^[^a-zA-Z]+/, '')
3261
+ titleless = (title = self.title) == '!'
3262
+ hide_title = (titleless || (option? :notitle) || (option? :conceal))
3263
+ vertical_slides = find_by(context: :section) {|section| section.level == 2 }
3264
+ data_background_image, data_background_size, data_background_repeat,
3265
+ data_background_transition = nil
3266
+ section_images = blocks.map do |block|
3267
+ if (ctx = block.context) == :image
3268
+ ['background', 'canvas'].include?(block.attributes[1]) ? block : []
3269
+ elsif ctx == :section
3270
+ []
3271
+ else
3272
+ block.find_by(context: :image) {|image| ['background', 'canvas'].include?(image.attributes[1]) } || []
3273
+ end
3274
+ end
3275
+ if (bg_image = section_images.flatten.first)
3276
+ data_background_image = image_uri(bg_image.attr 'target')
3277
+ data_background_size = bg_image.attr 'size'
3278
+ data_background_repeat = bg_image.attr 'repeat'
3279
+ data_background_transition = bg_image.attr 'transition'
3280
+ end
3281
+ if attr? 'background-image'
3282
+ data_background_image = image_uri(attr 'background-image')
3283
+ end
3284
+ if attr? 'background-color'
3285
+ data_background_color = attr 'background-color'
3286
+ end
3287
+ if @level == 1 && !vertical_slides.empty?
3288
+ _buf << ("<section><section".freeze)
3289
+ _slim_codeattributes1 = (titleless ? nil : _id)
3290
+ if _slim_codeattributes1
3291
+ if _slim_codeattributes1 == true
3292
+ _buf << (" id".freeze)
3293
+ else
3294
+ _buf << (" id=\"".freeze)
3295
+ _buf << ((_slim_codeattributes1).to_s)
3296
+ _buf << ("\"".freeze)
3297
+ end
3298
+ end
3299
+ _temple_html_attributeremover1 = ''
3300
+ _slim_codeattributes2 = roles
3301
+ if Array === _slim_codeattributes2
3302
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
3303
+ _slim_codeattributes2.map!(&:to_s)
3304
+ _slim_codeattributes2.reject!(&:empty?)
3305
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
3306
+ else
3307
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
3308
+ end
3309
+ _temple_html_attributeremover1
3310
+ if !_temple_html_attributeremover1.empty?
3311
+ _buf << (" class=\"".freeze)
3312
+ _buf << ((_temple_html_attributeremover1).to_s)
3313
+ _buf << ("\"".freeze)
3314
+ end
3315
+ _slim_codeattributes3 = (attr 'transition')
3316
+ if _slim_codeattributes3
3317
+ if _slim_codeattributes3 == true
3318
+ _buf << (" data-transition".freeze)
3319
+ else
3320
+ _buf << (" data-transition=\"".freeze)
3321
+ _buf << ((_slim_codeattributes3).to_s)
3322
+ _buf << ("\"".freeze)
3323
+ end
3324
+ end
3325
+ _slim_codeattributes4 = (attr 'transition-speed')
3326
+ if _slim_codeattributes4
3327
+ if _slim_codeattributes4 == true
3328
+ _buf << (" data-transition-speed".freeze)
3329
+ else
3330
+ _buf << (" data-transition-speed=\"".freeze)
3331
+ _buf << ((_slim_codeattributes4).to_s)
3332
+ _buf << ("\"".freeze)
3333
+ end
3334
+ end
3335
+ _slim_codeattributes5 = data_background_color
3336
+ if _slim_codeattributes5
3337
+ if _slim_codeattributes5 == true
3338
+ _buf << (" data-background-color".freeze)
3339
+ else
3340
+ _buf << (" data-background-color=\"".freeze)
3341
+ _buf << ((_slim_codeattributes5).to_s)
3342
+ _buf << ("\"".freeze)
3343
+ end
3344
+ end
3345
+ _slim_codeattributes6 = data_background_image
3346
+ if _slim_codeattributes6
3347
+ if _slim_codeattributes6 == true
3348
+ _buf << (" data-background-image".freeze)
3349
+ else
3350
+ _buf << (" data-background-image=\"".freeze)
3351
+ _buf << ((_slim_codeattributes6).to_s)
3352
+ _buf << ("\"".freeze)
3353
+ end
3354
+ end
3355
+ _slim_codeattributes7 = (data_background_size || attr('background-size'))
3356
+ if _slim_codeattributes7
3357
+ if _slim_codeattributes7 == true
3358
+ _buf << (" data-background-size".freeze)
3359
+ else
3360
+ _buf << (" data-background-size=\"".freeze)
3361
+ _buf << ((_slim_codeattributes7).to_s)
3362
+ _buf << ("\"".freeze)
3363
+ end
3364
+ end
3365
+ _slim_codeattributes8 = (data_background_repeat || attr('background-repeat'))
3366
+ if _slim_codeattributes8
3367
+ if _slim_codeattributes8 == true
3368
+ _buf << (" data-background-repeat".freeze)
3369
+ else
3370
+ _buf << (" data-background-repeat=\"".freeze)
3371
+ _buf << ((_slim_codeattributes8).to_s)
3372
+ _buf << ("\"".freeze)
3373
+ end
3374
+ end
3375
+ _slim_codeattributes9 = (data_background_transition || attr('background-transition'))
3376
+ if _slim_codeattributes9
3377
+ if _slim_codeattributes9 == true
3378
+ _buf << (" data-background-transition".freeze)
3379
+ else
3380
+ _buf << (" data-background-transition=\"".freeze)
3381
+ _buf << ((_slim_codeattributes9).to_s)
3382
+ _buf << ("\"".freeze)
3383
+ end
3384
+ end
3385
+ _slim_codeattributes10 = (attr "background-iframe")
3386
+ if _slim_codeattributes10
3387
+ if _slim_codeattributes10 == true
3388
+ _buf << (" data-background-iframe".freeze)
3389
+ else
3390
+ _buf << (" data-background-iframe=\"".freeze)
3391
+ _buf << ((_slim_codeattributes10).to_s)
3392
+ _buf << ("\"".freeze)
3393
+ end
3394
+ end
3395
+ _slim_codeattributes11 = (attr "background-video")
3396
+ if _slim_codeattributes11
3397
+ if _slim_codeattributes11 == true
3398
+ _buf << (" data-background-video".freeze)
3399
+ else
3400
+ _buf << (" data-background-video=\"".freeze)
3401
+ _buf << ((_slim_codeattributes11).to_s)
3402
+ _buf << ("\"".freeze)
3403
+ end
3404
+ end
3405
+ _slim_codeattributes12 = ((attr? 'background-video-loop') || (option? 'loop'))
3406
+ if _slim_codeattributes12
3407
+ if _slim_codeattributes12 == true
3408
+ _buf << (" data-background-video-loop".freeze)
3409
+ else
3410
+ _buf << (" data-background-video-loop=\"".freeze)
3411
+ _buf << ((_slim_codeattributes12).to_s)
3412
+ _buf << ("\"".freeze)
3413
+ end
3414
+ end
3415
+ _slim_codeattributes13 = ((attr? 'background-video-muted') || (option? 'muted'))
3416
+ if _slim_codeattributes13
3417
+ if _slim_codeattributes13 == true
3418
+ _buf << (" data-background-video-muted".freeze)
3419
+ else
3420
+ _buf << (" data-background-video-muted=\"".freeze)
3421
+ _buf << ((_slim_codeattributes13).to_s)
3422
+ _buf << ("\"".freeze)
3423
+ end
3424
+ end
3425
+ _slim_codeattributes14 = (attr 'state')
3426
+ if _slim_codeattributes14
3427
+ if _slim_codeattributes14 == true
3428
+ _buf << (" data-state".freeze)
3429
+ else
3430
+ _buf << (" data-state=\"".freeze)
3431
+ _buf << ((_slim_codeattributes14).to_s)
3432
+ _buf << ("\"".freeze)
3433
+ end
3434
+ end
3435
+ _buf << (">".freeze)
3436
+ unless hide_title
3437
+ _buf << ("<h2>".freeze)
3438
+ _buf << ((title).to_s)
3439
+ _buf << ("</h2>".freeze)
3440
+ end
3441
+ (blocks - vertical_slides).each do |block|
3442
+ _buf << ((block.convert).to_s)
3443
+ end
3444
+ _buf << ("</section>".freeze)
3445
+ vertical_slides.each do |subsection|
3446
+ _buf << ((subsection.convert).to_s)
3447
+ end
3448
+ _buf << ("</section>".freeze)
3449
+ else
3450
+ if @level >= 3
3451
+ _slim_htag_filter1 = ((@level)).to_s
3452
+ _buf << ("<h".freeze)
3453
+ _buf << ((_slim_htag_filter1).to_s)
3454
+ _buf << (">".freeze)
3455
+ _buf << ((title).to_s)
3456
+ _buf << ("</h".freeze)
3457
+ _buf << ((_slim_htag_filter1).to_s)
3458
+ _buf << (">".freeze)
3459
+ _buf << ((content.chomp).to_s)
3460
+ else
3461
+ _buf << ("<section".freeze)
3462
+ _slim_codeattributes15 = (titleless ? nil : _id)
3463
+ if _slim_codeattributes15
3464
+ if _slim_codeattributes15 == true
3465
+ _buf << (" id".freeze)
3466
+ else
3467
+ _buf << (" id=\"".freeze)
3468
+ _buf << ((_slim_codeattributes15).to_s)
3469
+ _buf << ("\"".freeze)
3470
+ end
3471
+ end
3472
+ _temple_html_attributeremover2 = ''
3473
+ _slim_codeattributes16 = roles
3474
+ if Array === _slim_codeattributes16
3475
+ _slim_codeattributes16 = _slim_codeattributes16.flatten
3476
+ _slim_codeattributes16.map!(&:to_s)
3477
+ _slim_codeattributes16.reject!(&:empty?)
3478
+ _temple_html_attributeremover2 << ((_slim_codeattributes16.join(" ")).to_s)
3479
+ else
3480
+ _temple_html_attributeremover2 << ((_slim_codeattributes16).to_s)
3481
+ end
3482
+ _temple_html_attributeremover2
3483
+ if !_temple_html_attributeremover2.empty?
3484
+ _buf << (" class=\"".freeze)
3485
+ _buf << ((_temple_html_attributeremover2).to_s)
3486
+ _buf << ("\"".freeze)
3487
+ end
3488
+ _slim_codeattributes17 = (attr 'transition')
3489
+ if _slim_codeattributes17
3490
+ if _slim_codeattributes17 == true
3491
+ _buf << (" data-transition".freeze)
3492
+ else
3493
+ _buf << (" data-transition=\"".freeze)
3494
+ _buf << ((_slim_codeattributes17).to_s)
3495
+ _buf << ("\"".freeze)
3496
+ end
3497
+ end
3498
+ _slim_codeattributes18 = (attr 'transition-speed')
3499
+ if _slim_codeattributes18
3500
+ if _slim_codeattributes18 == true
3501
+ _buf << (" data-transition-speed".freeze)
3502
+ else
3503
+ _buf << (" data-transition-speed=\"".freeze)
3504
+ _buf << ((_slim_codeattributes18).to_s)
3505
+ _buf << ("\"".freeze)
3506
+ end
3507
+ end
3508
+ _slim_codeattributes19 = data_background_color
3509
+ if _slim_codeattributes19
3510
+ if _slim_codeattributes19 == true
3511
+ _buf << (" data-background-color".freeze)
3512
+ else
3513
+ _buf << (" data-background-color=\"".freeze)
3514
+ _buf << ((_slim_codeattributes19).to_s)
3515
+ _buf << ("\"".freeze)
3516
+ end
3517
+ end
3518
+ _slim_codeattributes20 = data_background_image
3519
+ if _slim_codeattributes20
3520
+ if _slim_codeattributes20 == true
3521
+ _buf << (" data-background-image".freeze)
3522
+ else
3523
+ _buf << (" data-background-image=\"".freeze)
3524
+ _buf << ((_slim_codeattributes20).to_s)
3525
+ _buf << ("\"".freeze)
3526
+ end
3527
+ end
3528
+ _slim_codeattributes21 = (data_background_size || attr('background-size'))
3529
+ if _slim_codeattributes21
3530
+ if _slim_codeattributes21 == true
3531
+ _buf << (" data-background-size".freeze)
3532
+ else
3533
+ _buf << (" data-background-size=\"".freeze)
3534
+ _buf << ((_slim_codeattributes21).to_s)
3535
+ _buf << ("\"".freeze)
3536
+ end
3537
+ end
3538
+ _slim_codeattributes22 = (data_background_repeat || attr('background-repeat'))
3539
+ if _slim_codeattributes22
3540
+ if _slim_codeattributes22 == true
3541
+ _buf << (" data-background-repeat".freeze)
3542
+ else
3543
+ _buf << (" data-background-repeat=\"".freeze)
3544
+ _buf << ((_slim_codeattributes22).to_s)
3545
+ _buf << ("\"".freeze)
3546
+ end
3547
+ end
3548
+ _slim_codeattributes23 = (data_background_transition || attr('background-transition'))
3549
+ if _slim_codeattributes23
3550
+ if _slim_codeattributes23 == true
3551
+ _buf << (" data-background-transition".freeze)
3552
+ else
3553
+ _buf << (" data-background-transition=\"".freeze)
3554
+ _buf << ((_slim_codeattributes23).to_s)
3555
+ _buf << ("\"".freeze)
3556
+ end
3557
+ end
3558
+ _slim_codeattributes24 = (attr "background-iframe")
3559
+ if _slim_codeattributes24
3560
+ if _slim_codeattributes24 == true
3561
+ _buf << (" data-background-iframe".freeze)
3562
+ else
3563
+ _buf << (" data-background-iframe=\"".freeze)
3564
+ _buf << ((_slim_codeattributes24).to_s)
3565
+ _buf << ("\"".freeze)
3566
+ end
3567
+ end
3568
+ _slim_codeattributes25 = (attr "background-video")
3569
+ if _slim_codeattributes25
3570
+ if _slim_codeattributes25 == true
3571
+ _buf << (" data-background-video".freeze)
3572
+ else
3573
+ _buf << (" data-background-video=\"".freeze)
3574
+ _buf << ((_slim_codeattributes25).to_s)
3575
+ _buf << ("\"".freeze)
3576
+ end
3577
+ end
3578
+ _slim_codeattributes26 = ((attr? 'background-video-loop') || (option? 'loop'))
3579
+ if _slim_codeattributes26
3580
+ if _slim_codeattributes26 == true
3581
+ _buf << (" data-background-video-loop".freeze)
3582
+ else
3583
+ _buf << (" data-background-video-loop=\"".freeze)
3584
+ _buf << ((_slim_codeattributes26).to_s)
3585
+ _buf << ("\"".freeze)
3586
+ end
3587
+ end
3588
+ _slim_codeattributes27 = ((attr? 'background-video-muted') || (option? 'muted'))
3589
+ if _slim_codeattributes27
3590
+ if _slim_codeattributes27 == true
3591
+ _buf << (" data-background-video-muted".freeze)
3592
+ else
3593
+ _buf << (" data-background-video-muted=\"".freeze)
3594
+ _buf << ((_slim_codeattributes27).to_s)
3595
+ _buf << ("\"".freeze)
3596
+ end
3597
+ end
3598
+ _slim_codeattributes28 = (attr 'state')
3599
+ if _slim_codeattributes28
3600
+ if _slim_codeattributes28 == true
3601
+ _buf << (" data-state".freeze)
3602
+ else
3603
+ _buf << (" data-state=\"".freeze)
3604
+ _buf << ((_slim_codeattributes28).to_s)
3605
+ _buf << ("\"".freeze)
3606
+ end
3607
+ end
3608
+ _buf << (">".freeze)
3609
+ unless hide_title
3610
+ _buf << ("<h2>".freeze)
3611
+ _buf << ((title).to_s)
3612
+ _buf << ("</h2>".freeze)
3613
+ end
3614
+ _buf << ((content.chomp).to_s)
3615
+ _buf << ("</section>".freeze)
3616
+ end
3617
+ end
3618
+ _buf
3619
+ end
3620
+ end
3621
+
3622
+ def floating_title(node, opts = {})
3623
+ node.extend(Helpers)
3624
+ node.instance_eval do
3625
+ converter.set_local_variables(binding, opts) unless opts.empty?
3626
+ _buf = ''
3627
+ _slim_htag_filter1 = ((level + 1)).to_s
3628
+ _buf << ("<h".freeze)
3629
+ _buf << ((_slim_htag_filter1).to_s)
3630
+ _slim_codeattributes1 = id
3631
+ if _slim_codeattributes1
3632
+ if _slim_codeattributes1 == true
3633
+ _buf << (" id".freeze)
3634
+ else
3635
+ _buf << (" id=\"".freeze)
3636
+ _buf << ((_slim_codeattributes1).to_s)
3637
+ _buf << ("\"".freeze)
3638
+ end
3639
+ end
3640
+ _temple_html_attributeremover1 = ''
3641
+ _slim_codeattributes2 = [style, role]
3642
+ if Array === _slim_codeattributes2
3643
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
3644
+ _slim_codeattributes2.map!(&:to_s)
3645
+ _slim_codeattributes2.reject!(&:empty?)
3646
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
3647
+ else
3648
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
3649
+ end
3650
+ _temple_html_attributeremover1
3651
+ if !_temple_html_attributeremover1.empty?
3652
+ _buf << (" class=\"".freeze)
3653
+ _buf << ((_temple_html_attributeremover1).to_s)
3654
+ _buf << ("\"".freeze)
3655
+ end
3656
+ _buf << (">".freeze)
3657
+ _buf << ((title).to_s)
3658
+ _buf << ("</h".freeze)
3659
+ _buf << ((_slim_htag_filter1).to_s)
3660
+ _buf << (">".freeze)
3661
+ _buf
3662
+ end
3663
+ end
3664
+
3665
+ def literal(node, opts = {})
3666
+ node.extend(Helpers)
3667
+ node.instance_eval do
3668
+ converter.set_local_variables(binding, opts) unless opts.empty?
3669
+ _buf = ''
3670
+ _buf << ("<div".freeze)
3671
+ _temple_html_attributeremover1 = ''
3672
+ _temple_html_attributemerger1 = []
3673
+ _temple_html_attributemerger1[0] = "literalblock"
3674
+ _temple_html_attributemerger1[1] = ''
3675
+ _slim_codeattributes1 = role
3676
+ if Array === _slim_codeattributes1
3677
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
3678
+ _slim_codeattributes1.map!(&:to_s)
3679
+ _slim_codeattributes1.reject!(&:empty?)
3680
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
3681
+ else
3682
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
3683
+ end
3684
+ _temple_html_attributemerger1[1]
3685
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
3686
+ _temple_html_attributeremover1
3687
+ if !_temple_html_attributeremover1.empty?
3688
+ _buf << (" class=\"".freeze)
3689
+ _buf << ((_temple_html_attributeremover1).to_s)
3690
+ _buf << ("\"".freeze)
3691
+ end
3692
+ _slim_codeattributes2 = @id
3693
+ if _slim_codeattributes2
3694
+ if _slim_codeattributes2 == true
3695
+ _buf << (" id".freeze)
3696
+ else
3697
+ _buf << (" id=\"".freeze)
3698
+ _buf << ((_slim_codeattributes2).to_s)
3699
+ _buf << ("\"".freeze)
3700
+ end
3701
+ end
3702
+ _buf << (">".freeze)
3703
+ if title?
3704
+ _buf << ("<div class=\"title\">".freeze)
3705
+ _buf << ((title).to_s)
3706
+ _buf << ("</div>".freeze)
3707
+ end
3708
+ _buf << ("<div class=\"content\"><pre".freeze)
3709
+ _temple_html_attributeremover2 = ''
3710
+ _slim_codeattributes3 = (!(@document.attr? :prewrap) || (option? 'nowrap') ? 'nowrap' : nil)
3711
+ if Array === _slim_codeattributes3
3712
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
3713
+ _slim_codeattributes3.map!(&:to_s)
3714
+ _slim_codeattributes3.reject!(&:empty?)
3715
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
3716
+ else
3717
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
3718
+ end
3719
+ _temple_html_attributeremover2
3720
+ if !_temple_html_attributeremover2.empty?
3721
+ _buf << (" class=\"".freeze)
3722
+ _buf << ((_temple_html_attributeremover2).to_s)
3723
+ _buf << ("\"".freeze)
3724
+ end
3725
+ _buf << (">".freeze)
3726
+ _buf << ((content).to_s)
3727
+ _buf << ("</pre></div></div>".freeze)
3728
+ _buf
3729
+ end
3730
+ end
3731
+
3732
+ def image(node, opts = {})
3733
+ node.extend(Helpers)
3734
+ node.instance_eval do
3735
+ converter.set_local_variables(binding, opts) unless opts.empty?
3736
+ _buf = ''
3737
+ width = (attr? :width) ? (attr :width) : nil
3738
+ height = (attr? :height) ? (attr :height) : nil
3739
+ if (has_role? 'stretch') && !((attr? :width) || (attr? :height))
3740
+ height = "100%"
3741
+ end
3742
+ unless attributes[1] == 'background' || attributes[1] == 'canvas'
3743
+ _buf << ("<div".freeze)
3744
+ _temple_html_attributeremover1 = ''
3745
+ _temple_html_attributemerger1 = []
3746
+ _temple_html_attributemerger1[0] = "imageblock"
3747
+ _temple_html_attributemerger1[1] = ''
3748
+ _slim_codeattributes1 = roles
3749
+ if Array === _slim_codeattributes1
3750
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
3751
+ _slim_codeattributes1.map!(&:to_s)
3752
+ _slim_codeattributes1.reject!(&:empty?)
3753
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
3754
+ else
3755
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
3756
+ end
3757
+ _temple_html_attributemerger1[1]
3758
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
3759
+ _temple_html_attributeremover1
3760
+ if !_temple_html_attributeremover1.empty?
3761
+ _buf << (" class=\"".freeze)
3762
+ _buf << ((_temple_html_attributeremover1).to_s)
3763
+ _buf << ("\"".freeze)
3764
+ end
3765
+ _slim_codeattributes2 = @id
3766
+ if _slim_codeattributes2
3767
+ if _slim_codeattributes2 == true
3768
+ _buf << (" id".freeze)
3769
+ else
3770
+ _buf << (" id=\"".freeze)
3771
+ _buf << ((_slim_codeattributes2).to_s)
3772
+ _buf << ("\"".freeze)
3773
+ end
3774
+ end
3775
+ _slim_codeattributes3 = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ')
3776
+ if _slim_codeattributes3
3777
+ if _slim_codeattributes3 == true
3778
+ _buf << (" style".freeze)
3779
+ else
3780
+ _buf << (" style=\"".freeze)
3781
+ _buf << ((_slim_codeattributes3).to_s)
3782
+ _buf << ("\"".freeze)
3783
+ end
3784
+ end
3785
+ _buf << (">".freeze)
3786
+ if attr? :link
3787
+ _buf << ("<a class=\"image\"".freeze)
3788
+ _slim_codeattributes4 = (attr :link)
3789
+ if _slim_codeattributes4
3790
+ if _slim_codeattributes4 == true
3791
+ _buf << (" href".freeze)
3792
+ else
3793
+ _buf << (" href=\"".freeze)
3794
+ _buf << ((_slim_codeattributes4).to_s)
3795
+ _buf << ("\"".freeze)
3796
+ end
3797
+ end
3798
+ _buf << ("><img".freeze)
3799
+ _slim_codeattributes5 = image_uri(attr :target)
3800
+ if _slim_codeattributes5
3801
+ if _slim_codeattributes5 == true
3802
+ _buf << (" src".freeze)
3803
+ else
3804
+ _buf << (" src=\"".freeze)
3805
+ _buf << ((_slim_codeattributes5).to_s)
3806
+ _buf << ("\"".freeze)
3807
+ end
3808
+ end
3809
+ _slim_codeattributes6 = (attr :alt)
3810
+ if _slim_codeattributes6
3811
+ if _slim_codeattributes6 == true
3812
+ _buf << (" alt".freeze)
3813
+ else
3814
+ _buf << (" alt=\"".freeze)
3815
+ _buf << ((_slim_codeattributes6).to_s)
3816
+ _buf << ("\"".freeze)
3817
+ end
3818
+ end
3819
+ _slim_codeattributes7 = (width)
3820
+ if _slim_codeattributes7
3821
+ if _slim_codeattributes7 == true
3822
+ _buf << (" width".freeze)
3823
+ else
3824
+ _buf << (" width=\"".freeze)
3825
+ _buf << ((_slim_codeattributes7).to_s)
3826
+ _buf << ("\"".freeze)
3827
+ end
3828
+ end
3829
+ _slim_codeattributes8 = (height)
3830
+ if _slim_codeattributes8
3831
+ if _slim_codeattributes8 == true
3832
+ _buf << (" height".freeze)
3833
+ else
3834
+ _buf << (" height=\"".freeze)
3835
+ _buf << ((_slim_codeattributes8).to_s)
3836
+ _buf << ("\"".freeze)
3837
+ end
3838
+ end
3839
+ _slim_codeattributes9 = ((attr? :background) ? "background: #{attr :background}" : nil)
3840
+ if _slim_codeattributes9
3841
+ if _slim_codeattributes9 == true
3842
+ _buf << (" style".freeze)
3843
+ else
3844
+ _buf << (" style=\"".freeze)
3845
+ _buf << ((_slim_codeattributes9).to_s)
3846
+ _buf << ("\"".freeze)
3847
+ end
3848
+ end
3849
+ _buf << ("></a>".freeze)
3850
+ else
3851
+ _buf << ("<img".freeze)
3852
+ _slim_codeattributes10 = image_uri(attr :target)
3853
+ if _slim_codeattributes10
3854
+ if _slim_codeattributes10 == true
3855
+ _buf << (" src".freeze)
3856
+ else
3857
+ _buf << (" src=\"".freeze)
3858
+ _buf << ((_slim_codeattributes10).to_s)
3859
+ _buf << ("\"".freeze)
3860
+ end
3861
+ end
3862
+ _slim_codeattributes11 = (attr :alt)
3863
+ if _slim_codeattributes11
3864
+ if _slim_codeattributes11 == true
3865
+ _buf << (" alt".freeze)
3866
+ else
3867
+ _buf << (" alt=\"".freeze)
3868
+ _buf << ((_slim_codeattributes11).to_s)
3869
+ _buf << ("\"".freeze)
3870
+ end
3871
+ end
3872
+ _slim_codeattributes12 = (width)
3873
+ if _slim_codeattributes12
3874
+ if _slim_codeattributes12 == true
3875
+ _buf << (" width".freeze)
3876
+ else
3877
+ _buf << (" width=\"".freeze)
3878
+ _buf << ((_slim_codeattributes12).to_s)
3879
+ _buf << ("\"".freeze)
3880
+ end
3881
+ end
3882
+ _slim_codeattributes13 = (height)
3883
+ if _slim_codeattributes13
3884
+ if _slim_codeattributes13 == true
3885
+ _buf << (" height".freeze)
3886
+ else
3887
+ _buf << (" height=\"".freeze)
3888
+ _buf << ((_slim_codeattributes13).to_s)
3889
+ _buf << ("\"".freeze)
3890
+ end
3891
+ end
3892
+ _slim_codeattributes14 = ((attr? :background) ? "background: #{attr :background}" : nil)
3893
+ if _slim_codeattributes14
3894
+ if _slim_codeattributes14 == true
3895
+ _buf << (" style".freeze)
3896
+ else
3897
+ _buf << (" style=\"".freeze)
3898
+ _buf << ((_slim_codeattributes14).to_s)
3899
+ _buf << ("\"".freeze)
3900
+ end
3901
+ end
3902
+ _buf << (">".freeze)
3903
+ end
3904
+ _buf << ("</div>".freeze)
3905
+ if title?
3906
+ _buf << ("<div class=\"title\">".freeze)
3907
+ _buf << ((captioned_title).to_s)
3908
+ _buf << ("</div>".freeze)
3909
+ end
3910
+ end
3911
+ _buf
3912
+ end
3913
+ end
3914
+ #------------------ End of generated transformation methods ------------------#
3915
+
3916
+ def set_local_variables(binding, vars)
3917
+ vars.each do |key, val|
3918
+ binding.local_variable_set(key.to_sym, val)
3919
+ end
3920
+ end
3921
+
3922
+ end