asciidoctor-revealjs 4.0.1 → 4.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +75 -35
  3. data/Rakefile +18 -3
  4. data/asciidoctor-revealjs.gemspec +1 -1
  5. data/examples/a11y-dark.css +99 -0
  6. data/examples/autoslide.adoc +22 -0
  7. data/examples/custom-layout.adoc +10 -0
  8. data/examples/data-attributes.adoc +245 -0
  9. data/examples/font-awesome-specific-version.adoc +11 -0
  10. data/examples/font-awesome.adoc +16 -2
  11. data/examples/footnotes.adoc +46 -0
  12. data/examples/fragments.adoc +12 -0
  13. data/examples/grid-layout-3x2.adoc +50 -0
  14. data/examples/grid-layout-docinfo-revealjs.html +1 -1
  15. data/examples/grid-layout.adoc +21 -1
  16. data/examples/images/cute-cat-1.jpg +0 -0
  17. data/examples/images/cute-cat-2.jpg +0 -0
  18. data/examples/images/cute-cat-3.jpg +0 -0
  19. data/examples/images/flock-of-seagulls_daniel-simion.mp3 +0 -0
  20. data/examples/issue-grid-layout-images.adoc +25 -0
  21. data/examples/mathjax-cdn.adoc +21 -0
  22. data/examples/mathjax.adoc +20 -0
  23. data/examples/release-4.0.adoc +2 -5
  24. data/examples/release-4.1.adoc +133 -0
  25. data/examples/release-4.1.css +50 -0
  26. data/examples/revealjs-custom-theme.adoc +10 -0
  27. data/examples/steps.adoc +87 -0
  28. data/examples/text-alignments.adoc +44 -0
  29. data/examples/video.adoc +19 -6
  30. data/lib/asciidoctor-revealjs/converter.rb +754 -647
  31. data/lib/asciidoctor-revealjs/version.rb +1 -1
  32. data/templates/admonition.html.slim +1 -1
  33. data/templates/asciidoctor-compatibility.css +303 -54
  34. data/templates/audio.html.slim +1 -1
  35. data/templates/colist.html.slim +1 -1
  36. data/templates/dlist.html.slim +3 -3
  37. data/templates/document.html.slim +12 -7
  38. data/templates/example.html.slim +1 -1
  39. data/templates/helpers.rb +80 -7
  40. data/templates/image.html.slim +2 -2
  41. data/templates/inline_anchor.html.slim +5 -4
  42. data/templates/inline_button.html.slim +2 -1
  43. data/templates/inline_footnote.html.slim +11 -4
  44. data/templates/inline_image.html.slim +2 -5
  45. data/templates/inline_kbd.html.slim +3 -2
  46. data/templates/inline_menu.html.slim +4 -3
  47. data/templates/inline_quoted.html.slim +13 -21
  48. data/templates/listing.html.slim +14 -9
  49. data/templates/literal.html.slim +1 -1
  50. data/templates/olist.html.slim +2 -2
  51. data/templates/open.html.slim +3 -3
  52. data/templates/paragraph.html.slim +1 -1
  53. data/templates/quote.html.slim +1 -1
  54. data/templates/section.html.slim +18 -1
  55. data/templates/sidebar.html.slim +1 -1
  56. data/templates/stem.html.slim +1 -1
  57. data/templates/table.html.slim +3 -2
  58. data/templates/ulist.html.slim +3 -3
  59. data/templates/verse.html.slim +1 -1
  60. data/templates/video.html.slim +14 -8
  61. metadata +26 -10
  62. data/CHANGELOG.adoc +0 -546
  63. data/HACKING.adoc +0 -412
