asciidoctor-html5s 0.1.0.beta.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.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.adoc +62 -0
  4. data/asciidoctor-html5s.gemspec +34 -0
  5. data/data/templates/_attribution.html.slim +4 -0
  6. data/data/templates/_footer.html.slim +8 -0
  7. data/data/templates/_footnotes.html.slim +11 -0
  8. data/data/templates/_hdlist.html.slim +20 -0
  9. data/data/templates/_header.html.slim +27 -0
  10. data/data/templates/_qanda.html.slim +12 -0
  11. data/data/templates/_toc.html.slim +4 -0
  12. data/data/templates/admonition.html.slim +10 -0
  13. data/data/templates/audio.html.slim +7 -0
  14. data/data/templates/colist.html.slim +4 -0
  15. data/data/templates/dlist.html.slim +13 -0
  16. data/data/templates/document.html.slim +30 -0
  17. data/data/templates/embedded.html.slim +5 -0
  18. data/data/templates/example.html.slim +2 -0
  19. data/data/templates/floating_title.html.slim +2 -0
  20. data/data/templates/helpers.rb +665 -0
  21. data/data/templates/image.html.slim +3 -0
  22. data/data/templates/inline_anchor.html.slim +12 -0
  23. data/data/templates/inline_break.html.slim +2 -0
  24. data/data/templates/inline_button.html.slim +1 -0
  25. data/data/templates/inline_callout.html.slim +1 -0
  26. data/data/templates/inline_footnote.html.slim +9 -0
  27. data/data/templates/inline_image.html.slim +10 -0
  28. data/data/templates/inline_indexterm.html.slim +2 -0
  29. data/data/templates/inline_kbd.html.slim +7 -0
  30. data/data/templates/inline_menu.html.slim +18 -0
  31. data/data/templates/inline_quoted.html.slim +26 -0
  32. data/data/templates/listing.html.slim +16 -0
  33. data/data/templates/literal.html.slim +2 -0
  34. data/data/templates/olist.html.slim +4 -0
  35. data/data/templates/open.html.slim +7 -0
  36. data/data/templates/outline.html.slim +9 -0
  37. data/data/templates/page_break.html.slim +1 -0
  38. data/data/templates/paragraph.html.slim +6 -0
  39. data/data/templates/pass.html.slim +1 -0
  40. data/data/templates/preamble.html.slim +4 -0
  41. data/data/templates/quote.html.slim +6 -0
  42. data/data/templates/section.html.slim +13 -0
  43. data/data/templates/sidebar.html.slim +4 -0
  44. data/data/templates/stem.html.slim +2 -0
  45. data/data/templates/table.html.slim +39 -0
  46. data/data/templates/thematic_break.html.slim +1 -0
  47. data/data/templates/toc.html.slim +9 -0
  48. data/data/templates/ulist.html.slim +11 -0
  49. data/data/templates/verse.html.slim +7 -0
  50. data/data/templates/video.html.slim +18 -0
  51. data/lib/asciidoctor-html5s.rb +1 -0
  52. data/lib/asciidoctor/html5s.rb +8 -0
  53. data/lib/asciidoctor/html5s/attached_colist_treeprocessor.rb +24 -0
  54. data/lib/asciidoctor/html5s/converter.rb +3009 -0
  55. data/lib/asciidoctor/html5s/version.rb +5 -0
  56. metadata +226 -0