@@ -1,4 +1,4 @@
1
- .exampleblock id=@id class=role
1
+ = html_tag('div', { :id => @id, :class => ['exampleblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
2
2
  - if title?
3
3
  .title=captioned_title
4
4
  .content=content
@@ -33,11 +33,11 @@ module Slim::Helpers
33
33
  # then link::example.com[Link text, preview=false]
34
34
  # Here the template must have data-preview-link="false" not just no data-preview-link attribute
35
35
  def bool_data_attr val
36
- return false if !attr?(val)
36
+ return false unless attr?(val)
37
37
  if attr(val).downcase == 'false' || attr(val) == '0'
38
- return 'false'
38
+ 'false'
39
39
  else
40
- return true
40
+ true
41
41
  end
42
42
  end
43
43
 
@@ -72,25 +72,52 @@ module Slim::Helpers
72
72
  # @yield The block of Slim/HTML code within the tag (optional).
73
73
  # @return [String] a rendered HTML element.
74
74
  #
75
-
76
75
  def html_tag(name, attributes = {}, content = nil)
77
76
  attrs = attributes.inject([]) do |attrs, (k, v)|
78
- next attrs if !v || v.nil_or_empty?
77
+ next attrs unless v && (v == true || !v.nil_or_empty?)
79
78
  v = v.compact.join(' ') if v.is_a? Array
80
79
  attrs << (v == true ? k : %(#{k}="#{v}"))
81
80
  end
82
81
  attrs_str = attrs.empty? ? '' : ' ' + attrs.join(' ')
83
82
 
84
-
85
83
  if VOID_ELEMENTS.include? name.to_s
86
84
  %(<#{name}#{attrs_str}>)
87
85
  else
88
- content ||= yield if block_given?
86
+ content ||= (yield if block_given?)
89
87
  %(<#{name}#{attrs_str}>#{content}</#{name}>)
90
88
  end
91
89
  end
92
90
 
93
91
 
92
+ #
93
+ # Extracts data- attributes from the attributes.
94
+ # @param attributes [Hash] (default: {})
95
+ # @return [Hash] a Hash that contains only data- attributes
96
+ #
97
+ def data_attrs(attributes)
98
+ # key can be an Integer (for positional attributes)
99
+ attributes.map { |key, value| (key == 'step') ? ['data-fragment-index', value] : [key, value] }
100
+ .to_h
101
+ .select { |key, _| key.to_s.start_with?('data-') }
102
+ end
103
+
104
+
105
+ #
106
+ # Wrap an inline text in a <span> element if the node contains a role, an id or data- attributes.
107
+ # @param content [#to_s] the content; +nil+ to call the block. (default: nil).
108
+ # @return [String] the content or the content wrapped in a <span> element as string
109
+ #
110
+ def inline_text_container(content = nil)
111
+ data_attrs = data_attrs(@attributes)
112
+ classes = [role, ('fragment' if (option? :step) || (attr? 'step') || (roles.include? 'step'))].compact
113
+ if !roles.empty? || !data_attrs.empty? || !@id.nil?
114
+ html_tag('span', { :id => @id, :class => classes }.merge(data_attrs), (content || (yield if block_given?)))
115
+ else
116
+ content || (yield if block_given?)
117
+ end
118
+ end
119
+
120
+
94
121
  ##
95
122
  # Returns corrected section level.
96
123
  #
@@ -101,6 +128,52 @@ module Slim::Helpers
101
128
  @_section_level ||= (sec.level == 0 && sec.special) ? 1 : sec.level
102
129
  end
103
130
 
131
+ ##
132
+ # Display footnotes per slide
133
+ #
134
+ @@slide_footnotes = {}
135
+ @@section_footnotes = {}
136
+
137
+ def slide_footnote(footnote)
138
+ footnote_parent = footnote.parent
139
+ # footnotes declared on the section title are processed during the parsing/substitution.
140
+ # as a result, we need to store them to display them on the right slide/section
141
+ if footnote_parent.instance_of?(::Asciidoctor::Section)
142
+ footnote_parent_object_id = footnote_parent.object_id
143
+ section_footnotes = (@@section_footnotes[footnote_parent_object_id] || [])
144
+ footnote_index = section_footnotes.length + 1
145
+ attributes = footnote.attributes.merge({ 'index' => footnote_index })
146
+ inline_footnote = Asciidoctor::Inline.new(footnote_parent, footnote.context, footnote.text, :attributes => attributes)
147
+ section_footnotes << Asciidoctor::Document::Footnote.new(inline_footnote.attr(:index), inline_footnote.id, inline_footnote.text)
148
+ @@section_footnotes[footnote_parent_object_id] = section_footnotes
149
+ inline_footnote
150
+ else
151
+ parent = footnote.parent
152
+ until parent == nil || parent.instance_of?(::Asciidoctor::Section)
153
+ parent = parent.parent
154
+ end
155
+ # check if there is any footnote attached on the section title
156
+ section_footnotes = parent != nil ? @@section_footnotes[parent.object_id] || [] : []
157
+ initial_index = footnote.attr(:index)
158
+ # reset the footnote numbering to 1 on each slide
159
+ # make sure that if a footnote is used more than once it will use the same index/number
160
+ slide_index = (existing_footnote = @@slide_footnotes[initial_index]) ? existing_footnote.index : @@slide_footnotes.length + section_footnotes.length + 1
161
+ attributes = footnote.attributes.merge({ 'index' => slide_index })
162
+ inline_footnote = Asciidoctor::Inline.new(footnote_parent, footnote.context, footnote.text, :attributes => attributes)
163
+ @@slide_footnotes[initial_index] = Asciidoctor::Document::Footnote.new(inline_footnote.attr(:index), inline_footnote.id, inline_footnote.text)
164
+ inline_footnote
165
+ end
166
+ end
167
+
168
+ def clear_slide_footnotes
169
+ @@slide_footnotes = {}
170
+ end
171
+
172
+ def slide_footnotes(section)
173
+ section_object_id = section.object_id
174
+ section_footnotes = @@section_footnotes[section_object_id] || []
175
+ section_footnotes + @@slide_footnotes.values
176
+ end
104
177
 
105
178
  ##
106
179
  # Returns the captioned section's title, optionally numbered.
@@ -10,8 +10,8 @@
10
10
  - height = "100%"
11
11
 
12
12
  - unless attributes[1] == 'background' || attributes[1] == 'canvas'
13
- .imageblock(id=@id class=roles
14
- style=[("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; '))
13
+ - inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ')
14
+ = html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes)))
15
15
  - if attr? :link
16
16
  a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
17
17
  img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil)
@@ -1,12 +1,13 @@
1
1
  - case @type
2
2
  - when :xref
3
3
  - refid = (attr :refid) || @target
4
- a href=@target =(@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')
4
+ = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)))
5
+ =(@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')
5
6
  - when :ref
6
- a id=@target
7
+ = html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))
7
8
  - when :bibref
8
- a id=@target
9
+ = html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))
9
10
  |[#{@target}]
10
11
  - else
11
- a href=@target class=role target=(attr :window) data-preview-link=(bool_data_attr :preview)
12
+ = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact, :target => (attr :window), 'data-preview-link' => (bool_data_attr :preview) }.merge(data_attrs(@attributes)))
12
13
  =@text
@@ -1 +1,2 @@
1
- b.button=@text
1
+ = html_tag('b', { :class => ['button'] }.merge(data_attrs(@attributes)))
2
+ = @text
@@ -1,6 +1,13 @@
1
+ - footnote = slide_footnote(self)
2
+ - index = footnote.attr(:index)
3
+ - id = footnote.id
1
4
  - if @type == :xref
2
- span.footnoteref
3
- | [<a class="footnote" href="#_footnote_#{attr :index}" title="View footnote.">#{attr :index}</a>]
5
+ = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes)))
6
+ | [
7
+ span(class="footnote" title="View footnote.") = index
8
+ | ]
4
9
  - else
5
- span.footnote id=("_footnote_#{@id}" if @id)
6
- | [<a id="_footnoteref_#{attr :index}" class="footnote" href="#_footnote_#{attr :index}" title="View footnote.">#{attr :index}</a>]
10
+ = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes)))
11
+ | [
12
+ span(class="footnote" title="View footnote.") = index
13
+ | ]
@@ -1,9 +1,6 @@
1
- span class=[@type,role] style=("float: #{attr :float}" if attr? :float)
1
+ = html_tag('span', { :class => [@type, role, ('fragment' if (option? :step) || (attr? 'step'))], :style => ("float: #{attr :float}" if attr? :float) }.merge(data_attrs(@attributes)))
2
2
  - if @type == 'icon' && (@document.attr? :icons, 'font')