@@ -0,0 +1,3 @@
1
+ = block_with_caption :bottom, {:class=>'imageblock', :style=>style_value(text_align: (attr :align), float: (attr :float))}
2
+ = html_tag_if (attr? :link), :a, {:class=>'image', :href=>(attr :link), :target=>(attr :window), :rel=>link_rel}
3
+ img src=image_uri(attr :target) alt=(attr :alt) width=(attr :width) height=(attr :height)
@@ -0,0 +1,12 @@
1
+ - case type
2
+ - when :xref
3
+ a href=target =xref_text
4
+ - when :ref
5
+ / "target" is for backward compat. with Asciidoctor <1.5.6
6
+ a id=(id || target) aria-hidden='true'
7
+ - when :bibref
8
+ / "target" is for backward compat. with Asciidoctor <1.5.6
9
+ a id=(id || target) aria-hidden='true'
10
+ =bibref_text
11
+ - else
12
+ a id=id class=role href=target target=(attr :window) rel=link_rel title=(attr :title) =text
@@ -0,0 +1,2 @@
1
+ =text
2
+ br
@@ -0,0 +1 @@
1
+ b.button =text
@@ -0,0 +1 @@
1
+ b.conum =text
@@ -0,0 +1,9 @@
1
+ - if (index = local_attr :index)
2
+ a.footnote-ref [
3
+ id=(footnoteref_id unless type == :xref)
4
+ href="##{footnote_id}"
5
+ title="View footnote #{index}"
6
+ role='doc-noteref' ]
7
+ | [#{index}]
8
+ - else
9
+ a.footnote-ref.broken title="Unresolved footnote reference." [#{text}]
@@ -0,0 +1,10 @@
1
+ = html_tag_if (attr? :link), :a, {:class=>'image', :href=>(attr :link), :target=>(attr :window), :rel=>link_rel}
2
+ - if type == 'icon' && font_icons?
3
+ i class=[*icon_fa_classes, role] title=(attr :title)
4
+ - elsif type == 'icon' && !icons?
5
+ b class=['icon', role] title=(attr :title)
6
+ | [#{attr :alt}]
7
+ - else
8
+ img (src=(type == 'icon' ? (icon_uri target) : (image_uri target))
9
+ alt=(attr :alt) width=(attr :width) height=(attr :height) title=(attr :title)
10
+ class=[(type if type != 'image'), role] style=style_value(float: (attr :float)))
@@ -0,0 +1,2 @@
1
+ - if type == :visible
2
+ =text
@@ -0,0 +1,7 @@
1
+ - if (keys = attr 'keys').size == 1
2
+ kbd =keys.first
3
+ - else
4
+ kbd.keyseq
5
+ - keys.each_with_index do |key, idx|
6
+ ="+" unless idx.zero?
7
+ kbd =key
@@ -0,0 +1,18 @@
1
+ - if local_attr :menuitem
2
+ - capture
3
+ | &#160;
4
+ - if font_icons?
5
+ i.fa.fa-angle-right.caret
6
+ - else
7
+ b.caret &#8250;
8
+ span.menuseq
9
+ b.menu
10
+ =(attr :menu)
11
+ - yield_capture
12
+ - (attr 'submenus').each do |submenu|
13
+ b.submenu
14
+ =submenu
15
+ - yield_capture
16
+ b.menuitem =(local_attr :menuitem)
17
+ - else
18
+ b.menuref =(attr :menu)
@@ -0,0 +1,26 @@
1
+ - unless id.nil?
2
+ a id=id aria-hidden='true'
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 :mark
15
+ mark class=role =text
16
+ - when :double
17
+ = html_tag_if role?, :span, :class=>role
18
+ | &#8220;#{text}&#8221;
19
+ - when :single
20
+ = html_tag_if role?, :span, :class=>role
21
+ | &#8216;#{text}&#8217;
22
+ - when :asciimath, :latexmath
23
+ span.math =delimit_stem text, type
24
+ - else
25
+ = html_tag_if role?, :span, :class=>role
26
+ =text
@@ -0,0 +1,16 @@
1
+ = block_with_caption :top, :class=>'listingblock'
2
+ - if style == 'source'
3
+ - if highlighter == 'html-pipeline'
4
+ pre lang=source_lang
5
+ code =content
6
+ - else
7
+ - unless highlighter == 'CodeRay'
8
+ - code_class = "language-#{source_lang}" if source_lang
9
+ pre class=[highlighter, 'highlight', ('linenums' if attr? :linenums), nowrap?]
10
+ code class=code_class data-lang=source_lang =content
11
+ - else
12
+ pre class=nowrap? =content
13
+ / Note: This is a hack to embed callout list into the listing element.
14
+ / See asciidoctor/html5s/attached_colist_treeprocessor.rb.
15
+ - if callout_list
16
+ = converter.convert callout_list, 'colist'
@@ -0,0 +1,2 @@
1
+ = block_with_title :class=>'literalblock'
2
+ pre class=nowrap? =content
@@ -0,0 +1,4 @@
1
+ = block_with_title :class=>['olist', style]
2
+ ol class=style start=(attr :start) type=list_marker_keyword reversed=(option? 'reversed')
3
+ - items.each do |item|
4
+ li =(print_item_content item)
@@ -0,0 +1,7 @@
1
+ - if style == 'abstract'
2
+ - if abstract_allowed?
3
+ = block_with_title :class=>'quoteblock abstract'
4
+ blockquote =content
5
+ - elsif style != 'partintro' || partintro_allowed?
6
+ = block_with_title :class=>['openblock', (style if style != 'open')]
7
+ .content =content
@@ -0,0 +1,9 @@
1
+ - unless sections.empty?
2
+ - toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i
3
+ - slevel = section_level sections.first
4
+ ol class="sectlevel#{slevel}"
5
+ - sections.each do |sec|
6
+ li
7
+ a href="##{sec.id}" =section_title sec
8
+ - if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline')
9
+ = child_toc
@@ -0,0 +1 @@
1
+ div role='doc-pagebreak' style='page-break-after: always;'
@@ -0,0 +1,6 @@
1
+ - if title?
2
+ section.paragraph id=id
3
+ h6 =title
4
+ p class=role =content
5
+ - else
6
+ p id=id class=role =content
@@ -0,0 +1 @@
1
+ =content
@@ -0,0 +1,4 @@
1
+ section#preamble aria-label='Preamble'
2
+ =content
3
+ - if (attr? :toc) && (attr? 'toc-placement', 'preamble')
4
+ include _toc.html
@@ -0,0 +1,6 @@
1
+ = block_with_title :class=>'quoteblock'
2
+ blockquote
3
+ = html_tag_if !blocks?, :p
4
+ =content
5
+ - if attr?(:attribution) || attr?(:citetitle)
6
+ include _attribution.html
@@ -0,0 +1,13 @@
1
+ - sect0 = section_level == 0
2
+ = html_tag_if !sect0, :section, :class=>["sect#{section_level}", role]
3
+ h level=(section_level + 1) id=id class=('sect0' if sect0)
4
+ - if id
5
+ - if document.attr? :sectanchors
6
+ a.anchor href="##{id}" aria-hidden='true'
7
+ - if document.attr? :sectlinks
8
+ a.link href="##{id}" =section_title
9
+ - else
10
+ =section_title
11
+ - else
12
+ =section_title
13
+ =content
@@ -0,0 +1,4 @@
1
+ aside.sidebar id=id class=role
2
+ - if title?
3
+ h6 =title
4
+ =content
@@ -0,0 +1,2 @@
1
+ = block_with_caption :top, :class=>'stemblock'
2
+ .math =(delimit_stem content, style)
@@ -0,0 +1,39 @@
1
+ = block_with_caption :top, :class=>'tableblock'
2
+ table [
3
+ class=["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", spread?]
4
+ style=style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !spread? || (local_attr :width)),
5
+ float: (attr :float)) ]
6
+ - unless (attr :rowcount).zero?
7
+ colgroup
8
+ - if autowidth?
9
+ - columns.each do
10
+ col
11
+ - else
12
+ - columns.each do |col|
13
+ col style="width: #{col.attr :colpcwidth}%;"
14
+ - [:head, :foot, :body].reject { |tblsec| rows[tblsec].empty? }.each do |tblsec|
15
+ <t#{tblsec}>
16
+ - rows[tblsec].each do |row|
17
+ tr
18
+ - row.each do |cell|
19
+ = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
20
+ :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
21
+ :colspan=>cell.colspan,
22
+ :rowspan=>cell.rowspan,
23
+ :style=>style_value(background_color: (document.attr :cellbgcolor)))
24
+ - if tblsec == :head
25
+ =cell.text
26
+ - else
27
+ - case cell.style
28
+ - when :asciidoc
29
+ =cell.content
30
+ - when :verse
31
+ .verse: pre =cell.text
32
+ - when :literal
33
+ .literal: pre =cell.text
34
+ - else
35
+ - if cell.content.one?
36
+ =cell.content.first
37
+ - else
38
+ - cell.content.each do |text|
39
+ p =text
@@ -0,0 +1 @@
1
+ hr
@@ -0,0 +1,9 @@
1
+ / This template is used only for toc::[] macro; for document and preamble TOC
2
+ / see document.html, preamble.html and _toc.html.
3
+ - if document.attr? :toc
4
+ - toc_id = id || ('toc' if document.embedded? || !document.attr?('toc-placement'))
5
+ nav id=toc_id class=(attr :role, (document.attr 'toc-class', 'toc'))
6
+ h level=(section_level + 2) id=("#{toc_id}title" if toc_id)
7
+ =(title || (document.attr 'toc-title'))
8
+ / Renders outline.html.
9
+ = converter.convert document, 'outline', :toclevels=>((attr :levels).to_i if attr? :levels)
@@ -0,0 +1,11 @@
1
+ - checklist = 'task-list' if option? 'checklist'
2
+ = block_with_title :class=>['ulist', style]
3
+ ul class=(checklist || style)
4
+ - items.each do |item|
5
+ - if checklist && (item.attr? :checkbox)
6
+ li.task-list-item
7
+ input.task-list-item-checkbox type='checkbox' disabled=true checked=(item.attr? :checked)
8
+ =<item.text
9
+ - else
10
+ li
11
+ =(print_item_content item)
@@ -0,0 +1,7 @@
1
+ = block_with_title :class=>'verseblock'
2
+ - if attr?(:attribution) || attr?(:citetitle)
3
+ blockquote.verse
4
+ pre.verse =content
5
+ include _attribution.html
6
+ - else
7
+ pre.verse =content
@@ -0,0 +1,18 @@
1
+ = block_with_caption :bottom, :class=>'videoblock'
2
+ - if video_iframe?
3
+ iframe [
4
+ src=video_uri
5
+ width=(attr :width)
6
+ height=(attr :height)
7
+ frameborder=0
8
+ allowfullscreen=!(option? 'nofullscreen') ]
9
+ - else
10
+ video [
11
+ src=video_uri
12
+ width=(attr :width)
13
+ height=(attr :height)
14
+ poster=(media_uri(attr :poster) if attr? :poster)
15
+ autoplay=(option? 'autoplay')
16
+ controls=!(option? 'nocontrols')
17
+ loop=(option? 'loop') ]
18
+ | Your browser does not support the video tag.
@@ -0,0 +1 @@
1
+ require 'asciidoctor/html5s'
@@ -0,0 +1,8 @@
1
+ require 'asciidoctor/extensions'
2
+ require 'asciidoctor/html5s/version'
3
+ require 'asciidoctor/html5s/converter'
4
+ require 'asciidoctor/html5s/attached_colist_treeprocessor'
5
+
6
+ Asciidoctor::Extensions.register do
7
+ treeprocessor Asciidoctor::Html5s::AttachedColistTreeprocessor
8
+ end
@@ -0,0 +1,24 @@
1
+ require 'asciidoctor/html5s/version'
2
+ require 'asciidoctor/extensions'
3
+
4
+ module Asciidoctor::Html5s
5
+
6
+ # This extension moves every callout list immediately following listing block
7
+ # to instance variable +@html5s_colist+ inside the listing block.
8
+ # The aim is to render callout list as part of the corresponding listing.
9
+ class AttachedColistTreeprocessor < ::Asciidoctor::Extensions::Treeprocessor
10
+
11
+ def process(document)
12
+ document.find_by(context: :colist) do |colist|
13
+ blocks = colist.parent.blocks
14
+ colist_idx = blocks.find_index(colist)
15
+ prev_block = blocks[colist_idx - 1] if colist_idx
16
+
17
+ if prev_block && prev_block.node_name == 'listing'
18
+ blocks.delete_at(colist_idx) # mutates node's blocks list!
19
+ prev_block.instance_variable_set(:@html5s_colist, colist)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,3009 @@
1
+ # This file has been generated!
2
+
3
+ module Asciidoctor; module Html5s; end end
4
+ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
5
+
6
+ #------------------------------ Begin of Helpers ------------------------------#
7
+
8
+ require 'asciidoctor'
9
+ require 'asciidoctor/html5s'
10
+ require 'date'
11
+ require 'json'
12
+
13
+ # Needed only in compile-time.
14
+ require 'slim-htag' if defined? Slim
15
+
16
+ if Gem::Version.new(Asciidoctor::VERSION) <= Gem::Version.new('1.5.1')
17
+ fail 'asciidoctor: FAILED: HTML5/Slim backend needs Asciidoctor >=1.5.2!'
18
+ end
19
+
20
+ # Add custom functions to this module that you want to use in your Slim
21
+ # templates. Within the template you can invoke them as top-level functions
22
+ # just like in Haml.
23
+ module Helpers
24
+
25
+ # URIs of external assets.
26
+ FONT_AWESOME_URI = '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css'
27
+ HIGHLIGHTJS_BASE_URI = '//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4'
28
+ MATHJAX_JS_URI = '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML'
29
+
30
+ # Defaults
31
+ DEFAULT_HIGHLIGHTJS_THEME = 'github'
32
+ DEFAULT_SECTNUMLEVELS = 3
33
+ DEFAULT_TOCLEVELS = 2
34
+
35
+ # The MathJax configuration.
36
+ MATHJAX_CONFIG = {
37
+ tex2jax: {
38
+ inlineMath: [::Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath].inspect],
39
+ displayMath: [::Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath].inspect],
40
+ ignoreClass: 'nostem|nolatexmath',
41
+ },
42
+ asciimath2jax: {
43
+ delimiters: [::Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath].inspect],
44
+ ignoreClass: 'nostem|noasciimath',
45
+ }
46
+ }.to_json
47
+
48
+ VOID_ELEMENTS = %w(area base br col command embed hr img input keygen link
49
+ meta param source track wbr)
50
+
51
+
52
+ ##
53
+ # Captures the given block for later yield.
54
+ #
55
+ # @example Basic capture usage.
56
+ # - capture
57
+ # img src=image_uri
58
+ # - if title?
59
+ # figure.image
60
+ # - yield_capture
61
+ # figcaption =captioned_title
62
+ # - else
63
+ # - yield_capture
64
+ #
65
+ # @example Capture with passing parameters.
66
+ # - capture do |id|
67
+ # img src=image_uri
68
+ # - if title?
69
+ # figure id=@id
70
+ # - yield_capture
71
+ # figcaption =caption
72
+ # - else
73
+ # - yield_capture @id
74
+ #
75
+ # @see yield_capture
76
+ def capture(&block)
77
+ @_html5s_capture = block
78
+ nil
79
+ end
80
+
81
+ ##
82
+ # Yields the captured block (see {#capture}).
83
+ #
84
+ # @param *params parameters to pass to the block.
85
+ # @return A content of the captured block.
86
+ # @see capture
87
+ def yield_capture(*params)
88
+ @_html5s_capture.call(*params) if @_html5s_capture
89
+ end
90
+
91
+ ##
92
+ # Creates an HTML tag with the given name and optionally attributes. Can take
93
+ # a block that will run between the opening and closing tags.
94
+ #
95
+ # @param name [#to_s] the name of the tag.
96
+ # @param attributes [Hash] (default: {})
97
+ # @param content [#to_s] the content; +nil+ to call the block. (default: nil).
98
+ # @yield The block of Slim/HTML code within the tag (optional).
99
+ # @return [String] a rendered HTML element.
100
+ #
101
+ def html_tag(name, attributes = {}, content = nil)
102
+ attrs = attributes.inject([]) do |attrs, (k, v)|
103
+ next attrs if !v || v.nil_or_empty?
104
+ v = v.compact.join(' ') if v.is_a? Array
105
+ attrs << (v == true ? k : %(#{k}="#{v}"))
106
+ end
107
+ attrs_str = attrs.empty? ? '' : attrs.join(' ').prepend(' ')
108
+
109
+ if VOID_ELEMENTS.include? name.to_s
110
+ %(<#{name}#{attrs_str}>)
111
+ else
112
+ content ||= yield if block_given?
113
+ %(<#{name}#{attrs_str}>#{content}</#{name}>)
114
+ end
115
+ end
116
+
117
+ ##
118
+ # Conditionally wraps a block in an element. If condition is +true+ then it
119
+ # renders the specified tag with optional attributes and the given
120
+ # block inside, otherwise it just renders the block.
121
+ #
122
+ # For example:
123
+ #
124
+ # = html_tag_if link?, 'a', {class: 'image', href: (attr :link)}
125
+ # img src='./img/tux.png'
126
+ #
127
+ # will produce:
128
+ #
129
+ # <a href="http://example.org" class="image">
130
+ # <img src="./img/tux.png">
131
+ # </a>
132
+ #
133
+ # if +link?+ is truthy, and just
134
+ #
135
+ # <img src="./img/tux.png">
136
+ #
137
+ # otherwise.
138
+ #
139
+ # @param condition [Boolean] the condition to test to determine whether to
140
+ # render the enclosing tag.
141
+ # @param name (see #html_tag)
142
+ # @param attributes (see #html_tag)
143
+ # @param content (see #html_tag)
144
+ # @yield (see #html_tag)
145
+ # @return [String] a rendered HTML fragment.
146
+ #
147
+ def html_tag_if(condition, name, attributes = {}, content = nil, &block)
148
+ if condition
149
+ html_tag name, attributes, content, &block
150
+ else
151
+ content || yield
152
+ end
153
+ end
154
+
155
+ ##
156
+ # Wraps a block in a div element with the specified class and optionally
157
+ # the node's +id+ and +role+(s). If the node's +title+ is not empty, then a
158
+ # nested div with the class "title" and the title's content is added as well.
159
+ #
160
+ # @example When @id, @role and @title attributes are set.
161
+ # = block_with_title :class=>['quoteblock', 'center']
162
+ # blockquote =content
163
+ #
164
+ # <section id="myid" class="quoteblock center myrole1 myrole2">
165
+ # <h6>Block Title</h6>
166
+ # <blockquote>Lorem ipsum</blockquote>
167
+ # </section>
168
+ #
169
+ # @example When @id, @role and @title attributes are empty.
170
+ # = block_with_title :class=>'quoteblock center', :style=>style_value(float: 'left')
171
+ # blockquote =content
172
+ #
173
+ # <div class="quoteblock center" style="float: left;">
174
+ # <blockquote>Lorem ipsum</blockquote>
175
+ # </div>
176
+ #
177
+ # @example When shorthand style for class attribute is used.
178
+ # = block_with_title 'quoteblock center'
179
+ # blockquote =content
180
+ #
181
+ # <div class="quoteblock center">
182
+ # <blockquote>Lorem ipsum</blockquote>
183
+ # </div>
184
+ #
185
+ # @param attrs [Hash, String] the tag's attributes as Hash),
186
+ # or the tag's class if it's not a Hash.
187
+ # @param title [String, nil] the title.
188
+ # @yield The block of Slim/HTML code within the tag (optional).
189
+ # @return [String] a rendered HTML fragment.
190
+ #
191
+ def block_with_title(attrs = {}, title = @title, &block)
192
+ if (klass = attrs[:class]).is_a? String
193
+ klass = klass.split(' ')
194
+ end
195
+ attrs[:class] = [klass, role].flatten.uniq
196
+ attrs[:id] = id
197
+
198
+ if title.nil_or_empty?
199
+ # XXX quick hack
200
+ nested = is_a?(::Asciidoctor::List) &&
201
+ (parent.is_a?(::Asciidoctor::ListItem) || parent.is_a?(::Asciidoctor::List))
202
+ html_tag_if !nested, :div, attrs, yield
203
+ else
204
+ html_tag :section, attrs do
205
+ [html_tag(:h6, {}, title), yield].join("\n")
206
+ end
207
+ end
208
+ end
209
+
210
+ def block_with_caption(position = :bottom, attrs = {}, &block)
211
+ if (klass = attrs[:class]).is_a? String
212
+ klass = klass.split(' ')
213
+ end
214
+ attrs[:class] = [klass, role].flatten.uniq
215
+ attrs[:id] = id
216
+
217
+ if title.nil_or_empty?
218
+ html_tag :div, attrs, yield
219
+ else
220
+ html_tag :figure, attrs do
221
+ ary = [yield, html_tag(:figcaption) { captioned_title }]
222
+ ary.reverse! if position == :top
223
+ ary.compact.join("\n")
224
+ end
225
+ end
226
+ end
227
+
228
+ ##
229
+ # Delimite the given equation as a STEM of the specified type.
230
+ #
231
+ # @param equation [String] the equation to delimite.
232
+ # @param type [#to_sym] the type of the STEM renderer (latexmath, or asciimath).
233
+ # @return [String] the delimited equation.
234
+ #
235
+ def delimit_stem(equation, type)
236
+ if is_a? ::Asciidoctor::Block
237
+ open, close = ::Asciidoctor::BLOCK_MATH_DELIMITERS[type.to_sym]
238
+ else
239
+ open, close = ::Asciidoctor::INLINE_MATH_DELIMITERS[type.to_sym]
240
+ end
241
+
242
+ if !equation.start_with?(open) || !equation.end_with?(close)
243
+ equation = [open, equation, close].join
244
+ end
245
+ equation
246
+ end
247
+
248
+ ##
249
+ # Formats the given hash as CSS declarations for an inline style.
250
+ #
251
+ # @example
252
+ # style_value(text_align: 'right', float: 'left')
253
+ # => "text-align: right; float: left;"
254
+ #
255
+ # style_value(text_align: nil, float: 'left')
256
+ # => "float: left;"
257
+ #
258
+ # style_value(width: [90, '%'], height: '50px')
259
+ # => "width: 90%; height: 50px;"
260
+ #
261
+ # style_value(width: ['120px', 'px'])
262
+ # => "width: 90px;"
263
+ #
264
+ # style_value(width: [nil, 'px'])
265
+ # => nil
266
+ #
267
+ # @param declarations [Hash]
268
+ # @return [String, nil]
269
+ #
270
+ def style_value(declarations)
271
+ decls = []
272
+
273
+ declarations.each do |prop, value|
274
+ next if value.nil?
275
+
276
+ if value.is_a? Array
277
+ value, unit = value
278
+ next if value.nil?
279
+ value = value.to_s + unit unless value.end_with? unit
280
+ end
281
+ prop = prop.to_s.gsub('_', '-')
282
+ decls << "#{prop}: #{value}"
283
+ end
284
+
285
+ decls.empty? ? nil : decls.join('; ') + ';'
286
+ end
287
+
288
+ def urlize(*segments)
289
+ path = segments * '/'
290
+ if path.start_with? '//'
291
+ @_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
292
+ path = "#{@_uri_scheme}:#{path}" unless @_uri_scheme.empty?
293
+ end
294
+ normalize_web_path path
295
+ end
296
+
297
+
298
+ ##
299
+ # Gets the value of the specified attribute in this node.
300
+ #
301
+ # This is just an alias for +attr+ method with disabled _inherit_ to make it
302
+ # more clear.
303
+ #
304
+ # @param name [String, Symbol] the name of the attribute to lookup.
305
+ # @param default_val the value to return if the attribute is not found.
306
+ # @return value of the attribute or +default_val+ if not found.
307
+ #
308
+ def local_attr(name, default_val = nil)
309
+ attr(name, default_val, false)
310
+ end
311
+
312
+ ##
313
+ # Checks if the attribute is defined on this node, optionally performing
314
+ # a comparison of its value if +expect_val+ is not nil.
315
+ #
316
+ # This is just an alias for +attr?+ method with disabled _inherit_ to make it
317
+ # more clear.
318
+ #
319
+ # @param name [String, Symbol] the name of the attribute to lookup.
320
+ # @param default_val the expected value of the attribute.
321
+ # @return [Boolean] whether the attribute exists and, if +expect_val+ is
322
+ # specified, whether the value of the attribute matches the +expect_val+.
323
+ #
324
+ def local_attr?(name, expect_val = nil)
325
+ attr?(name, expect_val, false)
326
+ end
327
+
328
+ ##
329
+ # @param index [Integer] the footnote's index.
330
+ # @return [String] footnote id to be used in a link.
331
+ def footnote_id(index = local_attr(:index))
332
+ "_footnote_#{index}"
333
+ end
334
+
335
+ ##
336
+ # @param index (see #footnote_id)
337
+ # @return [String] footnoteref id to be used in a link.
338
+ def footnoteref_id(index = local_attr(:index))
339
+ "_footnoteref_#{index}"
340
+ end
341
+
342
+ def icons?
343
+ document.attr? :icons
344
+ end
345
+
346
+ def font_icons?
347
+ document.attr? :icons, 'font'
348
+ end
349
+
350
+ def nowrap?
351
+ 'nowrap' if !document.attr?(:prewrap) || option?('nowrap')
352
+ end
353
+
354
+ def print_item_content(item)
355
+ wrap = item.blocks? && !item.blocks.all? { |b| b.is_a? ::Asciidoctor::List }
356
+ [ (html_tag_if(wrap, :p) { item.text } if item.text?), item.content ].join
357
+ end
358
+
359
+ ##
360
+ # Returns corrected section level.
361
+ #
362
+ # @param sec [Asciidoctor::Section] the section node (default: self).
363
+ # @return [Integer]
364
+ #
365
+ def section_level(sec = self)
366
+ @_section_level ||= (sec.level == 0 && sec.special) ? 1 : sec.level
367
+ end
368
+
369
+ ##
370
+ # Returns the captioned section's title, optionally numbered.
371
+ #
372
+ # @param sec [Asciidoctor::Section] the section node (default: self).
373
+ # @return [String]
374
+ #
375
+ def section_title(sec = self)
376
+ sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i
377
+
378
+ if sec.numbered && !sec.caption && sec.level <= sectnumlevels
379
+ [sec.sectnum, sec.captioned_title].join(' ')
380
+ else
381
+ sec.captioned_title
382
+ end
383
+ end
384
+
385
+ def link_rel
386
+ 'noopener' if option?('noopener') || attr(:window) == '_blank'
387
+ end
388
+
389
+ #--------------------------------------------------------
390
+ # block_admonition
391
+ #
392
+
393
+ ##
394
+ # @return [Boolean] should be this admonition wrapped in aside element?
395
+ def admonition_aside?
396
+ %w[note tip].include? attr(:name)
397
+ end
398
+
399
+ ##
400
+ # @return [String, nil] WAI-ARIA role of this admonition.
401
+ def admonition_aria
402
+ case attr(:name)
403
+ when 'note'
404
+ 'note' # https://www.w3.org/TR/wai-aria/roles#note
405
+ when 'tip'
406
+ 'doc-tip' # https://www.w3.org/TR/dpub-aria-1.0/#doc-tip
407
+ when 'caution', 'important', 'warning'
408
+ 'doc-notice' # https://www.w3.org/TR/dpub-aria-1.0/#doc-notice
409
+ end
410
+ end
411
+
412
+ #--------------------------------------------------------
413
+ # block_listing
414
+ #
415
+
416
+ ##
417
+ # @return [String] a canonical name of the source-highlighter to be used as
418
+ # a style class.
419
+ def highlighter
420
+ @_highlighter ||=
421
+ case (highlighter = document.attr('source-highlighter'))
422
+ when 'coderay'; 'CodeRay'
423
+ when 'highlight.js'; 'highlightjs'
424
+ else highlighter
425
+ end
426
+ end
427
+
428
+ ##
429
+ # Returns the callout list attached to this listing node, or +nil+ if none.
430
+ #
431
+ # Note: This variable is set by extension
432
+ # {Asciidoctor::Html5s::AttachedColistTreeprocessor}.
433
+ #
434
+ # @return [Asciidoctor::List, nil]
435
+ def callout_list
436
+ @html5s_colist
437
+ end
438
+
439
+ def source_lang
440
+ local_attr :language, false
441
+ end
442
+
443
+ #--------------------------------------------------------
444
+ # block_open
445
+ #
446
+
447
+ ##
448
+ # Returns +true+ if an abstract block is allowed in this document type,
449
+ # otherwise prints warning and returns +false+.
450
+ def abstract_allowed?
451
+ if result = (parent == document && document.doctype == 'book')
452
+ puts 'asciidoctor: WARNING: abstract block cannot be used in a document
453
+ without a title when doctype is book. Excluding block content.'
454
+ end
455
+ !result
456
+ end
457
+
458
+ ##
459
+ # Returns +true+ if a partintro block is allowed in this context, otherwise
460
+ # prints warning and returns +false+.
461
+ def partintro_allowed?
462
+ if result = (level != 0 || parent.context != :section || document.doctype != 'book')
463
+ puts "asciidoctor: ERROR: partintro block can only be used when doctype
464
+ is book and it's a child of a book part. Excluding block content."
465
+ end
466
+ !result
467
+ end
468
+
469
+ #--------------------------------------------------------
470
+ # block_table
471
+ #
472
+
473
+ def autowidth?
474
+ option? :autowidth
475
+ end
476
+
477
+ def spread?
478
+ if !autowidth? || local_attr?('width')
479
+ 'spread' if attr? :tablepcwidth, 100
480
+ end
481
+ end
482
+
483
+ #--------------------------------------------------------
484
+ # block_video
485
+ #
486
+
487
+ # @return [Boolean] +true+ if the video should be embedded in an iframe.
488
+ def video_iframe?
489
+ ['vimeo', 'youtube'].include? attr(:poster)
490
+ end
491
+
492
+ def video_uri
493
+ case attr(:poster, '').to_sym
494
+ when :vimeo
495
+ params = {
496
+ autoplay: (1 if option? 'autoplay'),
497
+ loop: (1 if option? 'loop')
498
+ }
499
+ start_anchor = "#at=#{attr :start}" if attr? :start
500
+ "//player.vimeo.com/video/#{attr :target}#{start_anchor}#{url_query params}"
501
+
502
+ when :youtube
503
+ video_id, list_id = attr(:target).split('/', 2)
504
+ params = {
505
+ rel: 0,
506
+ start: (attr :start),
507
+ end: (attr :end),
508
+ list: (attr :list, list_id),
509
+ autoplay: (1 if option? 'autoplay'),
510
+ loop: (1 if option? 'loop'),
511
+ controls: (0 if option? 'nocontrols')
512
+ }
513
+ "//www.youtube.com/embed/#{video_id}#{url_query params}"
514
+ else
515
+ anchor = [attr(:start), attr(:end)].join(',').chomp(',')
516
+ anchor.prepend('#t=') unless anchor.empty?
517
+ media_uri "#{attr :target}#{anchor}"
518
+ end
519
+ end
520
+
521
+ # Formats URL query parameters.
522
+ def url_query(params)
523
+ str = params.map { |k, v|
524
+ next if v.nil? || v.to_s.empty?
525
+ [k, v] * '='
526
+ }.compact.join('&amp;')
527
+
528
+ str.prepend('?') unless str.empty?
529
+ end
530
+
531
+ #--------------------------------------------------------
532
+ # document
533
+ #
534
+
535
+ ##
536
+ # @return [String, nil] the revision date in ISO 8601, or nil if not
537
+ # available or in invalid format.
538
+ def revdate_iso
539
+ ::Date.parse(revdate).iso8601
540
+ rescue ArgumentError
541
+ nil
542
+ end
543
+
544
+ ##
545
+ # Returns HTML meta tag if the given +content+ is not +nil+.
546
+ #
547
+ # @param name [#to_s] the name for the metadata.
548
+ # @param content [#to_s, nil] the value of the metadata, or +nil+.
549
+ # @return [String, nil] the meta tag, or +nil+ if the +content+ is +nil+.
550
+ #
551
+ def html_meta_if(name, content)
552
+ %(<meta name="#{name}" content="#{content}">) if content
553
+ end
554
+
555
+ # Returns formatted style/link and script tags for header.
556
+ def styles_and_scripts
557
+ scripts = []
558
+ styles = []
559
+ tags = []
560
+
561
+ stylesheet = attr :stylesheet
562
+ stylesdir = attr :stylesdir, ''
563
+ default_style = ::Asciidoctor::DEFAULT_STYLESHEET_KEYS.include? stylesheet
564
+ linkcss = attr?(:linkcss) || safe >= ::Asciidoctor::SafeMode::SECURE
565
+ ss = ::Asciidoctor::Stylesheets.instance
566
+
567
+ if linkcss
568
+ path = default_style ? ::Asciidoctor::DEFAULT_STYLESHEET_NAME : stylesheet
569
+ styles << { href: [stylesdir, path] }
570
+ elsif default_style
571
+ styles << { text: ss.primary_stylesheet_data }
572
+ else
573
+ styles << { text: read_asset(normalize_system_path(stylesheet, stylesdir), true) }
574
+ end
575
+
576
+ if attr? :icons, 'font'
577
+ if attr? 'iconfont-remote'
578
+ styles << { href: attr('iconfont-cdn', FONT_AWESOME_URI) }
579
+ else
580
+ styles << { href: [stylesdir, "#{attr 'iconfont-name', 'font-awesome'}.css"] }
581
+ end
582
+ end
583
+
584
+ if attr? 'stem'
585
+ scripts << { src: MATHJAX_JS_URI }
586
+ scripts << { type: 'text/x-mathjax-config', text: "MathJax.Hub.Config(#{MATHJAX_CONFIG});" }
587
+ end
588
+
589
+ case attr 'source-highlighter'
590
+ when 'coderay'
591
+ if attr('coderay-css', 'class') == 'class'
592
+ if linkcss
593
+ styles << { href: [stylesdir, ss.coderay_stylesheet_name] }
594
+ else
595
+ styles << { text: ss.coderay_stylesheet_data }
596
+ end
597
+ end
598
+
599
+ when 'highlightjs'
600
+ hjs_base = attr :highlightjsdir, HIGHLIGHTJS_BASE_URI
601
+ hjs_theme = attr 'highlightjs-theme', DEFAULT_HIGHLIGHTJS_THEME
602
+
603
+ scripts << { src: [hjs_base, 'highlight.min.js'] }
604
+ scripts << { src: [hjs_base, 'lang/common.min.js'] }
605
+ scripts << { text: 'hljs.initHighlightingOnLoad()' }
606
+ styles << { href: [hjs_base, "styles/#{hjs_theme}.min.css"] }
607
+ end
608
+
609
+ styles.each do |item|
610
+ if item.key?(:text)
611
+ tags << html_tag(:style) { item[:text] }
612
+ else
613
+ tags << html_tag(:link, rel: 'stylesheet', href: urlize(*item[:href]))
614
+ end
615
+ end
616
+
617
+ scripts.each do |item|
618
+ if item.key? :text
619
+ tags << html_tag(:script, type: item[:type]) { item[:text] }
620
+ else
621
+ tags << html_tag(:script, type: item[:type], src: urlize(*item[:src]))
622
+ end
623
+ end
624
+
625
+ tags.join("\n")
626
+ end
627
+
628
+ #--------------------------------------------------------
629
+ # inline_anchor
630
+ #
631
+
632
+ # @return [String] text of the xref anchor.
633
+ def xref_text
634
+ str =
635
+ if text
636
+ text
637
+ elsif (path = local_attr :path)
638
+ path
639
+ elsif document.respond_to? :catalog # Asciidoctor >=1.5.6
640
+ ref = document.catalog[:refs][attr :refid]
641
+ if ref.kind_of? Asciidoctor::AbstractNode
642
+ ref.xreftext((@_xrefstyle ||= document.attributes['xrefstyle']))
643
+ end
644
+ else # Asciidoctor < 1.5.6
645
+ document.references[:ids][attr :refid || target]
646
+ end
647
+ (str || "[#{attr :refid}]").tr_s("\n", ' ')
648
+ end
649
+
650
+ # @return [String, nil] text of the bibref anchor, or +nil+ if not found.
651
+ def bibref_text
652
+ if document.respond_to? :catalog # Asciidoctor >=1.5.6
653
+ # NOTE: Technically it should be `reftext`, but subs have already been applied to text.
654
+ text
655
+ else
656
+ "[#{target}]"
657
+ end
658
+ end
659
+
660
+ #--------------------------------------------------------
661
+ # inline_image
662
+ #
663
+
664
+ # @return [Array] style classes for a Font Awesome icon.
665
+ def icon_fa_classes
666
+ [ "fa fa-#{target}",
667
+ ("fa-#{attr :size}" if attr? :size),
668
+ ("fa-rotate-#{attr :rotate}" if attr? :rotate),
669
+ ("fa-flip-#{attr :flip}" if attr? :flip)
670
+ ].compact
671
+ end
672
+ end
673
+
674
+
675
+ # Make Helpers' constants accessible from transform methods.
676
+ Helpers.constants.each do |const|
677
+ const_set(const, Helpers.const_get(const))
678
+ end
679
+
680
+ #------------------------------- End of Helpers -------------------------------#
681
+
682
+
683
+ register_for "html5s"
684
+
685
+ def initialize(backend, opts = {})
686
+ super
687
+ basebackend "html"
688
+ outfilesuffix ".html"
689
+ filetype "html"
690
+ end
691
+
692
+ def convert(node, transform = nil, opts = {})
693
+ transform ||= node.node_name
694
+ converter = self
695
+
696
+ if opts.empty?
697
+ converter.send(transform, node)
698
+ else
699
+ converter.send(transform, node, opts)
700
+ end
701
+ end
702
+
703
+ #----------------- Begin of generated transformation methods -----------------#
704
+
705
+ def admonition(node, opts = {})
706
+ node.extend(Helpers)
707
+ node.instance_eval do
708
+ converter.set_local_variables(binding, opts) unless opts.empty?
709
+ _buf = ''
710
+ capture do
711
+ _buf << ("<h6>".freeze)
712
+ _buf << (((title || caption)).to_s)
713
+ _buf << ("</h6>".freeze)
714
+ _slim_controls1 = html_tag_if !blocks?, :p do
715
+ _slim_controls2 = ''
716
+ _slim_controls2 << ((content).to_s)
717
+ _slim_controls2
718
+ end
719
+ _buf << ((_slim_controls1).to_s)
720
+ end
721
+ if admonition_aside?
722
+ _buf << ("<aside".freeze)
723
+ _temple_html_attributeremover1 = ''
724
+ _temple_html_attributemerger1 = []
725
+ _temple_html_attributemerger1[0] = "admonitionblock"
726
+ _temple_html_attributemerger1[1] = ''
727
+ _slim_codeattributes1 = [(attr :name), role]
728
+ if Array === _slim_codeattributes1
729
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
730
+ _slim_codeattributes1.map!(&:to_s)
731
+ _slim_codeattributes1.reject!(&:empty?)
732
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
733
+ else
734
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
735
+ end
736
+ _temple_html_attributemerger1[1]
737
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
738
+ _temple_html_attributeremover1
739
+ if !_temple_html_attributeremover1.empty?
740
+ _buf << (" class=\"".freeze)
741
+ _buf << ((_temple_html_attributeremover1).to_s)
742
+ _buf << ("\"".freeze)
743
+ end
744
+ _slim_codeattributes2 = id
745
+ if _slim_codeattributes2
746
+ if _slim_codeattributes2 == true
747
+ _buf << (" id".freeze)
748
+ else
749
+ _buf << (" id=\"".freeze)
750
+ _buf << ((_slim_codeattributes2).to_s)
751
+ _buf << ("\"".freeze)
752
+ end
753
+ end
754
+ _slim_codeattributes3 = admonition_aria
755
+ if _slim_codeattributes3
756
+ if _slim_codeattributes3 == true
757
+ _buf << (" role".freeze)
758
+ else
759
+ _buf << (" role=\"".freeze)
760
+ _buf << ((_slim_codeattributes3).to_s)
761
+ _buf << ("\"".freeze)
762
+ end
763
+ end
764
+ _buf << (">".freeze)
765
+ yield_capture
766
+ _buf << ("</aside>".freeze)
767
+ else
768
+ _buf << ("<section".freeze)
769
+ _temple_html_attributeremover2 = ''
770
+ _temple_html_attributemerger2 = []
771
+ _temple_html_attributemerger2[0] = "admonitionblock"
772
+ _temple_html_attributemerger2[1] = ''
773
+ _slim_codeattributes4 = [(attr :name), role]
774
+ if Array === _slim_codeattributes4
775
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
776
+ _slim_codeattributes4.map!(&:to_s)
777
+ _slim_codeattributes4.reject!(&:empty?)
778
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes4.join(" ")).to_s)
779
+ else
780
+ _temple_html_attributemerger2[1] << ((_slim_codeattributes4).to_s)
781
+ end
782
+ _temple_html_attributemerger2[1]
783
+ _temple_html_attributeremover2 << ((_temple_html_attributemerger2.reject(&:empty?).join(" ")).to_s)
784
+ _temple_html_attributeremover2
785
+ if !_temple_html_attributeremover2.empty?
786
+ _buf << (" class=\"".freeze)
787
+ _buf << ((_temple_html_attributeremover2).to_s)
788
+ _buf << ("\"".freeze)
789
+ end
790
+ _slim_codeattributes5 = id
791
+ if _slim_codeattributes5
792
+ if _slim_codeattributes5 == true
793
+ _buf << (" id".freeze)
794
+ else
795
+ _buf << (" id=\"".freeze)
796
+ _buf << ((_slim_codeattributes5).to_s)
797
+ _buf << ("\"".freeze)
798
+ end
799
+ end
800
+ _slim_codeattributes6 = admonition_aria
801
+ if _slim_codeattributes6
802
+ if _slim_codeattributes6 == true
803
+ _buf << (" role".freeze)
804
+ else
805
+ _buf << (" role=\"".freeze)
806
+ _buf << ((_slim_codeattributes6).to_s)
807
+ _buf << ("\"".freeze)
808
+ end
809
+ end
810
+ _buf << (">".freeze)
811
+ yield_capture
812
+ _buf << ("</section>".freeze)
813
+ end
814
+ _buf
815
+ end
816
+ end
817
+
818
+ def audio(node, opts = {})
819
+ node.extend(Helpers)
820
+ node.instance_eval do
821
+ converter.set_local_variables(binding, opts) unless opts.empty?
822
+ _buf = ''
823
+ _slim_controls1 = block_with_caption :bottom, :class=>'audioblock' do
824
+ _slim_controls2 = ''
825
+ _slim_controls2 << ("<audio".freeze)
826
+ _slim_codeattributes1 = media_uri(attr :target)
827
+ if _slim_codeattributes1
828
+ if _slim_codeattributes1 == true
829
+ _slim_controls2 << (" src".freeze)
830
+ else
831
+ _slim_controls2 << (" src=\"".freeze)
832
+ _slim_controls2 << ((_slim_codeattributes1).to_s)
833
+ _slim_controls2 << ("\"".freeze)
834
+ end
835
+ end
836
+ _slim_codeattributes2 = (option? 'autoplay')
837
+ if _slim_codeattributes2
838
+ if _slim_codeattributes2 == true
839
+ _slim_controls2 << (" autoplay".freeze)
840
+ else
841
+ _slim_controls2 << (" autoplay=\"".freeze)
842
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
843
+ _slim_controls2 << ("\"".freeze)
844
+ end
845
+ end
846
+ _slim_codeattributes3 = !(option? 'nocontrols')
847
+ if _slim_codeattributes3
848
+ if _slim_codeattributes3 == true
849
+ _slim_controls2 << (" controls".freeze)
850
+ else
851
+ _slim_controls2 << (" controls=\"".freeze)
852
+ _slim_controls2 << ((_slim_codeattributes3).to_s)
853
+ _slim_controls2 << ("\"".freeze)
854
+ end
855
+ end
856
+ _slim_codeattributes4 = (option? 'loop')
857
+ if _slim_codeattributes4
858
+ if _slim_codeattributes4 == true
859
+ _slim_controls2 << (" loop".freeze)
860
+ else
861
+ _slim_controls2 << (" loop=\"".freeze)
862
+ _slim_controls2 << ((_slim_codeattributes4).to_s)
863
+ _slim_controls2 << ("\"".freeze)
864
+ end
865
+ end
866
+ _slim_controls2 << (">Your browser does not support the audio tag.</audio>".freeze)
867
+ _slim_controls2
868
+ end
869
+ _buf << ((_slim_controls1).to_s)
870
+ _buf
871
+ end
872
+ end
873
+
874
+ def colist(node, opts = {})
875
+ node.extend(Helpers)
876
+ node.instance_eval do
877
+ converter.set_local_variables(binding, opts) unless opts.empty?
878
+ _buf = ''
879
+ _buf << ("<ol".freeze)
880
+ _temple_html_attributeremover1 = ''
881
+ _temple_html_attributemerger1 = []
882
+ _temple_html_attributemerger1[0] = "colist"
883
+ _temple_html_attributemerger1[1] = ''
884
+ _slim_codeattributes1 = [style, role]
885
+ if Array === _slim_codeattributes1
886
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
887
+ _slim_codeattributes1.map!(&:to_s)
888
+ _slim_codeattributes1.reject!(&:empty?)
889
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
890
+ else
891
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
892
+ end
893
+ _temple_html_attributemerger1[1]
894
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
895
+ _temple_html_attributeremover1
896
+ if !_temple_html_attributeremover1.empty?
897
+ _buf << (" class=\"".freeze)
898
+ _buf << ((_temple_html_attributeremover1).to_s)
899
+ _buf << ("\"".freeze)
900
+ end
901
+ _slim_codeattributes2 = id
902
+ if _slim_codeattributes2
903
+ if _slim_codeattributes2 == true
904
+ _buf << (" id".freeze)
905
+ else
906
+ _buf << (" id=\"".freeze)
907
+ _buf << ((_slim_codeattributes2).to_s)
908
+ _buf << ("\"".freeze)
909
+ end
910
+ end
911
+ _buf << (">".freeze)
912
+ items.each do |item|
913
+ _buf << ("<li>".freeze)
914
+ _buf << ((item.text).to_s)
915
+ _buf << ("</li>".freeze)
916
+ end
917
+ _buf << ("</ol>".freeze)
918
+ _buf
919
+ end
920
+ end
921
+
922
+ def dlist(node, opts = {})
923
+ node.extend(Helpers)
924
+ node.instance_eval do
925
+ converter.set_local_variables(binding, opts) unless opts.empty?
926
+ _buf = ''
927
+ case style
928
+ when 'qanda'
929
+ _slim_controls1 = block_with_title :class=>'qlist qanda', :role=>'doc-qna' do
930
+ _slim_controls2 = ''
931
+ _slim_controls2 << ("<dl class=\"qanda\">".freeze)
932
+ items.each do |questions, answer|
933
+ [*questions].each do |question|
934
+ _slim_controls2 << ("<dt class=\"qanda-question\">".freeze)
935
+ _slim_controls2 << ((question.text).to_s)
936
+ _slim_controls2 << ("</dt>".freeze)
937
+ end
938
+ unless answer.nil?
939
+ _slim_controls2 << ("<dd class=\"qanda-answer\">".freeze)
940
+ if answer.text?
941
+ _slim_controls3 = html_tag_if answer.blocks?, :p do
942
+ _slim_controls4 = ''
943
+ _slim_controls4 << ((answer.text).to_s)
944
+ _slim_controls4
945
+ end
946
+ _slim_controls2 << ((_slim_controls3).to_s)
947
+ end
948
+ if answer.blocks?
949
+ _slim_controls2 << ((answer.content).to_s)
950
+ end
951
+ _slim_controls2 << ("</dd>".freeze)
952
+ end
953
+ end
954
+ _slim_controls2 << ("</dl>".freeze)
955
+ _slim_controls2
956
+ end
957
+ _buf << ((_slim_controls1).to_s)
958
+ when 'horizontal'
959
+ _slim_controls5 = block_with_title :class=>'hdlist' do
960
+ _slim_controls6 = ''
961
+ _slim_controls6 << ("<table>".freeze)
962
+ if (attr? :labelwidth) || (attr? :itemwidth)
963
+ _slim_controls6 << ("<colgroup><col".freeze)
964
+ _slim_codeattributes1 = style_value(width: [(attr :labelwidth), '%'])
965
+ if _slim_codeattributes1
966
+ if _slim_codeattributes1 == true
967
+ _slim_controls6 << (" style".freeze)
968
+ else
969
+ _slim_controls6 << (" style=\"".freeze)
970
+ _slim_controls6 << ((_slim_codeattributes1).to_s)
971
+ _slim_controls6 << ("\"".freeze)
972
+ end
973
+ end
974
+ _slim_controls6 << ("><col".freeze)
975
+ _slim_codeattributes2 = style_value(width: [(attr :itemwidth), '%'])
976
+ if _slim_codeattributes2
977
+ if _slim_codeattributes2 == true
978
+ _slim_controls6 << (" style".freeze)
979
+ else
980
+ _slim_controls6 << (" style=\"".freeze)
981
+ _slim_controls6 << ((_slim_codeattributes2).to_s)
982
+ _slim_controls6 << ("\"".freeze)
983
+ end
984
+ end
985
+ _slim_controls6 << ("></colgroup>".freeze)
986
+ end
987
+ items.each do |terms, dd|
988
+ _slim_controls6 << ("<tr><th".freeze)
989
+ _temple_html_attributeremover1 = ''
990
+ _temple_html_attributemerger1 = []
991
+ _temple_html_attributemerger1[0] = "hdlist1"
992
+ _temple_html_attributemerger1[1] = ''
993
+ _slim_codeattributes3 = ('strong' if option? 'strong')
994
+ if Array === _slim_codeattributes3
995
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
996
+ _slim_codeattributes3.map!(&:to_s)
997
+ _slim_codeattributes3.reject!(&:empty?)
998
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes3.join(" ")).to_s)
999
+ else
1000
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes3).to_s)
1001
+ end
1002
+ _temple_html_attributemerger1[1]
1003
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
1004
+ _temple_html_attributeremover1
1005
+ if !_temple_html_attributeremover1.empty?
1006
+ _slim_controls6 << (" class=\"".freeze)
1007
+ _slim_controls6 << ((_temple_html_attributeremover1).to_s)
1008
+ _slim_controls6 << ("\"".freeze)
1009
+ end
1010
+ _slim_controls6 << (">".freeze)
1011
+ terms = [*terms]
1012
+ terms.each_with_index do |dt, idx|
1013
+ _slim_controls6 << ((dt.text).to_s)
1014
+ unless idx >= terms.count - 1
1015
+ _slim_controls6 << ("<br>".freeze)
1016
+ end
1017
+ end
1018
+ _slim_controls6 << ("</th><td class=\"hdlist2\">".freeze)
1019
+ unless dd.nil?
1020
+ if dd.text?
1021
+ _slim_controls6 << ("<p>".freeze)
1022
+ _slim_controls6 << ((dd.text).to_s)
1023
+ _slim_controls6 << ("</p>".freeze)
1024
+ end
1025
+ if dd.blocks?
1026
+ _slim_controls6 << ((dd.content).to_s)
1027
+ end
1028
+ end
1029
+ _slim_controls6 << ("</td></tr>".freeze)
1030
+ end
1031
+ _slim_controls6 << ("</table>".freeze)
1032
+ _slim_controls6
1033
+ end
1034
+ _buf << ((_slim_controls5).to_s)
1035
+ else
1036
+ _slim_controls7 = block_with_title :class=>['dlist', style] do
1037
+ _slim_controls8 = ''
1038
+ _slim_controls8 << ("<dl>".freeze)
1039
+ items.each do |terms, dd|
1040
+ [*terms].each do |dt|
1041
+ _slim_controls8 << ("<dt>".freeze)
1042
+ _slim_controls8 << ((dt.text).to_s)
1043
+ _slim_controls8 << ("</dt>".freeze)
1044
+ end
1045
+ unless dd.nil?
1046
+ _slim_controls8 << ("<dd>".freeze)
1047
+ _slim_controls8 << (((print_item_content dd)).to_s)
1048
+ _slim_controls8 << ("</dd>".freeze)
1049
+ end
1050
+ end
1051
+ _slim_controls8 << ("</dl>".freeze)
1052
+ _slim_controls8
1053
+ end
1054
+ _buf << ((_slim_controls7).to_s)
1055
+ end
1056
+ _buf
1057
+ end
1058
+ end
1059
+
1060
+ def document(node, opts = {})
1061
+ node.extend(Helpers)
1062
+ node.instance_eval do
1063
+ converter.set_local_variables(binding, opts) unless opts.empty?
1064
+ _buf = ''
1065
+ _buf << ("<!DOCTYPE html><html".freeze)
1066
+ _slim_codeattributes1 = (attr :lang, 'en' unless attr? :nolang)
1067
+ if _slim_codeattributes1
1068
+ if _slim_codeattributes1 == true
1069
+ _buf << (" lang".freeze)
1070
+ else
1071
+ _buf << (" lang=\"".freeze)
1072
+ _buf << ((_slim_codeattributes1).to_s)
1073
+ _buf << ("\"".freeze)
1074
+ end
1075
+ end
1076
+ _buf << ("><head><meta".freeze)
1077
+ _slim_codeattributes2 = (attr :encoding, 'UTF-8')
1078
+ if _slim_codeattributes2
1079
+ if _slim_codeattributes2 == true
1080
+ _buf << (" charset".freeze)
1081
+ else
1082
+ _buf << (" charset=\"".freeze)
1083
+ _buf << ((_slim_codeattributes2).to_s)
1084
+ _buf << ("\"".freeze)
1085
+ end
1086
+ end
1087
+ _buf << ("><!--[if IE]><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><![endif]--><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta name=\"generator\" content=\"Asciidoctor ".freeze)
1088
+ _buf << ((attr 'asciidoctor-version').to_s)
1089
+ _buf << ("\">".freeze)
1090
+ _buf << ((html_meta_if 'application-name', (attr 'app-name')).to_s)
1091
+ _buf << ((html_meta_if 'author', (attr :authors)).to_s)
1092
+ _buf << ((html_meta_if 'copyright', (attr :copyright)).to_s)
1093
+ _buf << ((html_meta_if 'description', (attr :description)).to_s)
1094
+ _buf << ((html_meta_if 'keywords', (attr :keywords)).to_s)
1095
+ _buf << ("<title>".freeze)
1096
+ _buf << ((((doctitle sanitize: true) || (attr 'untitled-label'))).to_s)
1097
+ _buf << ("</title>".freeze)
1098
+ _buf << ((styles_and_scripts).to_s)
1099
+ unless (docinfo_content = docinfo).empty?
1100
+ _buf << ((docinfo_content).to_s)
1101
+ end
1102
+ _buf << ("</head><body".freeze)
1103
+ _slim_codeattributes3 = id
1104
+ if _slim_codeattributes3
1105
+ if _slim_codeattributes3 == true
1106
+ _buf << (" id".freeze)
1107
+ else
1108
+ _buf << (" id=\"".freeze)
1109
+ _buf << ((_slim_codeattributes3).to_s)
1110
+ _buf << ("\"".freeze)
1111
+ end
1112
+ end
1113
+ _temple_html_attributeremover1 = ''
1114
+ _slim_codeattributes4 = [(attr :doctype), ("#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}" if (attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto'))]
1115
+ if Array === _slim_codeattributes4
1116
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
1117
+ _slim_codeattributes4.map!(&:to_s)
1118
+ _slim_codeattributes4.reject!(&:empty?)
1119
+ _temple_html_attributeremover1 << ((_slim_codeattributes4.join(" ")).to_s)
1120
+ else
1121
+ _temple_html_attributeremover1 << ((_slim_codeattributes4).to_s)
1122
+ end
1123
+ _temple_html_attributeremover1
1124
+ if !_temple_html_attributeremover1.empty?
1125
+ _buf << (" class=\"".freeze)
1126
+ _buf << ((_temple_html_attributeremover1).to_s)
1127
+ _buf << ("\"".freeze)
1128
+ end
1129
+ _slim_codeattributes5 = style_value(max_width: (attr 'max-width'))
1130
+ if _slim_codeattributes5
1131
+ if _slim_codeattributes5 == true
1132
+ _buf << (" style".freeze)
1133
+ else
1134
+ _buf << (" style=\"".freeze)
1135
+ _buf << ((_slim_codeattributes5).to_s)
1136
+ _buf << ("\"".freeze)
1137
+ end
1138
+ end
1139
+ _buf << (">".freeze)
1140
+ unless noheader
1141
+ _buf << ("<header>".freeze)
1142
+ if has_header?
1143
+ unless notitle
1144
+ _buf << ("<h1>".freeze)
1145
+ _buf << ((header.title).to_s)
1146
+ _buf << ("</h1>".freeze)
1147
+ end
1148
+ if [:author, :revnumber, :revdate, :revremark].any? {|a| attr? a }
1149
+ _buf << ("<div class=\"details\">".freeze)
1150
+ if attr? :author
1151
+ _buf << ("<span class=\"author\" id=\"author\">".freeze)
1152
+ _buf << (((attr :author)).to_s)
1153
+ _buf << ("</span><br>".freeze)
1154
+ if attr? :email
1155
+ _buf << ("<span class=\"email\" id=\"email\">".freeze)
1156
+ _buf << ((sub_macros(attr :email)).to_s)
1157
+ _buf << ("</span><br>".freeze)
1158
+ end
1159
+ if (authorcount = (attr :authorcount).to_i) > 1
1160
+ (2..authorcount).each do |idx|
1161
+ _buf << ("<span class=\"author\" id=\"author".freeze)
1162
+ _buf << ((idx).to_s)
1163
+ _buf << ("\">".freeze)
1164
+ _buf << (((attr "author_#{idx}")).to_s)
1165
+ _buf << ("</span><br>".freeze)
1166
+ if attr? "email_#{idx}"
1167
+ _buf << ("<span class=\"email\" id=\"email".freeze)
1168
+ _buf << ((idx).to_s)
1169
+ _buf << ("\">".freeze)
1170
+ _buf << ((sub_macros(attr "email_#{idx}")).to_s)
1171
+ _buf << ("</span>".freeze)
1172
+ end
1173
+ end
1174
+ end
1175
+ end
1176
+ if attr? :revnumber
1177
+ _buf << ("<span id=\"revnumber\">".freeze)
1178
+ _buf << ((((attr 'version-label') || '').downcase).to_s)
1179
+ _buf << (" ".freeze)
1180
+ _buf << ((attr :revnumber).to_s)
1181
+ _buf << ((',' if attr? :revdate).to_s)
1182
+ _buf << ("</span> ".freeze)
1183
+ end
1184
+ if attr? :revdate
1185
+ _buf << ("<time id=\"revdate\"".freeze)
1186
+ _slim_codeattributes6 = revdate_iso
1187
+ if _slim_codeattributes6
1188
+ if _slim_codeattributes6 == true
1189
+ _buf << (" datetime".freeze)
1190
+ else
1191
+ _buf << (" datetime=\"".freeze)
1192
+ _buf << ((_slim_codeattributes6).to_s)
1193
+ _buf << ("\"".freeze)
1194
+ end
1195
+ end
1196
+ _buf << (">".freeze)
1197
+ _buf << (((attr :revdate)).to_s)
1198
+ _buf << ("</time>".freeze)
1199
+ end
1200
+ if attr? :revremark
1201
+ _buf << ("<br><span id=\"revremark\">".freeze)
1202
+ _buf << (((attr :revremark)).to_s)
1203
+ _buf << ("</span>".freeze)
1204
+ end
1205
+ _buf << ("</div>".freeze)
1206
+ end
1207
+ end
1208
+ if (attr? :toc) && (attr? 'toc-placement', 'auto')
1209
+ _buf << ("<nav id=\"toc\"".freeze)
1210
+ _temple_html_attributeremover2 = ''
1211
+ _slim_codeattributes7 = (attr 'toc-class', 'toc')
1212
+ if Array === _slim_codeattributes7
1213
+ _slim_codeattributes7 = _slim_codeattributes7.flatten
1214
+ _slim_codeattributes7.map!(&:to_s)
1215
+ _slim_codeattributes7.reject!(&:empty?)
1216
+ _temple_html_attributeremover2 << ((_slim_codeattributes7.join(" ")).to_s)
1217
+ else
1218
+ _temple_html_attributeremover2 << ((_slim_codeattributes7).to_s)
1219
+ end
1220
+ _temple_html_attributeremover2
1221
+ if !_temple_html_attributeremover2.empty?
1222
+ _buf << (" class=\"".freeze)
1223
+ _buf << ((_temple_html_attributeremover2).to_s)
1224
+ _buf << ("\"".freeze)
1225
+ end
1226
+ _buf << (" role=\"doc-toc\"><h2 id=\"toctitle\">".freeze)
1227
+ _buf << (((attr 'toc-title')).to_s)
1228
+ _buf << ("</h2>".freeze)
1229
+ _buf << ((converter.convert document, 'outline').to_s)
1230
+ _buf << ("</nav>".freeze)
1231
+ end
1232
+ _buf << ("</header>".freeze)
1233
+ end
1234
+ _buf << ("<div id=\"content\">".freeze)
1235
+ _buf << ((content).to_s)
1236
+ _buf << ("</div>".freeze)
1237
+ unless !footnotes? || (attr? :nofootnotes)
1238
+ _buf << ("<section class=\"footnotes\" aria-label=\"Footnotes\" role=\"doc-endnotes\"><hr><ol class=\"footnotes\">".freeze)
1239
+ footnotes.each do |fn|
1240
+ _buf << ("<li class=\"footnote\"".freeze)
1241
+ _slim_codeattributes8 = (footnote_id fn.index)
1242
+ if _slim_codeattributes8
1243
+ if _slim_codeattributes8 == true
1244
+ _buf << (" id".freeze)
1245
+ else
1246
+ _buf << (" id=\"".freeze)
1247
+ _buf << ((_slim_codeattributes8).to_s)
1248
+ _buf << ("\"".freeze)
1249
+ end
1250
+ end
1251
+ _buf << (" role=\"doc-endnote\">".freeze)
1252
+ _buf << (("#{fn.text} ").to_s)
1253
+ _buf << ("<a class=\"footnote-backref\" href=\"#".freeze)
1254
+ _buf << ((footnoteref_id fn.index).to_s)
1255
+ _buf << ("\" role=\"doc-backlink\" title=\"Jump to the first occurrence in the text\">&#8617;</a></li>".freeze)
1256
+ end
1257
+ _buf << ("</ol></section>".freeze)
1258
+ end
1259
+ unless nofooter
1260
+ _buf << ("<footer><div id=\"footer-text\">".freeze)
1261
+ if attr? :revnumber
1262
+ _buf << ((attr 'version-label').to_s)
1263
+ _buf << (" ".freeze)
1264
+ _buf << ((attr :revnumber).to_s)
1265
+ end
1266
+ if attr? 'last-update-label'
1267
+ _buf << ("<br>".freeze)
1268
+ _buf << ((attr 'last-update-label').to_s)
1269
+ _buf << (" ".freeze)
1270
+ _buf << ((attr :docdatetime).to_s)
1271
+ end
1272
+ _buf << ("</div>".freeze)
1273
+ unless (docinfo_content = (docinfo :footer)).empty?
1274
+ _buf << ((docinfo_content).to_s)
1275
+ end
1276
+ _buf << ("</footer>".freeze)
1277
+ end
1278
+ _buf << ("</body></html>".freeze)
1279
+ _buf
1280
+ end
1281
+ end
1282
+
1283
+ def embedded(node, opts = {})
1284
+ node.extend(Helpers)
1285
+ node.instance_eval do
1286
+ converter.set_local_variables(binding, opts) unless opts.empty?
1287
+ _buf = ''
1288
+ unless notitle || !has_header?
1289
+ _buf << ("<h1".freeze)
1290
+ _slim_codeattributes1 = id
1291
+ if _slim_codeattributes1
1292
+ if _slim_codeattributes1 == true
1293
+ _buf << (" id".freeze)
1294
+ else
1295
+ _buf << (" id=\"".freeze)
1296
+ _buf << ((_slim_codeattributes1).to_s)
1297
+ _buf << ("\"".freeze)
1298
+ end
1299
+ end
1300
+ _buf << (">".freeze)
1301
+ _buf << ((header.title).to_s)
1302
+ _buf << ("</h1>".freeze)
1303
+ end
1304
+ _buf << ((content).to_s)
1305
+ unless !footnotes? || (attr? :nofootnotes)
1306
+ _buf << ("<section class=\"footnotes\" aria-label=\"Footnotes\" role=\"doc-endnotes\"><hr><ol class=\"footnotes\">".freeze)
1307
+ footnotes.each do |fn|
1308
+ _buf << ("<li class=\"footnote\"".freeze)
1309
+ _slim_codeattributes2 = (footnote_id fn.index)
1310
+ if _slim_codeattributes2
1311
+ if _slim_codeattributes2 == true
1312
+ _buf << (" id".freeze)
1313
+ else
1314
+ _buf << (" id=\"".freeze)
1315
+ _buf << ((_slim_codeattributes2).to_s)
1316
+ _buf << ("\"".freeze)
1317
+ end
1318
+ end
1319
+ _buf << (" role=\"doc-endnote\">".freeze)
1320
+ _buf << (("#{fn.text} ").to_s)
1321
+ _buf << ("<a class=\"footnote-backref\" href=\"#".freeze)
1322
+ _buf << ((footnoteref_id fn.index).to_s)
1323
+ _buf << ("\" role=\"doc-backlink\" title=\"Jump to the first occurrence in the text\">&#8617;</a></li>".freeze)
1324
+ end
1325
+ _buf << ("</ol></section>".freeze)
1326
+ end
1327
+ _buf
1328
+ end
1329
+ end
1330
+
1331
+ def example(node, opts = {})
1332
+ node.extend(Helpers)
1333
+ node.instance_eval do
1334
+ converter.set_local_variables(binding, opts) unless opts.empty?
1335
+ _buf = ''
1336
+ _slim_controls1 = block_with_caption :top, :class=>'exampleblock' do
1337
+ _slim_controls2 = ''
1338
+ _slim_controls2 << ((content).to_s)
1339
+ _slim_controls2
1340
+ end
1341
+ _buf << ((_slim_controls1).to_s)
1342
+ _buf
1343
+ end
1344
+ end
1345
+
1346
+ def floating_title(node, opts = {})
1347
+ node.extend(Helpers)
1348
+ node.instance_eval do
1349
+ converter.set_local_variables(binding, opts) unless opts.empty?
1350
+ _buf = ''
1351
+ _slim_htag_filter1 = ((level + 1)).to_s
1352
+ _buf << ("<h".freeze)
1353
+ _buf << ((_slim_htag_filter1).to_s)
1354
+ _slim_codeattributes1 = id
1355
+ if _slim_codeattributes1
1356
+ if _slim_codeattributes1 == true
1357
+ _buf << (" id".freeze)
1358
+ else
1359
+ _buf << (" id=\"".freeze)
1360
+ _buf << ((_slim_codeattributes1).to_s)
1361
+ _buf << ("\"".freeze)
1362
+ end
1363
+ end
1364
+ _temple_html_attributeremover1 = ''
1365
+ _slim_codeattributes2 = [style, role]
1366
+ if Array === _slim_codeattributes2
1367
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
1368
+ _slim_codeattributes2.map!(&:to_s)
1369
+ _slim_codeattributes2.reject!(&:empty?)
1370
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
1371
+ else
1372
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
1373
+ end
1374
+ _temple_html_attributeremover1
1375
+ if !_temple_html_attributeremover1.empty?
1376
+ _buf << (" class=\"".freeze)
1377
+ _buf << ((_temple_html_attributeremover1).to_s)
1378
+ _buf << ("\"".freeze)
1379
+ end
1380
+ _buf << (">".freeze)
1381
+ _buf << ((title).to_s)
1382
+ _buf << ("</h".freeze)
1383
+ _buf << ((_slim_htag_filter1).to_s)
1384
+ _buf << (">".freeze)
1385
+ _buf
1386
+ end
1387
+ end
1388
+
1389
+ def image(node, opts = {})
1390
+ node.extend(Helpers)
1391
+ node.instance_eval do
1392
+ converter.set_local_variables(binding, opts) unless opts.empty?
1393
+ _buf = ''
1394
+ _slim_controls1 = block_with_caption :bottom, {:class=>'imageblock', :style=>style_value(text_align: (attr :align), float: (attr :float))} do
1395
+ _slim_controls2 = ''
1396
+ _slim_controls3 = html_tag_if (attr? :link), :a, {:class=>'image', :href=>(attr :link), :target=>(attr :window), :rel=>link_rel} do
1397
+ _slim_controls4 = ''
1398
+ _slim_controls4 << ("<img".freeze)
1399
+ _slim_codeattributes1 = image_uri(attr :target)
1400
+ if _slim_codeattributes1
1401
+ if _slim_codeattributes1 == true
1402
+ _slim_controls4 << (" src".freeze)
1403
+ else
1404
+ _slim_controls4 << (" src=\"".freeze)
1405
+ _slim_controls4 << ((_slim_codeattributes1).to_s)
1406
+ _slim_controls4 << ("\"".freeze)
1407
+ end
1408
+ end
1409
+ _slim_codeattributes2 = (attr :alt)
1410
+ if _slim_codeattributes2
1411
+ if _slim_codeattributes2 == true
1412
+ _slim_controls4 << (" alt".freeze)
1413
+ else
1414
+ _slim_controls4 << (" alt=\"".freeze)
1415
+ _slim_controls4 << ((_slim_codeattributes2).to_s)
1416
+ _slim_controls4 << ("\"".freeze)
1417
+ end
1418
+ end
1419
+ _slim_codeattributes3 = (attr :width)
1420
+ if _slim_codeattributes3
1421
+ if _slim_codeattributes3 == true
1422
+ _slim_controls4 << (" width".freeze)
1423
+ else
1424
+ _slim_controls4 << (" width=\"".freeze)
1425
+ _slim_controls4 << ((_slim_codeattributes3).to_s)
1426
+ _slim_controls4 << ("\"".freeze)
1427
+ end
1428
+ end
1429
+ _slim_codeattributes4 = (attr :height)
1430
+ if _slim_codeattributes4
1431
+ if _slim_codeattributes4 == true
1432
+ _slim_controls4 << (" height".freeze)
1433
+ else
1434
+ _slim_controls4 << (" height=\"".freeze)
1435
+ _slim_controls4 << ((_slim_codeattributes4).to_s)
1436
+ _slim_controls4 << ("\"".freeze)
1437
+ end
1438
+ end
1439
+ _slim_controls4 << (">".freeze)
1440
+ _slim_controls4
1441
+ end
1442
+ _slim_controls2 << ((_slim_controls3).to_s)
1443
+ _slim_controls2
1444
+ end
1445
+ _buf << ((_slim_controls1).to_s)
1446
+ _buf
1447
+ end
1448
+ end
1449
+
1450
+ def inline_anchor(node, opts = {})
1451
+ node.extend(Helpers)
1452
+ node.instance_eval do
1453
+ converter.set_local_variables(binding, opts) unless opts.empty?
1454
+ _buf = ''
1455
+ case type
1456
+ when :xref
1457
+ _buf << ("<a".freeze)
1458
+ _slim_codeattributes1 = target
1459
+ if _slim_codeattributes1
1460
+ if _slim_codeattributes1 == true
1461
+ _buf << (" href".freeze)
1462
+ else
1463
+ _buf << (" href=\"".freeze)
1464
+ _buf << ((_slim_codeattributes1).to_s)
1465
+ _buf << ("\"".freeze)
1466
+ end
1467
+ end
1468
+ _buf << (">".freeze)
1469
+ _buf << ((xref_text).to_s)
1470
+ _buf << ("</a>".freeze)
1471
+ when :ref
1472
+ _buf << ("<a".freeze)
1473
+ _slim_codeattributes2 = (id || target)
1474
+ if _slim_codeattributes2
1475
+ if _slim_codeattributes2 == true
1476
+ _buf << (" id".freeze)
1477
+ else
1478
+ _buf << (" id=\"".freeze)
1479
+ _buf << ((_slim_codeattributes2).to_s)
1480
+ _buf << ("\"".freeze)
1481
+ end
1482
+ end
1483
+ _buf << (" aria-hidden=\"true\"></a>".freeze)
1484
+ when :bibref
1485
+ _buf << ("<a".freeze)
1486
+ _slim_codeattributes3 = (id || target)
1487
+ if _slim_codeattributes3
1488
+ if _slim_codeattributes3 == true
1489
+ _buf << (" id".freeze)
1490
+ else
1491
+ _buf << (" id=\"".freeze)
1492
+ _buf << ((_slim_codeattributes3).to_s)
1493
+ _buf << ("\"".freeze)
1494
+ end
1495
+ end
1496
+ _buf << (" aria-hidden=\"true\"></a>".freeze)
1497
+ _buf << ((bibref_text).to_s)
1498
+ else
1499
+ _buf << ("<a".freeze)
1500
+ _slim_codeattributes4 = id
1501
+ if _slim_codeattributes4
1502
+ if _slim_codeattributes4 == true
1503
+ _buf << (" id".freeze)
1504
+ else
1505
+ _buf << (" id=\"".freeze)
1506
+ _buf << ((_slim_codeattributes4).to_s)
1507
+ _buf << ("\"".freeze)
1508
+ end
1509
+ end
1510
+ _temple_html_attributeremover1 = ''
1511
+ _slim_codeattributes5 = role
1512
+ if Array === _slim_codeattributes5
1513
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
1514
+ _slim_codeattributes5.map!(&:to_s)
1515
+ _slim_codeattributes5.reject!(&:empty?)
1516
+ _temple_html_attributeremover1 << ((_slim_codeattributes5.join(" ")).to_s)
1517
+ else
1518
+ _temple_html_attributeremover1 << ((_slim_codeattributes5).to_s)
1519
+ end
1520
+ _temple_html_attributeremover1
1521
+ if !_temple_html_attributeremover1.empty?
1522
+ _buf << (" class=\"".freeze)
1523
+ _buf << ((_temple_html_attributeremover1).to_s)
1524
+ _buf << ("\"".freeze)
1525
+ end
1526
+ _slim_codeattributes6 = target
1527
+ if _slim_codeattributes6
1528
+ if _slim_codeattributes6 == true
1529
+ _buf << (" href".freeze)
1530
+ else
1531
+ _buf << (" href=\"".freeze)
1532
+ _buf << ((_slim_codeattributes6).to_s)
1533
+ _buf << ("\"".freeze)
1534
+ end
1535
+ end
1536
+ _slim_codeattributes7 = (attr :window)
1537
+ if _slim_codeattributes7
1538
+ if _slim_codeattributes7 == true
1539
+ _buf << (" target".freeze)
1540
+ else
1541
+ _buf << (" target=\"".freeze)
1542
+ _buf << ((_slim_codeattributes7).to_s)
1543
+ _buf << ("\"".freeze)
1544
+ end
1545
+ end
1546
+ _slim_codeattributes8 = link_rel
1547
+ if _slim_codeattributes8
1548
+ if _slim_codeattributes8 == true
1549
+ _buf << (" rel".freeze)
1550
+ else
1551
+ _buf << (" rel=\"".freeze)
1552
+ _buf << ((_slim_codeattributes8).to_s)
1553
+ _buf << ("\"".freeze)
1554
+ end
1555
+ end
1556
+ _slim_codeattributes9 = (attr :title)
1557
+ if _slim_codeattributes9
1558
+ if _slim_codeattributes9 == true
1559
+ _buf << (" title".freeze)
1560
+ else
1561
+ _buf << (" title=\"".freeze)
1562
+ _buf << ((_slim_codeattributes9).to_s)
1563
+ _buf << ("\"".freeze)
1564
+ end
1565
+ end
1566
+ _buf << (">".freeze)
1567
+ _buf << ((text).to_s)
1568
+ _buf << ("</a>".freeze)
1569
+ end
1570
+ _buf
1571
+ end
1572
+ end
1573
+
1574
+ def inline_break(node, opts = {})
1575
+ node.extend(Helpers)
1576
+ node.instance_eval do
1577
+ converter.set_local_variables(binding, opts) unless opts.empty?
1578
+ _buf = ''
1579
+ _buf << ((text).to_s)
1580
+ _buf << ("<br>".freeze)
1581
+ _buf
1582
+ end
1583
+ end
1584
+
1585
+ def inline_button(node, opts = {})
1586
+ node.extend(Helpers)
1587
+ node.instance_eval do
1588
+ converter.set_local_variables(binding, opts) unless opts.empty?
1589
+ _buf = ''
1590
+ _buf << ("<b class=\"button\">".freeze)
1591
+ _buf << ((text).to_s)
1592
+ _buf << ("</b>".freeze)
1593
+ _buf
1594
+ end
1595
+ end
1596
+
1597
+ def inline_callout(node, opts = {})
1598
+ node.extend(Helpers)
1599
+ node.instance_eval do
1600
+ converter.set_local_variables(binding, opts) unless opts.empty?
1601
+ _buf = ''
1602
+ _buf << ("<b class=\"conum\">".freeze)
1603
+ _buf << ((text).to_s)
1604
+ _buf << ("</b>".freeze)
1605
+ _buf
1606
+ end
1607
+ end
1608
+
1609
+ def inline_footnote(node, opts = {})
1610
+ node.extend(Helpers)
1611
+ node.instance_eval do
1612
+ converter.set_local_variables(binding, opts) unless opts.empty?
1613
+ _buf = ''
1614
+ if (index = local_attr :index)
1615
+ _buf << ("<a class=\"footnote-ref\"".freeze)
1616
+ _slim_codeattributes1 = (footnoteref_id unless type == :xref)
1617
+ if _slim_codeattributes1
1618
+ if _slim_codeattributes1 == true
1619
+ _buf << (" id".freeze)
1620
+ else
1621
+ _buf << (" id=\"".freeze)
1622
+ _buf << ((_slim_codeattributes1).to_s)
1623
+ _buf << ("\"".freeze)
1624
+ end
1625
+ end
1626
+ _buf << (" href=\"#".freeze)
1627
+ _buf << ((footnote_id).to_s)
1628
+ _buf << ("\" title=\"View footnote ".freeze)
1629
+ _buf << ((index).to_s)
1630
+ _buf << ("\" role=\"doc-noteref\">[".freeze)
1631
+ _buf << ((index).to_s)
1632
+ _buf << ("]</a>".freeze)
1633
+ else
1634
+ _buf << ("<a class=\"footnote-ref broken\" title=\"Unresolved footnote reference.\">[".freeze)
1635
+ _buf << ((text).to_s)
1636
+ _buf << ("]</a>".freeze)
1637
+ end
1638
+ _buf
1639
+ end
1640
+ end
1641
+
1642
+ def inline_image(node, opts = {})
1643
+ node.extend(Helpers)
1644
+ node.instance_eval do
1645
+ converter.set_local_variables(binding, opts) unless opts.empty?
1646
+ _buf = ''
1647
+ _slim_controls1 = html_tag_if (attr? :link), :a, {:class=>'image', :href=>(attr :link), :target=>(attr :window), :rel=>link_rel} do
1648
+ _slim_controls2 = ''
1649
+ if type == 'icon' && font_icons?
1650
+ _slim_controls2 << ("<i".freeze)
1651
+ _temple_html_attributeremover1 = ''
1652
+ _slim_codeattributes1 = [*icon_fa_classes, role]
1653
+ if Array === _slim_codeattributes1
1654
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
1655
+ _slim_codeattributes1.map!(&:to_s)
1656
+ _slim_codeattributes1.reject!(&:empty?)
1657
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
1658
+ else
1659
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
1660
+ end
1661
+ _temple_html_attributeremover1
1662
+ if !_temple_html_attributeremover1.empty?
1663
+ _slim_controls2 << (" class=\"".freeze)
1664
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
1665
+ _slim_controls2 << ("\"".freeze)
1666
+ end
1667
+ _slim_codeattributes2 = (attr :title)
1668
+ if _slim_codeattributes2
1669
+ if _slim_codeattributes2 == true
1670
+ _slim_controls2 << (" title".freeze)
1671
+ else
1672
+ _slim_controls2 << (" title=\"".freeze)
1673
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
1674
+ _slim_controls2 << ("\"".freeze)
1675
+ end
1676
+ end
1677
+ _slim_controls2 << ("></i>".freeze)
1678
+ elsif type == 'icon' && !icons?
1679
+ _slim_controls2 << ("<b".freeze)
1680
+ _temple_html_attributeremover2 = ''
1681
+ _slim_codeattributes3 = ['icon', role]
1682
+ if Array === _slim_codeattributes3
1683
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
1684
+ _slim_codeattributes3.map!(&:to_s)
1685
+ _slim_codeattributes3.reject!(&:empty?)
1686
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
1687
+ else
1688
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
1689
+ end
1690
+ _temple_html_attributeremover2
1691
+ if !_temple_html_attributeremover2.empty?
1692
+ _slim_controls2 << (" class=\"".freeze)
1693
+ _slim_controls2 << ((_temple_html_attributeremover2).to_s)
1694
+ _slim_controls2 << ("\"".freeze)
1695
+ end
1696
+ _slim_codeattributes4 = (attr :title)
1697
+ if _slim_codeattributes4
1698
+ if _slim_codeattributes4 == true
1699
+ _slim_controls2 << (" title".freeze)
1700
+ else
1701
+ _slim_controls2 << (" title=\"".freeze)
1702
+ _slim_controls2 << ((_slim_codeattributes4).to_s)
1703
+ _slim_controls2 << ("\"".freeze)
1704
+ end
1705
+ end
1706
+ _slim_controls2 << (">[".freeze)
1707
+ _slim_controls2 << ((attr :alt).to_s)
1708
+ _slim_controls2 << ("]</b>".freeze)
1709
+ else
1710
+ _slim_controls2 << ("<img".freeze)
1711
+ _slim_codeattributes5 = (type == 'icon' ? (icon_uri target) : (image_uri target))
1712
+ if _slim_codeattributes5
1713
+ if _slim_codeattributes5 == true
1714
+ _slim_controls2 << (" src".freeze)
1715
+ else
1716
+ _slim_controls2 << (" src=\"".freeze)
1717
+ _slim_controls2 << ((_slim_codeattributes5).to_s)
1718
+ _slim_controls2 << ("\"".freeze)
1719
+ end
1720
+ end
1721
+ _slim_codeattributes6 = (attr :alt)
1722
+ if _slim_codeattributes6
1723
+ if _slim_codeattributes6 == true
1724
+ _slim_controls2 << (" alt".freeze)
1725
+ else
1726
+ _slim_controls2 << (" alt=\"".freeze)
1727
+ _slim_controls2 << ((_slim_codeattributes6).to_s)
1728
+ _slim_controls2 << ("\"".freeze)
1729
+ end
1730
+ end
1731
+ _slim_codeattributes7 = (attr :width)
1732
+ if _slim_codeattributes7
1733
+ if _slim_codeattributes7 == true
1734
+ _slim_controls2 << (" width".freeze)
1735
+ else
1736
+ _slim_controls2 << (" width=\"".freeze)
1737
+ _slim_controls2 << ((_slim_codeattributes7).to_s)
1738
+ _slim_controls2 << ("\"".freeze)
1739
+ end
1740
+ end
1741
+ _slim_codeattributes8 = (attr :height)
1742
+ if _slim_codeattributes8
1743
+ if _slim_codeattributes8 == true
1744
+ _slim_controls2 << (" height".freeze)
1745
+ else
1746
+ _slim_controls2 << (" height=\"".freeze)
1747
+ _slim_controls2 << ((_slim_codeattributes8).to_s)
1748
+ _slim_controls2 << ("\"".freeze)
1749
+ end
1750
+ end
1751
+ _slim_codeattributes9 = (attr :title)
1752
+ if _slim_codeattributes9
1753
+ if _slim_codeattributes9 == true
1754
+ _slim_controls2 << (" title".freeze)
1755
+ else
1756
+ _slim_controls2 << (" title=\"".freeze)
1757
+ _slim_controls2 << ((_slim_codeattributes9).to_s)
1758
+ _slim_controls2 << ("\"".freeze)
1759
+ end
1760
+ end
1761
+ _temple_html_attributeremover3 = ''
1762
+ _slim_codeattributes10 = [(type if type != 'image'), role]
1763
+ if Array === _slim_codeattributes10
1764
+ _slim_codeattributes10 = _slim_codeattributes10.flatten
1765
+ _slim_codeattributes10.map!(&:to_s)
1766
+ _slim_codeattributes10.reject!(&:empty?)
1767
+ _temple_html_attributeremover3 << ((_slim_codeattributes10.join(" ")).to_s)
1768
+ else
1769
+ _temple_html_attributeremover3 << ((_slim_codeattributes10).to_s)
1770
+ end
1771
+ _temple_html_attributeremover3
1772
+ if !_temple_html_attributeremover3.empty?
1773
+ _slim_controls2 << (" class=\"".freeze)
1774
+ _slim_controls2 << ((_temple_html_attributeremover3).to_s)
1775
+ _slim_controls2 << ("\"".freeze)
1776
+ end
1777
+ _slim_codeattributes11 = style_value(float: (attr :float))
1778
+ if _slim_codeattributes11
1779
+ if _slim_codeattributes11 == true
1780
+ _slim_controls2 << (" style".freeze)
1781
+ else
1782
+ _slim_controls2 << (" style=\"".freeze)
1783
+ _slim_controls2 << ((_slim_codeattributes11).to_s)
1784
+ _slim_controls2 << ("\"".freeze)
1785
+ end
1786
+ end
1787
+ _slim_controls2 << (">".freeze)
1788
+ end
1789
+ _slim_controls2
1790
+ end
1791
+ _buf << ((_slim_controls1).to_s)
1792
+ _buf
1793
+ end
1794
+ end
1795
+
1796
+ def inline_indexterm(node, opts = {})
1797
+ node.extend(Helpers)
1798
+ node.instance_eval do
1799
+ converter.set_local_variables(binding, opts) unless opts.empty?
1800
+ _buf = ''
1801
+ if type == :visible
1802
+ _buf << ((text).to_s)
1803
+ end
1804
+ _buf
1805
+ end
1806
+ end
1807
+
1808
+ def inline_kbd(node, opts = {})
1809
+ node.extend(Helpers)
1810
+ node.instance_eval do
1811
+ converter.set_local_variables(binding, opts) unless opts.empty?
1812
+ _buf = ''
1813
+ if (keys = attr 'keys').size == 1
1814
+ _buf << ("<kbd>".freeze)
1815
+ _buf << ((keys.first).to_s)
1816
+ _buf << ("</kbd>".freeze)
1817
+ else
1818
+ _buf << ("<kbd class=\"keyseq\">".freeze)
1819
+ keys.each_with_index do |key, idx|
1820
+ _buf << (("+" unless idx.zero?).to_s)
1821
+ _buf << ("<kbd>".freeze)
1822
+ _buf << ((key).to_s)
1823
+ _buf << ("</kbd>".freeze)
1824
+ end
1825
+ _buf << ("</kbd>".freeze)
1826
+ end
1827
+ _buf
1828
+ end
1829
+ end
1830
+
1831
+ def inline_menu(node, opts = {})
1832
+ node.extend(Helpers)
1833
+ node.instance_eval do
1834
+ converter.set_local_variables(binding, opts) unless opts.empty?
1835
+ _buf = ''
1836
+ if local_attr :menuitem
1837
+ capture do
1838
+ _buf << ("&#160;".freeze)
1839
+ if font_icons?
1840
+ _buf << ("<i class=\"fa fa-angle-right caret\"></i>".freeze)
1841
+ else
1842
+ _buf << ("<b class=\"caret\">&#8250;</b>".freeze)
1843
+ end
1844
+ end
1845
+ _buf << ("<span class=\"menuseq\"><b class=\"menu\">".freeze)
1846
+ _buf << (((attr :menu)).to_s)
1847
+ yield_capture
1848
+ _buf << ("</b>".freeze)
1849
+ (attr 'submenus').each do |submenu|
1850
+ _buf << ("<b class=\"submenu\">".freeze)
1851
+ _buf << ((submenu).to_s)
1852
+ yield_capture
1853
+ _buf << ("</b>".freeze)
1854
+ end
1855
+ _buf << ("<b class=\"menuitem\">".freeze)
1856
+ _buf << (((local_attr :menuitem)).to_s)
1857
+ _buf << ("</b></span>".freeze)
1858
+ else
1859
+ _buf << ("<b class=\"menuref\">".freeze)
1860
+ _buf << (((attr :menu)).to_s)
1861
+ _buf << ("</b>".freeze)
1862
+ end
1863
+ _buf
1864
+ end
1865
+ end
1866
+
1867
+ def inline_quoted(node, opts = {})
1868
+ node.extend(Helpers)
1869
+ node.instance_eval do
1870
+ converter.set_local_variables(binding, opts) unless opts.empty?
1871
+ _buf = ''
1872
+ unless id.nil?
1873
+ _buf << ("<a".freeze)
1874
+ _slim_codeattributes1 = id
1875
+ if _slim_codeattributes1
1876
+ if _slim_codeattributes1 == true
1877
+ _buf << (" id".freeze)
1878
+ else
1879
+ _buf << (" id=\"".freeze)
1880
+ _buf << ((_slim_codeattributes1).to_s)
1881
+ _buf << ("\"".freeze)
1882
+ end
1883
+ end
1884
+ _buf << (" aria-hidden=\"true\"></a>".freeze)
1885
+ end
1886
+ case type
1887
+ when :emphasis
1888
+ _buf << ("<em".freeze)
1889
+ _temple_html_attributeremover1 = ''
1890
+ _slim_codeattributes2 = role
1891
+ if Array === _slim_codeattributes2
1892
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
1893
+ _slim_codeattributes2.map!(&:to_s)
1894
+ _slim_codeattributes2.reject!(&:empty?)
1895
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
1896
+ else
1897
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
1898
+ end
1899
+ _temple_html_attributeremover1
1900
+ if !_temple_html_attributeremover1.empty?
1901
+ _buf << (" class=\"".freeze)
1902
+ _buf << ((_temple_html_attributeremover1).to_s)
1903
+ _buf << ("\"".freeze)
1904
+ end
1905
+ _buf << (">".freeze)
1906
+ _buf << ((text).to_s)
1907
+ _buf << ("</em>".freeze)
1908
+ when :strong
1909
+ _buf << ("<strong".freeze)
1910
+ _temple_html_attributeremover2 = ''
1911
+ _slim_codeattributes3 = role
1912
+ if Array === _slim_codeattributes3
1913
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
1914
+ _slim_codeattributes3.map!(&:to_s)
1915
+ _slim_codeattributes3.reject!(&:empty?)
1916
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
1917
+ else
1918
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
1919
+ end
1920
+ _temple_html_attributeremover2
1921
+ if !_temple_html_attributeremover2.empty?
1922
+ _buf << (" class=\"".freeze)
1923
+ _buf << ((_temple_html_attributeremover2).to_s)
1924
+ _buf << ("\"".freeze)
1925
+ end
1926
+ _buf << (">".freeze)
1927
+ _buf << ((text).to_s)
1928
+ _buf << ("</strong>".freeze)
1929
+ when :monospaced
1930
+ _buf << ("<code".freeze)
1931
+ _temple_html_attributeremover3 = ''
1932
+ _slim_codeattributes4 = role
1933
+ if Array === _slim_codeattributes4
1934
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
1935
+ _slim_codeattributes4.map!(&:to_s)
1936
+ _slim_codeattributes4.reject!(&:empty?)
1937
+ _temple_html_attributeremover3 << ((_slim_codeattributes4.join(" ")).to_s)
1938
+ else
1939
+ _temple_html_attributeremover3 << ((_slim_codeattributes4).to_s)
1940
+ end
1941
+ _temple_html_attributeremover3
1942
+ if !_temple_html_attributeremover3.empty?
1943
+ _buf << (" class=\"".freeze)
1944
+ _buf << ((_temple_html_attributeremover3).to_s)
1945
+ _buf << ("\"".freeze)
1946
+ end
1947
+ _buf << (">".freeze)
1948
+ _buf << ((text).to_s)
1949
+ _buf << ("</code>".freeze)
1950
+ when :superscript
1951
+ _buf << ("<sup".freeze)
1952
+ _temple_html_attributeremover4 = ''
1953
+ _slim_codeattributes5 = role
1954
+ if Array === _slim_codeattributes5
1955
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
1956
+ _slim_codeattributes5.map!(&:to_s)
1957
+ _slim_codeattributes5.reject!(&:empty?)
1958
+ _temple_html_attributeremover4 << ((_slim_codeattributes5.join(" ")).to_s)
1959
+ else
1960
+ _temple_html_attributeremover4 << ((_slim_codeattributes5).to_s)
1961
+ end
1962
+ _temple_html_attributeremover4
1963
+ if !_temple_html_attributeremover4.empty?
1964
+ _buf << (" class=\"".freeze)
1965
+ _buf << ((_temple_html_attributeremover4).to_s)
1966
+ _buf << ("\"".freeze)
1967
+ end
1968
+ _buf << (">".freeze)
1969
+ _buf << ((text).to_s)
1970
+ _buf << ("</sup>".freeze)
1971
+ when :subscript
1972
+ _buf << ("<sub".freeze)
1973
+ _temple_html_attributeremover5 = ''
1974
+ _slim_codeattributes6 = role
1975
+ if Array === _slim_codeattributes6
1976
+ _slim_codeattributes6 = _slim_codeattributes6.flatten
1977
+ _slim_codeattributes6.map!(&:to_s)
1978
+ _slim_codeattributes6.reject!(&:empty?)
1979
+ _temple_html_attributeremover5 << ((_slim_codeattributes6.join(" ")).to_s)
1980
+ else
1981
+ _temple_html_attributeremover5 << ((_slim_codeattributes6).to_s)
1982
+ end
1983
+ _temple_html_attributeremover5
1984
+ if !_temple_html_attributeremover5.empty?
1985
+ _buf << (" class=\"".freeze)
1986
+ _buf << ((_temple_html_attributeremover5).to_s)
1987
+ _buf << ("\"".freeze)
1988
+ end
1989
+ _buf << (">".freeze)
1990
+ _buf << ((text).to_s)
1991
+ _buf << ("</sub>".freeze)
1992
+ when :mark
1993
+ _buf << ("<mark".freeze)
1994
+ _temple_html_attributeremover6 = ''
1995
+ _slim_codeattributes7 = role
1996
+ if Array === _slim_codeattributes7
1997
+ _slim_codeattributes7 = _slim_codeattributes7.flatten
1998
+ _slim_codeattributes7.map!(&:to_s)
1999
+ _slim_codeattributes7.reject!(&:empty?)
2000
+ _temple_html_attributeremover6 << ((_slim_codeattributes7.join(" ")).to_s)
2001
+ else
2002
+ _temple_html_attributeremover6 << ((_slim_codeattributes7).to_s)
2003
+ end
2004
+ _temple_html_attributeremover6
2005
+ if !_temple_html_attributeremover6.empty?
2006
+ _buf << (" class=\"".freeze)
2007
+ _buf << ((_temple_html_attributeremover6).to_s)
2008
+ _buf << ("\"".freeze)
2009
+ end
2010
+ _buf << (">".freeze)
2011
+ _buf << ((text).to_s)
2012
+ _buf << ("</mark>".freeze)
2013
+ when :double
2014
+ _slim_controls1 = html_tag_if role?, :span, :class=>role do
2015
+ _slim_controls2 = ''
2016
+ _slim_controls2 << ("&#8220;".freeze)
2017
+ _slim_controls2 << ((text).to_s)
2018
+ _slim_controls2 << ("&#8221;".freeze)
2019
+ _slim_controls2
2020
+ end
2021
+ _buf << ((_slim_controls1).to_s)
2022
+ when :single
2023
+ _slim_controls3 = html_tag_if role?, :span, :class=>role do
2024
+ _slim_controls4 = ''
2025
+ _slim_controls4 << ("&#8216;".freeze)
2026
+ _slim_controls4 << ((text).to_s)
2027
+ _slim_controls4 << ("&#8217;".freeze)
2028
+ _slim_controls4
2029
+ end
2030
+ _buf << ((_slim_controls3).to_s)
2031
+ when :asciimath, :latexmath
2032
+ _buf << ("<span class=\"math\">".freeze)
2033
+ _buf << ((delimit_stem text, type).to_s)
2034
+ _buf << ("</span>".freeze)
2035
+ else
2036
+ _slim_controls5 = html_tag_if role?, :span, :class=>role do
2037
+ _slim_controls6 = ''
2038
+ _slim_controls6 << ((text).to_s)
2039
+ _slim_controls6
2040
+ end
2041
+ _buf << ((_slim_controls5).to_s)
2042
+ end
2043
+ _buf
2044
+ end
2045
+ end
2046
+
2047
+ def listing(node, opts = {})
2048
+ node.extend(Helpers)
2049
+ node.instance_eval do
2050
+ converter.set_local_variables(binding, opts) unless opts.empty?
2051
+ _buf = ''
2052
+ _slim_controls1 = block_with_caption :top, :class=>'listingblock' do
2053
+ _slim_controls2 = ''
2054
+ if style == 'source'
2055
+ if highlighter == 'html-pipeline'
2056
+ _slim_controls2 << ("<pre".freeze)
2057
+ _slim_codeattributes1 = source_lang
2058
+ if _slim_codeattributes1
2059
+ if _slim_codeattributes1 == true
2060
+ _slim_controls2 << (" lang".freeze)
2061
+ else
2062
+ _slim_controls2 << (" lang=\"".freeze)
2063
+ _slim_controls2 << ((_slim_codeattributes1).to_s)
2064
+ _slim_controls2 << ("\"".freeze)
2065
+ end
2066
+ end
2067
+ _slim_controls2 << ("><code>".freeze)
2068
+ _slim_controls2 << ((content).to_s)
2069
+ _slim_controls2 << ("</code></pre>".freeze)
2070
+ else
2071
+ unless highlighter == 'CodeRay'
2072
+ code_class = "language-#{source_lang}" if source_lang
2073
+ end
2074
+ _slim_controls2 << ("<pre".freeze)
2075
+ _temple_html_attributeremover1 = ''
2076
+ _slim_codeattributes2 = [highlighter, 'highlight', ('linenums' if attr? :linenums), nowrap?]
2077
+ if Array === _slim_codeattributes2
2078
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
2079
+ _slim_codeattributes2.map!(&:to_s)
2080
+ _slim_codeattributes2.reject!(&:empty?)
2081
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
2082
+ else
2083
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
2084
+ end
2085
+ _temple_html_attributeremover1
2086
+ if !_temple_html_attributeremover1.empty?
2087
+ _slim_controls2 << (" class=\"".freeze)
2088
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2089
+ _slim_controls2 << ("\"".freeze)
2090
+ end
2091
+ _slim_controls2 << ("><code".freeze)
2092
+ _temple_html_attributeremover2 = ''
2093
+ _slim_codeattributes3 = code_class
2094
+ if Array === _slim_codeattributes3
2095
+ _slim_codeattributes3 = _slim_codeattributes3.flatten
2096
+ _slim_codeattributes3.map!(&:to_s)
2097
+ _slim_codeattributes3.reject!(&:empty?)
2098
+ _temple_html_attributeremover2 << ((_slim_codeattributes3.join(" ")).to_s)
2099
+ else
2100
+ _temple_html_attributeremover2 << ((_slim_codeattributes3).to_s)
2101
+ end
2102
+ _temple_html_attributeremover2
2103
+ if !_temple_html_attributeremover2.empty?
2104
+ _slim_controls2 << (" class=\"".freeze)
2105
+ _slim_controls2 << ((_temple_html_attributeremover2).to_s)
2106
+ _slim_controls2 << ("\"".freeze)
2107
+ end
2108
+ _slim_codeattributes4 = source_lang
2109
+ if _slim_codeattributes4
2110
+ if _slim_codeattributes4 == true
2111
+ _slim_controls2 << (" data-lang".freeze)
2112
+ else
2113
+ _slim_controls2 << (" data-lang=\"".freeze)
2114
+ _slim_controls2 << ((_slim_codeattributes4).to_s)
2115
+ _slim_controls2 << ("\"".freeze)
2116
+ end
2117
+ end
2118
+ _slim_controls2 << (">".freeze)
2119
+ _slim_controls2 << ((content).to_s)
2120
+ _slim_controls2 << ("</code></pre>".freeze)
2121
+ end
2122
+ else
2123
+ _slim_controls2 << ("<pre".freeze)
2124
+ _temple_html_attributeremover3 = ''
2125
+ _slim_codeattributes5 = nowrap?
2126
+ if Array === _slim_codeattributes5
2127
+ _slim_codeattributes5 = _slim_codeattributes5.flatten
2128
+ _slim_codeattributes5.map!(&:to_s)
2129
+ _slim_codeattributes5.reject!(&:empty?)
2130
+ _temple_html_attributeremover3 << ((_slim_codeattributes5.join(" ")).to_s)
2131
+ else
2132
+ _temple_html_attributeremover3 << ((_slim_codeattributes5).to_s)
2133
+ end
2134
+ _temple_html_attributeremover3
2135
+ if !_temple_html_attributeremover3.empty?
2136
+ _slim_controls2 << (" class=\"".freeze)
2137
+ _slim_controls2 << ((_temple_html_attributeremover3).to_s)
2138
+ _slim_controls2 << ("\"".freeze)
2139
+ end
2140
+ _slim_controls2 << (">".freeze)
2141
+ _slim_controls2 << ((content).to_s)
2142
+ _slim_controls2 << ("</pre>".freeze)
2143
+ end
2144
+ if callout_list
2145
+ _slim_controls2 << ((converter.convert callout_list, 'colist').to_s)
2146
+ end
2147
+ _slim_controls2
2148
+ end
2149
+ _buf << ((_slim_controls1).to_s)
2150
+ _buf
2151
+ end
2152
+ end
2153
+
2154
+ def literal(node, opts = {})
2155
+ node.extend(Helpers)
2156
+ node.instance_eval do
2157
+ converter.set_local_variables(binding, opts) unless opts.empty?
2158
+ _buf = ''
2159
+ _slim_controls1 = block_with_title :class=>'literalblock' do
2160
+ _slim_controls2 = ''
2161
+ _slim_controls2 << ("<pre".freeze)
2162
+ _temple_html_attributeremover1 = ''
2163
+ _slim_codeattributes1 = nowrap?
2164
+ if Array === _slim_codeattributes1
2165
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2166
+ _slim_codeattributes1.map!(&:to_s)
2167
+ _slim_codeattributes1.reject!(&:empty?)
2168
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
2169
+ else
2170
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
2171
+ end
2172
+ _temple_html_attributeremover1
2173
+ if !_temple_html_attributeremover1.empty?
2174
+ _slim_controls2 << (" class=\"".freeze)
2175
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2176
+ _slim_controls2 << ("\"".freeze)
2177
+ end
2178
+ _slim_controls2 << (">".freeze)
2179
+ _slim_controls2 << ((content).to_s)
2180
+ _slim_controls2 << ("</pre>".freeze)
2181
+ _slim_controls2
2182
+ end
2183
+ _buf << ((_slim_controls1).to_s)
2184
+ _buf
2185
+ end
2186
+ end
2187
+
2188
+ def olist(node, opts = {})
2189
+ node.extend(Helpers)
2190
+ node.instance_eval do
2191
+ converter.set_local_variables(binding, opts) unless opts.empty?
2192
+ _buf = ''
2193
+ _slim_controls1 = block_with_title :class=>['olist', style] do
2194
+ _slim_controls2 = ''
2195
+ _slim_controls2 << ("<ol".freeze)
2196
+ _temple_html_attributeremover1 = ''
2197
+ _slim_codeattributes1 = style
2198
+ if Array === _slim_codeattributes1
2199
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2200
+ _slim_codeattributes1.map!(&:to_s)
2201
+ _slim_codeattributes1.reject!(&:empty?)
2202
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
2203
+ else
2204
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
2205
+ end
2206
+ _temple_html_attributeremover1
2207
+ if !_temple_html_attributeremover1.empty?
2208
+ _slim_controls2 << (" class=\"".freeze)
2209
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2210
+ _slim_controls2 << ("\"".freeze)
2211
+ end
2212
+ _slim_codeattributes2 = (attr :start)
2213
+ if _slim_codeattributes2
2214
+ if _slim_codeattributes2 == true
2215
+ _slim_controls2 << (" start".freeze)
2216
+ else
2217
+ _slim_controls2 << (" start=\"".freeze)
2218
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
2219
+ _slim_controls2 << ("\"".freeze)
2220
+ end
2221
+ end
2222
+ _slim_codeattributes3 = list_marker_keyword
2223
+ if _slim_codeattributes3
2224
+ if _slim_codeattributes3 == true
2225
+ _slim_controls2 << (" type".freeze)
2226
+ else
2227
+ _slim_controls2 << (" type=\"".freeze)
2228
+ _slim_controls2 << ((_slim_codeattributes3).to_s)
2229
+ _slim_controls2 << ("\"".freeze)
2230
+ end
2231
+ end
2232
+ _slim_codeattributes4 = (option? 'reversed')
2233
+ if _slim_codeattributes4
2234
+ if _slim_codeattributes4 == true
2235
+ _slim_controls2 << (" reversed".freeze)
2236
+ else
2237
+ _slim_controls2 << (" reversed=\"".freeze)
2238
+ _slim_controls2 << ((_slim_codeattributes4).to_s)
2239
+ _slim_controls2 << ("\"".freeze)
2240
+ end
2241
+ end
2242
+ _slim_controls2 << (">".freeze)
2243
+ items.each do |item|
2244
+ _slim_controls2 << ("<li>".freeze)
2245
+ _slim_controls2 << (((print_item_content item)).to_s)
2246
+ _slim_controls2 << ("</li>".freeze)
2247
+ end
2248
+ _slim_controls2 << ("</ol>".freeze)
2249
+ _slim_controls2
2250
+ end
2251
+ _buf << ((_slim_controls1).to_s)
2252
+ _buf
2253
+ end
2254
+ end
2255
+
2256
+ def open(node, opts = {})
2257
+ node.extend(Helpers)
2258
+ node.instance_eval do
2259
+ converter.set_local_variables(binding, opts) unless opts.empty?
2260
+ _buf = ''
2261
+ if style == 'abstract'
2262
+ if abstract_allowed?
2263
+ _slim_controls1 = block_with_title :class=>'quoteblock abstract' do
2264
+ _slim_controls2 = ''
2265
+ _slim_controls2 << ("<blockquote>".freeze)
2266
+ _slim_controls2 << ((content).to_s)
2267
+ _slim_controls2 << ("</blockquote>".freeze)
2268
+ _slim_controls2
2269
+ end
2270
+ _buf << ((_slim_controls1).to_s)
2271
+ end
2272
+ elsif style != 'partintro' || partintro_allowed?
2273
+ _slim_controls3 = block_with_title :class=>['openblock', (style if style != 'open')] do
2274
+ _slim_controls4 = ''
2275
+ _slim_controls4 << ("<div class=\"content\">".freeze)
2276
+ _slim_controls4 << ((content).to_s)
2277
+ _slim_controls4 << ("</div>".freeze)
2278
+ _slim_controls4
2279
+ end
2280
+ _buf << ((_slim_controls3).to_s)
2281
+ end
2282
+ _buf
2283
+ end
2284
+ end
2285
+
2286
+ def outline(node, opts = {})
2287
+ node.extend(Helpers)
2288
+ node.instance_eval do
2289
+ converter.set_local_variables(binding, opts) unless opts.empty?
2290
+ _buf = ''
2291
+ unless sections.empty?
2292
+ toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i
2293
+ slevel = section_level sections.first
2294
+ _buf << ("<ol class=\"sectlevel".freeze)
2295
+ _buf << ((slevel).to_s)
2296
+ _buf << ("\">".freeze)
2297
+ sections.each do |sec|
2298
+ _buf << ("<li><a href=\"#".freeze)
2299
+ _buf << ((sec.id).to_s)
2300
+ _buf << ("\">".freeze)
2301
+ _buf << ((section_title sec).to_s)
2302
+ _buf << ("</a>".freeze)
2303
+ if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline')
2304
+ _buf << ((child_toc).to_s)
2305
+ end
2306
+ _buf << ("</li>".freeze)
2307
+ end
2308
+ _buf << ("</ol>".freeze)
2309
+ end
2310
+ _buf
2311
+ end
2312
+ end
2313
+
2314
+ def page_break(node, opts = {})
2315
+ node.extend(Helpers)
2316
+ node.instance_eval do
2317
+ converter.set_local_variables(binding, opts) unless opts.empty?
2318
+ _buf = ''
2319
+ _buf << ("<div role=\"doc-pagebreak\" style=\"page-break-after: always;\"></div>".freeze)
2320
+ _buf
2321
+ end
2322
+ end
2323
+
2324
+ def paragraph(node, opts = {})
2325
+ node.extend(Helpers)
2326
+ node.instance_eval do
2327
+ converter.set_local_variables(binding, opts) unless opts.empty?
2328
+ _buf = ''
2329
+ if title?
2330
+ _buf << ("<section class=\"paragraph\"".freeze)
2331
+ _slim_codeattributes1 = id
2332
+ if _slim_codeattributes1
2333
+ if _slim_codeattributes1 == true
2334
+ _buf << (" id".freeze)
2335
+ else
2336
+ _buf << (" id=\"".freeze)
2337
+ _buf << ((_slim_codeattributes1).to_s)
2338
+ _buf << ("\"".freeze)
2339
+ end
2340
+ end
2341
+ _buf << ("><h6>".freeze)
2342
+ _buf << ((title).to_s)
2343
+ _buf << ("</h6><p".freeze)
2344
+ _temple_html_attributeremover1 = ''
2345
+ _slim_codeattributes2 = role
2346
+ if Array === _slim_codeattributes2
2347
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
2348
+ _slim_codeattributes2.map!(&:to_s)
2349
+ _slim_codeattributes2.reject!(&:empty?)
2350
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
2351
+ else
2352
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
2353
+ end
2354
+ _temple_html_attributeremover1
2355
+ if !_temple_html_attributeremover1.empty?
2356
+ _buf << (" class=\"".freeze)
2357
+ _buf << ((_temple_html_attributeremover1).to_s)
2358
+ _buf << ("\"".freeze)
2359
+ end
2360
+ _buf << (">".freeze)
2361
+ _buf << ((content).to_s)
2362
+ _buf << ("</p></section>".freeze)
2363
+ else
2364
+ _buf << ("<p".freeze)
2365
+ _slim_codeattributes3 = id
2366
+ if _slim_codeattributes3
2367
+ if _slim_codeattributes3 == true
2368
+ _buf << (" id".freeze)
2369
+ else
2370
+ _buf << (" id=\"".freeze)
2371
+ _buf << ((_slim_codeattributes3).to_s)
2372
+ _buf << ("\"".freeze)
2373
+ end
2374
+ end
2375
+ _temple_html_attributeremover2 = ''
2376
+ _slim_codeattributes4 = role
2377
+ if Array === _slim_codeattributes4
2378
+ _slim_codeattributes4 = _slim_codeattributes4.flatten
2379
+ _slim_codeattributes4.map!(&:to_s)
2380
+ _slim_codeattributes4.reject!(&:empty?)
2381
+ _temple_html_attributeremover2 << ((_slim_codeattributes4.join(" ")).to_s)
2382
+ else
2383
+ _temple_html_attributeremover2 << ((_slim_codeattributes4).to_s)
2384
+ end
2385
+ _temple_html_attributeremover2
2386
+ if !_temple_html_attributeremover2.empty?
2387
+ _buf << (" class=\"".freeze)
2388
+ _buf << ((_temple_html_attributeremover2).to_s)
2389
+ _buf << ("\"".freeze)
2390
+ end
2391
+ _buf << (">".freeze)
2392
+ _buf << ((content).to_s)
2393
+ _buf << ("</p>".freeze)
2394
+ end
2395
+ _buf
2396
+ end
2397
+ end
2398
+
2399
+ def pass(node, opts = {})
2400
+ node.extend(Helpers)
2401
+ node.instance_eval do
2402
+ converter.set_local_variables(binding, opts) unless opts.empty?
2403
+ _buf = ''
2404
+ _buf << ((content).to_s)
2405
+ _buf
2406
+ end
2407
+ end
2408
+
2409
+ def preamble(node, opts = {})
2410
+ node.extend(Helpers)
2411
+ node.instance_eval do
2412
+ converter.set_local_variables(binding, opts) unless opts.empty?
2413
+ _buf = ''
2414
+ _buf << ("<section id=\"preamble\" aria-label=\"Preamble\">".freeze)
2415
+ _buf << ((content).to_s)
2416
+ _buf << ("</section>".freeze)
2417
+ if (attr? :toc) && (attr? 'toc-placement', 'preamble')
2418
+ _buf << ("<nav id=\"toc\"".freeze)
2419
+ _temple_html_attributeremover1 = ''
2420
+ _slim_codeattributes1 = (attr 'toc-class', 'toc')
2421
+ if Array === _slim_codeattributes1
2422
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2423
+ _slim_codeattributes1.map!(&:to_s)
2424
+ _slim_codeattributes1.reject!(&:empty?)
2425
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
2426
+ else
2427
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
2428
+ end
2429
+ _temple_html_attributeremover1
2430
+ if !_temple_html_attributeremover1.empty?
2431
+ _buf << (" class=\"".freeze)
2432
+ _buf << ((_temple_html_attributeremover1).to_s)
2433
+ _buf << ("\"".freeze)
2434
+ end
2435
+ _buf << (" role=\"doc-toc\"><h2 id=\"toctitle\">".freeze)
2436
+ _buf << (((attr 'toc-title')).to_s)
2437
+ _buf << ("</h2>".freeze)
2438
+ _buf << ((converter.convert document, 'outline').to_s)
2439
+ _buf << ("</nav>".freeze)
2440
+ end
2441
+ _buf
2442
+ end
2443
+ end
2444
+
2445
+ def quote(node, opts = {})
2446
+ node.extend(Helpers)
2447
+ node.instance_eval do
2448
+ converter.set_local_variables(binding, opts) unless opts.empty?
2449
+ _buf = ''
2450
+ _slim_controls1 = block_with_title :class=>'quoteblock' do
2451
+ _slim_controls2 = ''
2452
+ _slim_controls2 << ("<blockquote>".freeze)
2453
+ _slim_controls3 = html_tag_if !blocks?, :p do
2454
+ _slim_controls4 = ''
2455
+ _slim_controls4 << ((content).to_s)
2456
+ _slim_controls4
2457
+ end
2458
+ _slim_controls2 << ((_slim_controls3).to_s)
2459
+ if attr?(:attribution) || attr?(:citetitle)
2460
+ _slim_controls2 << ("<footer>&#8212; <cite>".freeze)
2461
+ _slim_controls2 << (([(attr :attribution), (attr :citetitle)].compact.join(', ')).to_s)
2462
+ _slim_controls2 << ("</cite></footer>".freeze)
2463
+ end
2464
+ _slim_controls2 << ("</blockquote>".freeze)
2465
+ _slim_controls2
2466
+ end
2467
+ _buf << ((_slim_controls1).to_s)
2468
+ _buf
2469
+ end
2470
+ end
2471
+
2472
+ def section(node, opts = {})
2473
+ node.extend(Helpers)
2474
+ node.instance_eval do
2475
+ converter.set_local_variables(binding, opts) unless opts.empty?
2476
+ _buf = ''
2477
+ sect0 = section_level == 0
2478
+ _slim_controls1 = html_tag_if !sect0, :section, :class=>["sect#{section_level}", role] do
2479
+ _slim_controls2 = ''
2480
+ _slim_htag_filter1 = ((section_level + 1)).to_s
2481
+ _slim_controls2 << ("<h".freeze)
2482
+ _slim_controls2 << ((_slim_htag_filter1).to_s)
2483
+ _slim_codeattributes1 = id
2484
+ if _slim_codeattributes1
2485
+ if _slim_codeattributes1 == true
2486
+ _slim_controls2 << (" id".freeze)
2487
+ else
2488
+ _slim_controls2 << (" id=\"".freeze)
2489
+ _slim_controls2 << ((_slim_codeattributes1).to_s)
2490
+ _slim_controls2 << ("\"".freeze)
2491
+ end
2492
+ end
2493
+ _temple_html_attributeremover1 = ''
2494
+ _slim_codeattributes2 = ('sect0' if sect0)
2495
+ if Array === _slim_codeattributes2
2496
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
2497
+ _slim_codeattributes2.map!(&:to_s)
2498
+ _slim_codeattributes2.reject!(&:empty?)
2499
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
2500
+ else
2501
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
2502
+ end
2503
+ _temple_html_attributeremover1
2504
+ if !_temple_html_attributeremover1.empty?
2505
+ _slim_controls2 << (" class=\"".freeze)
2506
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2507
+ _slim_controls2 << ("\"".freeze)
2508
+ end
2509
+ _slim_controls2 << (">".freeze)
2510
+ if id
2511
+ if document.attr? :sectanchors
2512
+ _slim_controls2 << ("<a class=\"anchor\" href=\"#".freeze)
2513
+ _slim_controls2 << ((id).to_s)
2514
+ _slim_controls2 << ("\" aria-hidden=\"true\"></a>".freeze)
2515
+ end
2516
+ if document.attr? :sectlinks
2517
+ _slim_controls2 << ("<a class=\"link\" href=\"#".freeze)
2518
+ _slim_controls2 << ((id).to_s)
2519
+ _slim_controls2 << ("\">".freeze)
2520
+ _slim_controls2 << ((section_title).to_s)
2521
+ _slim_controls2 << ("</a>".freeze)
2522
+ else
2523
+ _slim_controls2 << ((section_title).to_s)
2524
+ end
2525
+ else
2526
+ _slim_controls2 << ((section_title).to_s)
2527
+ end
2528
+ _slim_controls2 << ("</h".freeze)
2529
+ _slim_controls2 << ((_slim_htag_filter1).to_s)
2530
+ _slim_controls2 << (">".freeze)
2531
+ _slim_controls2 << ((content).to_s)
2532
+ _slim_controls2
2533
+ end
2534
+ _buf << ((_slim_controls1).to_s)
2535
+ _buf
2536
+ end
2537
+ end
2538
+
2539
+ def sidebar(node, opts = {})
2540
+ node.extend(Helpers)
2541
+ node.instance_eval do
2542
+ converter.set_local_variables(binding, opts) unless opts.empty?
2543
+ _buf = ''
2544
+ _buf << ("<aside".freeze)
2545
+ _temple_html_attributeremover1 = ''
2546
+ _temple_html_attributemerger1 = []
2547
+ _temple_html_attributemerger1[0] = "sidebar"
2548
+ _temple_html_attributemerger1[1] = ''
2549
+ _slim_codeattributes1 = role
2550
+ if Array === _slim_codeattributes1
2551
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2552
+ _slim_codeattributes1.map!(&:to_s)
2553
+ _slim_codeattributes1.reject!(&:empty?)
2554
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s)
2555
+ else
2556
+ _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s)
2557
+ end
2558
+ _temple_html_attributemerger1[1]
2559
+ _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s)
2560
+ _temple_html_attributeremover1
2561
+ if !_temple_html_attributeremover1.empty?
2562
+ _buf << (" class=\"".freeze)
2563
+ _buf << ((_temple_html_attributeremover1).to_s)
2564
+ _buf << ("\"".freeze)
2565
+ end
2566
+ _slim_codeattributes2 = id
2567
+ if _slim_codeattributes2
2568
+ if _slim_codeattributes2 == true
2569
+ _buf << (" id".freeze)
2570
+ else
2571
+ _buf << (" id=\"".freeze)
2572
+ _buf << ((_slim_codeattributes2).to_s)
2573
+ _buf << ("\"".freeze)
2574
+ end
2575
+ end
2576
+ _buf << (">".freeze)
2577
+ if title?
2578
+ _buf << ("<h6>".freeze)
2579
+ _buf << ((title).to_s)
2580
+ _buf << ("</h6>".freeze)
2581
+ end
2582
+ _buf << ((content).to_s)
2583
+ _buf << ("</aside>".freeze)
2584
+ _buf
2585
+ end
2586
+ end
2587
+
2588
+ def stem(node, opts = {})
2589
+ node.extend(Helpers)
2590
+ node.instance_eval do
2591
+ converter.set_local_variables(binding, opts) unless opts.empty?
2592
+ _buf = ''
2593
+ _slim_controls1 = block_with_caption :top, :class=>'stemblock' do
2594
+ _slim_controls2 = ''
2595
+ _slim_controls2 << ("<div class=\"math\">".freeze)
2596
+ _slim_controls2 << (((delimit_stem content, style)).to_s)
2597
+ _slim_controls2 << ("</div>".freeze)
2598
+ _slim_controls2
2599
+ end
2600
+ _buf << ((_slim_controls1).to_s)
2601
+ _buf
2602
+ end
2603
+ end
2604
+
2605
+ def table(node, opts = {})
2606
+ node.extend(Helpers)
2607
+ node.instance_eval do
2608
+ converter.set_local_variables(binding, opts) unless opts.empty?
2609
+ _buf = ''
2610
+ _slim_controls1 = block_with_caption :top, :class=>'tableblock' do
2611
+ _slim_controls2 = ''
2612
+ _slim_controls2 << ("<table".freeze)
2613
+ _temple_html_attributeremover1 = ''
2614
+ _slim_codeattributes1 = ["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", spread?]
2615
+ if Array === _slim_codeattributes1
2616
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2617
+ _slim_codeattributes1.map!(&:to_s)
2618
+ _slim_codeattributes1.reject!(&:empty?)
2619
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
2620
+ else
2621
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
2622
+ end
2623
+ _temple_html_attributeremover1
2624
+ if !_temple_html_attributeremover1.empty?
2625
+ _slim_controls2 << (" class=\"".freeze)
2626
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2627
+ _slim_controls2 << ("\"".freeze)
2628
+ end
2629
+ _slim_codeattributes2 = style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !spread? || (local_attr :width)),
2630
+ float: (attr :float))
2631
+ if _slim_codeattributes2
2632
+ if _slim_codeattributes2 == true
2633
+ _slim_controls2 << (" style".freeze)
2634
+ else
2635
+ _slim_controls2 << (" style=\"".freeze)
2636
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
2637
+ _slim_controls2 << ("\"".freeze)
2638
+ end
2639
+ end
2640
+ _slim_controls2 << (">".freeze)
2641
+ unless (attr :rowcount).zero?
2642
+ _slim_controls2 << ("<colgroup>".freeze)
2643
+ if autowidth?
2644
+ columns.each do
2645
+ _slim_controls2 << ("<col>".freeze)
2646
+ end
2647
+ else
2648
+ columns.each do |col|
2649
+ _slim_controls2 << ("<col style=\"width: ".freeze)
2650
+ _slim_controls2 << ((col.attr :colpcwidth).to_s)
2651
+ _slim_controls2 << ("%;\">".freeze)
2652
+ end
2653
+ end
2654
+ _slim_controls2 << ("</colgroup>".freeze)
2655
+ [:head, :foot, :body].reject { |tblsec| rows[tblsec].empty? }.each do |tblsec|
2656
+ _slim_controls2 << ("<t".freeze)
2657
+ _slim_controls2 << ((tblsec).to_s)
2658
+ _slim_controls2 << (">".freeze)
2659
+ rows[tblsec].each do |row|
2660
+ _slim_controls2 << ("<tr>".freeze)
2661
+ row.each do |cell|
2662
+ _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
2663
+ :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
2664
+ :colspan=>cell.colspan,
2665
+ :rowspan=>cell.rowspan,
2666
+ :style=>style_value(background_color: (document.attr :cellbgcolor))) do
2667
+ _slim_controls4 = ''
2668
+ if tblsec == :head
2669
+ _slim_controls4 << ((cell.text).to_s)
2670
+ else
2671
+ case cell.style
2672
+ when :asciidoc
2673
+ _slim_controls4 << ((cell.content).to_s)
2674
+ when :verse
2675
+ _slim_controls4 << ("<div class=\"verse\"><pre>".freeze)
2676
+ _slim_controls4 << ((cell.text).to_s)
2677
+ _slim_controls4 << ("</pre></div>".freeze)
2678
+ when :literal
2679
+ _slim_controls4 << ("<div class=\"literal\"><pre>".freeze)
2680
+ _slim_controls4 << ((cell.text).to_s)
2681
+ _slim_controls4 << ("</pre></div>".freeze)
2682
+ else
2683
+ if cell.content.one?
2684
+ _slim_controls4 << ((cell.content.first).to_s)
2685
+ else
2686
+ cell.content.each do |text|
2687
+ _slim_controls4 << ("<p>".freeze)
2688
+ _slim_controls4 << ((text).to_s)
2689
+ _slim_controls4 << ("</p>".freeze)
2690
+ end
2691
+ end
2692
+ end
2693
+ end
2694
+ _slim_controls4
2695
+ end
2696
+ _slim_controls2 << ((_slim_controls3).to_s)
2697
+ end
2698
+ _slim_controls2 << ("</tr>".freeze)
2699
+ end
2700
+ end
2701
+ end
2702
+ _slim_controls2 << ("</table>".freeze)
2703
+ _slim_controls2
2704
+ end
2705
+ _buf << ((_slim_controls1).to_s)
2706
+ _buf
2707
+ end
2708
+ end
2709
+
2710
+ def thematic_break(node, opts = {})
2711
+ node.extend(Helpers)
2712
+ node.instance_eval do
2713
+ converter.set_local_variables(binding, opts) unless opts.empty?
2714
+ _buf = ''
2715
+ _buf << ("<hr>".freeze)
2716
+ _buf
2717
+ end
2718
+ end
2719
+
2720
+ def toc(node, opts = {})
2721
+ node.extend(Helpers)
2722
+ node.instance_eval do
2723
+ converter.set_local_variables(binding, opts) unless opts.empty?
2724
+ _buf = ''
2725
+ if document.attr? :toc
2726
+ toc_id = id || ('toc' if document.embedded? || !document.attr?('toc-placement'))
2727
+ _buf << ("<nav".freeze)
2728
+ _slim_codeattributes1 = toc_id
2729
+ if _slim_codeattributes1
2730
+ if _slim_codeattributes1 == true
2731
+ _buf << (" id".freeze)
2732
+ else
2733
+ _buf << (" id=\"".freeze)
2734
+ _buf << ((_slim_codeattributes1).to_s)
2735
+ _buf << ("\"".freeze)
2736
+ end
2737
+ end
2738
+ _temple_html_attributeremover1 = ''
2739
+ _slim_codeattributes2 = (attr :role, (document.attr 'toc-class', 'toc'))
2740
+ if Array === _slim_codeattributes2
2741
+ _slim_codeattributes2 = _slim_codeattributes2.flatten
2742
+ _slim_codeattributes2.map!(&:to_s)
2743
+ _slim_codeattributes2.reject!(&:empty?)
2744
+ _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s)
2745
+ else
2746
+ _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s)
2747
+ end
2748
+ _temple_html_attributeremover1
2749
+ if !_temple_html_attributeremover1.empty?
2750
+ _buf << (" class=\"".freeze)
2751
+ _buf << ((_temple_html_attributeremover1).to_s)
2752
+ _buf << ("\"".freeze)
2753
+ end
2754
+ _buf << (">".freeze)
2755
+ _slim_htag_filter1 = ((section_level + 2)).to_s
2756
+ _buf << ("<h".freeze)
2757
+ _buf << ((_slim_htag_filter1).to_s)
2758
+ _slim_codeattributes3 = ("#{toc_id}title" if toc_id)
2759
+ if _slim_codeattributes3
2760
+ if _slim_codeattributes3 == true
2761
+ _buf << (" id".freeze)
2762
+ else
2763
+ _buf << (" id=\"".freeze)
2764
+ _buf << ((_slim_codeattributes3).to_s)
2765
+ _buf << ("\"".freeze)
2766
+ end
2767
+ end
2768
+ _buf << (">".freeze)
2769
+ _buf << (((title || (document.attr 'toc-title'))).to_s)
2770
+ _buf << ("</h".freeze)
2771
+ _buf << ((_slim_htag_filter1).to_s)
2772
+ _buf << (">".freeze)
2773
+ _buf << ((converter.convert document, 'outline', :toclevels=>((attr :levels).to_i if attr? :levels)).to_s)
2774
+ _buf << ("</nav>".freeze)
2775
+ end
2776
+ _buf
2777
+ end
2778
+ end
2779
+
2780
+ def ulist(node, opts = {})
2781
+ node.extend(Helpers)
2782
+ node.instance_eval do
2783
+ converter.set_local_variables(binding, opts) unless opts.empty?
2784
+ _buf = ''
2785
+ checklist = 'task-list' if option? 'checklist'
2786
+ _slim_controls1 = block_with_title :class=>['ulist', style] do
2787
+ _slim_controls2 = ''
2788
+ _slim_controls2 << ("<ul".freeze)
2789
+ _temple_html_attributeremover1 = ''
2790
+ _slim_codeattributes1 = (checklist || style)
2791
+ if Array === _slim_codeattributes1
2792
+ _slim_codeattributes1 = _slim_codeattributes1.flatten
2793
+ _slim_codeattributes1.map!(&:to_s)
2794
+ _slim_codeattributes1.reject!(&:empty?)
2795
+ _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s)
2796
+ else
2797
+ _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s)
2798
+ end
2799
+ _temple_html_attributeremover1
2800
+ if !_temple_html_attributeremover1.empty?
2801
+ _slim_controls2 << (" class=\"".freeze)
2802
+ _slim_controls2 << ((_temple_html_attributeremover1).to_s)
2803
+ _slim_controls2 << ("\"".freeze)
2804
+ end
2805
+ _slim_controls2 << (">".freeze)
2806
+ items.each do |item|
2807
+ if checklist && (item.attr? :checkbox)
2808
+ _slim_controls2 << ("<li class=\"task-list-item\"><input class=\"task-list-item-checkbox\" type=\"checkbox\" disabled".freeze)
2809
+ _slim_codeattributes2 = (item.attr? :checked)
2810
+ if _slim_codeattributes2
2811
+ if _slim_codeattributes2 == true
2812
+ _slim_controls2 << (" checked".freeze)
2813
+ else
2814
+ _slim_controls2 << (" checked=\"".freeze)
2815
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
2816
+ _slim_controls2 << ("\"".freeze)
2817
+ end
2818
+ end
2819
+ _slim_controls2 << ("> ".freeze)
2820
+ _slim_controls2 << ((item.text).to_s)
2821
+ _slim_controls2 << ("</li>".freeze)
2822
+ else
2823
+ _slim_controls2 << ("<li>".freeze)
2824
+ _slim_controls2 << (((print_item_content item)).to_s)
2825
+ _slim_controls2 << ("</li>".freeze)
2826
+ end
2827
+ end
2828
+ _slim_controls2 << ("</ul>".freeze)
2829
+ _slim_controls2
2830
+ end
2831
+ _buf << ((_slim_controls1).to_s)
2832
+ _buf
2833
+ end
2834
+ end
2835
+
2836
+ def verse(node, opts = {})
2837
+ node.extend(Helpers)
2838
+ node.instance_eval do
2839
+ converter.set_local_variables(binding, opts) unless opts.empty?
2840
+ _buf = ''
2841
+ _slim_controls1 = block_with_title :class=>'verseblock' do
2842
+ _slim_controls2 = ''
2843
+ if attr?(:attribution) || attr?(:citetitle)
2844
+ _slim_controls2 << ("<blockquote class=\"verse\"><pre class=\"verse\">".freeze)
2845
+ _slim_controls2 << ((content).to_s)
2846
+ _slim_controls2 << ("</pre><footer>&#8212; <cite>".freeze)
2847
+ _slim_controls2 << (([(attr :attribution), (attr :citetitle)].compact.join(', ')).to_s)
2848
+ _slim_controls2 << ("</cite></footer></blockquote>".freeze)
2849
+ else
2850
+ _slim_controls2 << ("<pre class=\"verse\">".freeze)
2851
+ _slim_controls2 << ((content).to_s)
2852
+ _slim_controls2 << ("</pre>".freeze)
2853
+ end
2854
+ _slim_controls2
2855
+ end
2856
+ _buf << ((_slim_controls1).to_s)
2857
+ _buf
2858
+ end
2859
+ end
2860
+
2861
+ def video(node, opts = {})
2862
+ node.extend(Helpers)
2863
+ node.instance_eval do
2864
+ converter.set_local_variables(binding, opts) unless opts.empty?
2865
+ _buf = ''
2866
+ _slim_controls1 = block_with_caption :bottom, :class=>'videoblock' do
2867
+ _slim_controls2 = ''
2868
+ if video_iframe?
2869
+ _slim_controls2 << ("<iframe".freeze)
2870
+ _slim_codeattributes1 = video_uri
2871
+ if _slim_codeattributes1
2872
+ if _slim_codeattributes1 == true
2873
+ _slim_controls2 << (" src".freeze)
2874
+ else
2875
+ _slim_controls2 << (" src=\"".freeze)
2876
+ _slim_controls2 << ((_slim_codeattributes1).to_s)
2877
+ _slim_controls2 << ("\"".freeze)
2878
+ end
2879
+ end
2880
+ _slim_codeattributes2 = (attr :width)
2881
+ if _slim_codeattributes2
2882
+ if _slim_codeattributes2 == true
2883
+ _slim_controls2 << (" width".freeze)
2884
+ else
2885
+ _slim_controls2 << (" width=\"".freeze)
2886
+ _slim_controls2 << ((_slim_codeattributes2).to_s)
2887
+ _slim_controls2 << ("\"".freeze)
2888
+ end
2889
+ end
2890
+ _slim_codeattributes3 = (attr :height)
2891
+ if _slim_codeattributes3
2892
+ if _slim_codeattributes3 == true
2893
+ _slim_controls2 << (" height".freeze)
2894
+ else
2895
+ _slim_controls2 << (" height=\"".freeze)
2896
+ _slim_controls2 << ((_slim_codeattributes3).to_s)
2897
+ _slim_controls2 << ("\"".freeze)
2898
+ end
2899
+ end
2900
+ _slim_codeattributes4 = 0
2901
+ if _slim_codeattributes4
2902
+ if _slim_codeattributes4 == true
2903
+ _slim_controls2 << (" frameborder".freeze)
2904
+ else
2905
+ _slim_controls2 << (" frameborder=\"".freeze)
2906
+ _slim_controls2 << ((_slim_codeattributes4).to_s)
2907
+ _slim_controls2 << ("\"".freeze)
2908
+ end
2909
+ end
2910
+ _slim_codeattributes5 = !(option? 'nofullscreen')
2911
+ if _slim_codeattributes5
2912
+ if _slim_codeattributes5 == true
2913
+ _slim_controls2 << (" allowfullscreen".freeze)
2914
+ else
2915
+ _slim_controls2 << (" allowfullscreen=\"".freeze)
2916
+ _slim_controls2 << ((_slim_codeattributes5).to_s)
2917
+ _slim_controls2 << ("\"".freeze)
2918
+ end
2919
+ end
2920
+ _slim_controls2 << ("></iframe>".freeze)
2921
+ else
2922
+ _slim_controls2 << ("<video".freeze)
2923
+ _slim_codeattributes6 = video_uri
2924
+ if _slim_codeattributes6
2925
+ if _slim_codeattributes6 == true
2926
+ _slim_controls2 << (" src".freeze)
2927
+ else
2928
+ _slim_controls2 << (" src=\"".freeze)
2929
+ _slim_controls2 << ((_slim_codeattributes6).to_s)
2930
+ _slim_controls2 << ("\"".freeze)
2931
+ end
2932
+ end
2933
+ _slim_codeattributes7 = (attr :width)
2934
+ if _slim_codeattributes7
2935
+ if _slim_codeattributes7 == true
2936
+ _slim_controls2 << (" width".freeze)
2937
+ else
2938
+ _slim_controls2 << (" width=\"".freeze)
2939
+ _slim_controls2 << ((_slim_codeattributes7).to_s)
2940
+ _slim_controls2 << ("\"".freeze)
2941
+ end
2942
+ end
2943
+ _slim_codeattributes8 = (attr :height)
2944
+ if _slim_codeattributes8
2945
+ if _slim_codeattributes8 == true
2946
+ _slim_controls2 << (" height".freeze)
2947
+ else
2948
+ _slim_controls2 << (" height=\"".freeze)
2949
+ _slim_controls2 << ((_slim_codeattributes8).to_s)
2950
+ _slim_controls2 << ("\"".freeze)
2951
+ end
2952
+ end
2953
+ _slim_codeattributes9 = (media_uri(attr :poster) if attr? :poster)
2954
+ if _slim_codeattributes9
2955
+ if _slim_codeattributes9 == true
2956
+ _slim_controls2 << (" poster".freeze)
2957
+ else
2958
+ _slim_controls2 << (" poster=\"".freeze)
2959
+ _slim_controls2 << ((_slim_codeattributes9).to_s)
2960
+ _slim_controls2 << ("\"".freeze)
2961
+ end
2962
+ end
2963
+ _slim_codeattributes10 = (option? 'autoplay')
2964
+ if _slim_codeattributes10
2965
+ if _slim_codeattributes10 == true
2966
+ _slim_controls2 << (" autoplay".freeze)
2967
+ else
2968
+ _slim_controls2 << (" autoplay=\"".freeze)
2969
+ _slim_controls2 << ((_slim_codeattributes10).to_s)
2970
+ _slim_controls2 << ("\"".freeze)
2971
+ end
2972
+ end
2973
+ _slim_codeattributes11 = !(option? 'nocontrols')
2974
+ if _slim_codeattributes11
2975
+ if _slim_codeattributes11 == true
2976
+ _slim_controls2 << (" controls".freeze)
2977
+ else
2978
+ _slim_controls2 << (" controls=\"".freeze)
2979
+ _slim_controls2 << ((_slim_codeattributes11).to_s)
2980
+ _slim_controls2 << ("\"".freeze)
2981
+ end
2982
+ end
2983
+ _slim_codeattributes12 = (option? 'loop')
2984
+ if _slim_codeattributes12
2985
+ if _slim_codeattributes12 == true
2986
+ _slim_controls2 << (" loop".freeze)
2987
+ else
2988
+ _slim_controls2 << (" loop=\"".freeze)
2989
+ _slim_controls2 << ((_slim_codeattributes12).to_s)
2990
+ _slim_controls2 << ("\"".freeze)
2991
+ end
2992
+ end
2993
+ _slim_controls2 << (">Your browser does not support the video tag.</video>".freeze)
2994
+ end
2995
+ _slim_controls2
2996
+ end
2997
+ _buf << ((_slim_controls1).to_s)
2998
+ _buf
2999
+ end
3000
+ end
3001
+ #------------------ End of generated transformation methods ------------------#
3002
+
3003
+ def set_local_variables(binding, vars)
3004
+ vars.each do |key, val|
3005
+ binding.local_variable_set(key.to_sym, val)
3006
+ end
3007
+ end
3008
+
3009
+ end