3
- - style_class = ["fa fa-#{@target}"]
4
- - style_class << "fa-#{attr :size}" if attr? :size
5
- - style_class << "fa-rotate-#{attr :rotate}" if attr? :rotate
6
- - style_class << "fa-flip-#{attr :flip}" if attr? :flip
3
+ - style_class = [(attr :set, 'fa'), "fa-#{@target}", ("fa-#{attr :size}" if attr? :size), ("fa-rotate-#{attr :rotate}" if attr? :rotate), ("fa-flip-#{attr :flip}" if attr? :flip)]
7
4
  - if attr? :link
8
5
  a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
9
6
  i class=style_class title=(attr :title)
@@ -1,7 +1,8 @@
1
1
  - if (keys = attr 'keys').size == 1
2
- kbd=keys.first
2
+ = html_tag('kbd', data_attrs(@attributes))
3
+ = keys.first
3
4
  - else
4
- span.keyseq
5
+ = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes)))
5
6
  - keys.each_with_index do |key, idx|
6
7
  - unless idx.zero?
7
8
  |+
@@ -1,15 +1,16 @@
1
1
  - menu = attr 'menu'
2
2
  - menuitem = attr 'menuitem'
3
3
  - if !(submenus = attr 'submenus').empty?
4
- span.menuseq
4
+ = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes)))
5
5
  span.menu=menu
6
6
  |&#160;&#9656;&#32;
7
7
  =submenus.map {|submenu| %(<span class="submenu">#{submenu}</span>&#160;&#9656;&#32;) }.join
8
8
  span.menuitem=menuitem
9
9
  - elsif !menuitem.nil?
10
- span.menuseq
10
+ = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes)))
11
11
  span.menu=menu
12
12
  |&#160;&#9656;&#32;
13
13
  span.menuitem=menuitem
14
14
  - else
15
- span.menu=menu
15
+ = html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes)))
16
+ = menu
@@ -1,22 +1,14 @@
1
- - unless @id.nil?
2
- a id=@id
3
- - case @type
4
- - when :emphasis
5
- em class=role =@text
6
- - when :strong
7
- strong class=role =@text
8
- - when :monospaced
9
- code class=role =@text
10
- - when :superscript
11
- sup class=role =@text
12
- - when :subscript
13
- sub class=role =@text
14
- - when :double
15
- =role? ? %(<span class="#{role}">&#8220;#{@text}&#8221;</span>) : %(&#8220;#{@text}&#8221;)
16
- - when :single
17
- =role? ? %(<span class="#{role}">&#8216;#{@text}&#8217;</span>) : %(&#8216;#{@text}&#8217;)
18
- - when :asciimath, :latexmath
19
- - open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]
20
- |#{open}#{@text}#{close}
1
+ - quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sup' }
2
+ - if (quote_tag = quote_tags[@type])
3
+ = html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)
21
4
  - else
22
- =role? ? %(<span class="#{role}">#{@text}</span>) : @text
5
+ - case @type
6
+ - when :double
7
+ - inline_text_container("&#8220;#{@text}&#8221;")
8
+ - when :single
9
+ = inline_text_container("&#8216;#{@text}&#8217;")
10
+ - when :asciimath, :latexmath
11
+ - open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]
12
+ = inline_text_container("#{open}#{@text}#{close}")
13
+ - else
14
+ = inline_text_container(@text)
@@ -8,12 +8,17 @@
8
8
  - style = doc_attrs[%(#{syntax_hl.name}-style)]
9
9
  - opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {}
10
10
  - opts[:nowrap] = nowrap
11
- - else
12
- - pre_open = %(<pre class="highlight#{nowrap ? ' nowrap' : ''}"><code#{lang ? %[ class="language-#{lang}" data-lang="#{lang}"] : ''}>)
13
- - pre_close = '</code></pre>'
14
- - else
15
- - pre_open = %(<pre#{nowrap ? ' class="nowrap"' : ''}>)
16
- - pre_close = '</pre>'
17
- - id_attribute = id ? %( id="#{id}") : ''
18
- - title_element = title? ? %(<div class="title">#{captioned_title}</div>\n) : ''
19
- =%(<div#{id_attribute} class="listingblock#{(role = self.role) ? " #{role}" : ''}">#{title_element}<div class="content">#{syntax_hl ? (syntax_hl.format self, lang, opts) : pre_open + (content || '') + pre_close}</div></div>)
11
+ = html_tag('div', { :id => id, :class => ['listingblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
12
+ - if title?
13
+ div.title= captioned_title
14
+ div.content
15
+ - if syntax_hl
16
+ = (syntax_hl.format self, lang, opts)
17
+ - else
18
+ - if @style == 'source'
19
+ pre class = ['highlight', ('nowrap' if nowrap)]
20
+ code class = [("language-#{lang}" if lang)] data-lang = ("#{lang}" if lang)
21
+ = content || ''
22
+ - else
23
+ pre class = [('nowrap' if nowrap)]
24
+ = content || ''
@@ -1,4 +1,4 @@
1
- .literalblock id=@id class=role
1
+ = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
2
2
  - if title?
3
3
  .title=title
4
4
  .content: pre class=(!(@document.attr? :prewrap) || (option? 'nowrap') ? 'nowrap' : nil) =content
@@ -1,9 +1,9 @@
1
- .olist id=@id class=[@style,role]
1
+ = html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes)))
2
2
  - if title?
3
3
  .title=title
4
4
  ol class=@style start=(attr :start) type=list_marker_keyword
5
5
  - items.each do |item|
6
- li class=('fragment' if (option? :step) or (has_role? 'step'))
6
+ li class=('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))
7
7
  p=item.text
8
8
  - if item.blocks?
9
9
  =item.content
@@ -2,17 +2,17 @@
2
2
  - if @parent == @document && @document.doctype == 'book'
3
3
  - puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
4
4
  - else
5
- .quoteblock.abstract id=@id class=role
5
+ = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
6
6
  - if title?
7
7
  .title=title
8
8
  blockquote=content
9
9
  - elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book')
10
- - 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.'
10
+ - 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.'
11
11
  - else
12
12
  - if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes')
13
13
  include notes.html.slim
14
14
  - else
15
- .openblock id=@id class=[(@style != 'open' ? @style : nil),role]
15
+ = html_tag('div', { :id => @id, :class => ['openblock', (@style != 'open' ? @style : nil), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
16
16
  - if title?
17
17
  .title=title
18
18
  .content=content
@@ -1,4 +1,4 @@
1
- .paragraph id=@id class=role
1
+ = html_tag('div', { :id => @id, :class => ['paragraph', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
2
2
  - if title?
3
3
  .title=title
4
4
  - if has_role? 'small'
@@ -1,4 +1,4 @@
1
- .quoteblock id=@id class=role
1
+ = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
2
2
  - if title?
3
3
  .title=title
4
4
  blockquote=content
@@ -30,11 +30,22 @@
30
30
  - if attr? 'background-image'
31
31
  - data_background_image = image_uri(attr 'background-image')
32
32
 
33
+ - if attr? 'background-video'
34
+ - data_background_video = media_uri(attr 'background-video')
35
+
33
36
  - if attr? 'background-color'
34
37
  - data_background_color = attr 'background-color'
35
38
 
36
39
  - parent_section_with_vertical_slides = @level == 1 && !vertical_slides.empty?
37
40
 
41
+ - content_for :footnotes
42
+ - slide_footnotes = slide_footnotes(self)
43
+ - if document.footnotes? && !(parent.attr? 'nofootnotes') && !slide_footnotes.empty?
44
+ .footnotes
45
+ - slide_footnotes.each do |footnote|
46
+ .footnote
47
+ = "#{footnote.index}. #{footnote.text}"
48
+
38
49
  - content_for :section
39
50
  section(id=(titleless ? nil : id)
40
51
  class=roles
@@ -47,10 +58,11 @@
47
58
  data-background-transition=(data_background_transition || attr('background-transition'))
48
59
  data-background-position=(data_background_position || attr('background-position'))
49
60
  data-background-iframe=(attr "background-iframe")
50
- data-background-video=(attr "background-video")
61
+ data-background-video=data_background_video
51
62
  data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
52
63
  data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
53
64
  data-background-opacity=(attr "background-opacity")
65
+ data-autoslide=(attr "autoslide")
54
66
  data-state=(attr 'state'))
55
67
  - unless hide_title
56
68
  h2=section_title
@@ -59,10 +71,15 @@
59
71
  div.slide-content
60
72
  - _blocks.each do |block|
61
73
  =block.convert
74
+ - yield_content :footnotes
75
+
62
76
  - else
63
77
  - unless (_content = content.chomp).empty?
64
78
  div.slide-content
65
79
  =_content
80
+ - yield_content :footnotes
81
+
82
+ - clear_slide_footnotes
66
83
 
67
84
  / RENDERING
68
85
  / render parent section of vertical slides set
@@ -1,7 +1,7 @@
1
1
  - if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes')
2
2
  include notes.html.slim
3
3
  - else
4
- .sidebarblock id=@id class=role
4
+ = html_tag('div', { :id => @id, :class => ['sidebarblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes)))
5
5
  .content
6
6
  - if title?
7
7
  .title=title
@@ -4,7 +4,7 @@
4
4
  - equation = sub_specialcharacters equation
5
5
  - unless (equation.start_with? open) && (equation.end_with? close)
6
6
  - equation = %(#{open}#{equation}#{close})
7
- .stemblock id=@id class=role
7
+ = html_tag('div', { :id => @id, :class => ['stemblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes)))
8
8
  - if title?
9
9
  .title=title
10
10
  .content=equation
@@ -1,5 +1,6 @@
1
- table(id=@id class=['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :grid, 'all'}",role]
2
- style=[("width:#{attr :tablepcwidth}%" unless option? 'autowidth'),("float:#{attr :float}" if attr? :float)].compact.join('; '))
1
+ - classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))]
2
+ - styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; ')
3
+ = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes)))
3
4
  - if title?
4
5
  caption.title=captioned_title
5
6
  - unless (attr :rowcount).zero?
@@ -6,16 +6,16 @@
6
6
  - if @document.attr? :icons, 'font'
7
7
  - marker_checked = '<i class="icon-check"></i>'
8
8
  - marker_unchecked = '<i class="icon-check-empty"></i>'
9
- - else
9
+ - else
10
10
  / could use &#9745 (checked ballot) and &#9744 (ballot) w/o font instead
11
11
  - marker_checked = '<input type="checkbox" data-item-complete="1" checked disabled>'
12
12
  - marker_unchecked = '<input type="checkbox" data-item-complete="0" disabled>'
13
- .ulist id=@id class=[checklist,@style,role]
13
+ = html_tag('div', { :id => @id, :class => ['ulist', checklist, @style, role] }.merge(data_attrs(@attributes)))
14
14
  - if title?
15
15
  .title=title
16
16
  ul class=(checklist || @style)
17
17
  - items.each do |item|
18
- li class=('fragment' if (option? :step) || (has_role? 'step'))
18
+ li class=('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))
19
19
  p
20
20
  - if checklist && (item.attr? :checkbox)
21
21
  =%(#{(item.attr? :checked) ? marker_checked : marker_unchecked}#{item.text})