From 8f45cb83d9ab74b98c881f3e39f0db94dbd32fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tama?= Date: Tue, 3 Dec 2024 19:43:05 +0100 Subject: [PATCH] Prepare 5.2.0 (#537) --- CHANGELOG.md | 15 +- lib/asciidoctor-revealjs/converter.rb | 1513 +++++++++++++------------ 2 files changed, 770 insertions(+), 758 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16633306..834cf238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ For a detailed view of what has changed, refer to the [commit history](https://g ## master (unreleased) +## 5.2 (2024-02-12) + +### Enhancements + + * Iterating through callouts + * Upgrade to pkg 5.8.1 + +### Bug Fixes + + * Fix data-fragment-index on code block (#532) + ## 5.1.0 (2023-12-12) ### Enhancements @@ -20,7 +31,7 @@ For a detailed view of what has changed, refer to the [commit history](https://g ### Upgrade considerations - * Plugin `marked` has been removed in reveal.js 4.0.0 and plugin `markdown` has been disabled. + * Plugin `marked` has been removed in reveal.js 4.0.0 and plugin `markdown` has been disabled. As a result, the `revealjs_plugin_markdown` and `revealjs_plugin_marked` attributes have no effect anymore. * `revealjs_plugins` and `revealjs_plugins_configuration` are replaced by [Docinfo files](https://docs.asciidoctor.org/asciidoctor/latest/docinfo/). @@ -101,7 +112,7 @@ _presentation-docinfo-footer.html_ * Upgrade development dependencies * Bump `path-parse` from 1.0.6 to 1.0.7 in /test/js-babel * Bump `path-parse` from 1.0.6 to 1.0.7 - * Bump `glob-parent` from 5.1.0 to 5.1.2 + * Bump `glob-parent` from 5.1.0 to 5.1.2 * Bump `lodash` from 4.17.19 to 4.17.21 in /test/js-babel * Bump `y18n` from 4.0.0 to 4.0.1 * Drop `thread_safe` and `concurrent-ruby` dependencies diff --git a/lib/asciidoctor-revealjs/converter.rb b/lib/asciidoctor-revealjs/converter.rb index 32c4fb1d..202257e3 100644 --- a/lib/asciidoctor-revealjs/converter.rb +++ b/lib/asciidoctor-revealjs/converter.rb @@ -515,71 +515,125 @@ def convert(node, transform = nil, opts = {}) #----------------- Begin of generated transformation methods -----------------# - def convert_admonition(node, opts = {}) + def convert_notes(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); - ; _buf << (""); - ; else; - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['admonitionblock', (attr :name), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << ("
"); - ; - ; if @document.attr? :icons, 'font'; - ; icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning']; - ; _slim_controls2 << (""); - ; elsif @document.attr? :icons; - ; _slim_controls2 << (""); + _buf = ''; _buf << ("".freeze); _buf + end + end + + def convert_inline_anchor(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; case @type; + ; when :xref; + ; refid = (attr :refid) || @target; + ; _slim_controls1 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << (((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')).to_s); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); when :ref; + ; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s); + ; when :bibref; + ; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s); + ; _buf << ("[".freeze); _buf << ((@target).to_s); _buf << ("]".freeze); ; else; - ; _slim_controls2 << ("
"); _slim_controls2 << ((attr :textlabel) || @caption); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << (content); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; _buf = _buf.join("") + ; _slim_controls3 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact, :target => (attr :window), 'data-preview-link' => (bool_data_attr :preview) }.merge(data_attrs(@attributes))) do; _slim_controls4 = ''; + ; _slim_controls4 << ((@text).to_s); + ; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf end end - def convert_audio(node, opts = {}) + def convert_ruler(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _buf << ("
".freeze); + ; _buf + end + end + + def convert_stem(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['audioblock', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; + _buf = ''; open, close = Asciidoctor::BLOCK_MATH_DELIMITERS[@style.to_sym]; + ; equation = content.strip; + ; if (@subs.nil? || @subs.empty?) && !(attr? 'subs'); + ; equation = sub_specialcharacters equation; + ; end; unless (equation.start_with? open) && (equation.end_with? close); + ; equation = %(#{open}#{equation}#{close}); + ; end; _slim_controls1 = html_tag('div', { :id => @id, :class => ['stemblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (captioned_title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
Your browser does not support the audio tag.
"); + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((equation).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_embedded(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; unless notitle || !has_header?; + ; _buf << ("".freeze); _buf << ((@header.title).to_s); + ; _buf << ("".freeze); end; _buf << ((content).to_s); + ; unless !footnotes? || attr?(:nofootnotes); + ; _buf << ("

".freeze); ; - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; footnotes.each do |fn|; + ; _buf << ("
".freeze); _buf << ((fn.index).to_s); _buf << (". ".freeze); _buf << ((fn.text).to_s); + ; _buf << ("
".freeze); end; _buf << ("
".freeze); end; _buf end end - def convert_colist(node, opts = {}) + def convert_ulist(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['colist', @style, role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; if @document.attr? :icons; - ; font_icons = @document.attr? :icons, 'font'; - ; _slim_controls2 << (""); - ; items.each_with_index do |item, i|; - ; num = i + 1; - ; _slim_controls2 << (""); end; _slim_controls2 << ("
"); + _buf = ''; if (checklist = (option? :checklist) ? 'checklist' : nil); + ; if option? :interactive; + ; marker_checked = ''; + ; marker_unchecked = ''; + ; else; + ; if @document.attr? :icons, 'font'; + ; marker_checked = ''; + ; marker_unchecked = ''; + ; else; ; - ; if font_icons; - ; _slim_controls2 << (""); - ; _slim_controls2 << (num); - ; _slim_controls2 << (""); else; - ; _slim_controls2 << (""); - ; end; _slim_controls2 << (""); _slim_controls2 << (item.text); - ; _slim_controls2 << ("
"); else; - ; _slim_controls2 << ("
    "); + ; marker_checked = ''; + ; marker_unchecked = ''; + ; end; end; end; _slim_controls1 = html_tag('div', { :id => @id, :class => ['ulist', checklist, @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
    ".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
    ".freeze); end; _slim_controls2 << ("".freeze); ; items.each do |item|; - ; _slim_controls2 << ("
  1. "); _slim_controls2 << (item.text); - ; _slim_controls2 << ("

  2. "); end; _slim_controls2 << ("
"); end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _slim_controls2 << ("

".freeze); + ; + ; if checklist && (item.attr? :checkbox); + ; _slim_controls2 << ((%(#{(item.attr? :checked) ? marker_checked : marker_unchecked}#{item.text})).to_s); + ; else; + ; _slim_controls2 << ((item.text).to_s); + ; end; _slim_controls2 << ("

".freeze); if item.blocks?; + ; _slim_controls2 << ((item.content).to_s); + ; end; _slim_controls2 << ("".freeze); end; _slim_controls2 << ("".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_paragraph(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['paragraph', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; if has_role? 'small'; + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("".freeze); else; + ; _slim_controls2 << ("

".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("

".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end @@ -587,60 +641,293 @@ def convert_dlist(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; case @style; + _buf = ''; case @style; ; when 'qanda'; - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['qlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['qlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
    "); + ; _slim_controls2 << ("
    ".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
    ".freeze); end; _slim_controls2 << ("
      ".freeze); ; items.each do |questions, answer|; - ; _slim_controls2 << ("
    1. "); + ; _slim_controls2 << ("
    2. ".freeze); ; [*questions].each do |question|; - ; _slim_controls2 << ("

      "); _slim_controls2 << (question.text); - ; _slim_controls2 << ("

      "); end; unless answer.nil?; + ; _slim_controls2 << ("

      ".freeze); _slim_controls2 << ((question.text).to_s); + ; _slim_controls2 << ("

      ".freeze); end; unless answer.nil?; ; if answer.text?; - ; _slim_controls2 << ("

      "); _slim_controls2 << (answer.text); - ; _slim_controls2 << ("

      "); end; if answer.blocks?; - ; _slim_controls2 << (answer.content); - ; end; end; _slim_controls2 << ("
    3. "); end; _slim_controls2 << ("
    "); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); when 'horizontal'; - ; _slim_controls3 = html_tag('div', { :id => @id, :class => ['hdlist', role] }.merge(data_attrs(@attributes))) do; _slim_controls4 = []; + ; _slim_controls2 << ("

    ".freeze); _slim_controls2 << ((answer.text).to_s); + ; _slim_controls2 << ("

    ".freeze); end; if answer.blocks?; + ; _slim_controls2 << ((answer.content).to_s); + ; end; end; _slim_controls2 << ("".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); when 'horizontal'; + ; _slim_controls3 = html_tag('div', { :id => @id, :class => ['hdlist', role] }.merge(data_attrs(@attributes))) do; _slim_controls4 = ''; ; if title?; - ; _slim_controls4 << ("
"); _slim_controls4 << (title); - ; _slim_controls4 << ("
"); end; _slim_controls4 << (""); + ; _slim_controls4 << ("
".freeze); _slim_controls4 << ((title).to_s); + ; _slim_controls4 << ("
".freeze); end; _slim_controls4 << ("
".freeze); ; if (attr? :labelwidth) || (attr? :itemwidth); - ; _slim_controls4 << (""); + ; _slim_controls4 << ("".freeze); ; end; items.each do |terms, dd|; - ; _slim_controls4 << (""); + ; _slim_controls4 << ("".freeze); ; terms = [*terms]; ; last_term = terms.last; ; terms.each do |dt|; - ; _slim_controls4 << (dt.text); + ; _slim_controls4 << ((dt.text).to_s); ; if dt != last_term; - ; _slim_controls4 << ("
"); - ; end; end; _slim_controls4 << ("
"); end; _slim_controls4 << ("
"); + ; _slim_controls4 << ("
".freeze); + ; end; end; _slim_controls4 << ("
".freeze); ; unless dd.nil?; ; if dd.text?; - ; _slim_controls4 << ("

"); _slim_controls4 << (dd.text); - ; _slim_controls4 << ("

"); end; if dd.blocks?; - ; _slim_controls4 << (dd.content); - ; end; end; _slim_controls4 << ("
"); _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); else; - ; _slim_controls5 = html_tag('div', { :id => @id, :class => ['dlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls6 = []; + ; _slim_controls4 << ("

".freeze); _slim_controls4 << ((dd.text).to_s); + ; _slim_controls4 << ("

".freeze); end; if dd.blocks?; + ; _slim_controls4 << ((dd.content).to_s); + ; end; end; _slim_controls4 << ("".freeze); end; _slim_controls4 << ("".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else; + ; _slim_controls5 = html_tag('div', { :id => @id, :class => ['dlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls6 = ''; ; if title?; - ; _slim_controls6 << ("
"); _slim_controls6 << (title); - ; _slim_controls6 << ("
"); end; _slim_controls6 << ("
"); + ; _slim_controls6 << ("
".freeze); _slim_controls6 << ((title).to_s); + ; _slim_controls6 << ("
".freeze); end; _slim_controls6 << ("
".freeze); ; items.each do |terms, dd|; ; [*terms].each do |dt|; - ; _slim_controls6 << (""); _slim_controls6 << (dt.text); - ; _slim_controls6 << (""); end; unless dd.nil?; - ; _slim_controls6 << ("
"); + ; _slim_controls6 << ("".freeze); _slim_controls6 << ((dt.text).to_s); + ; _slim_controls6 << ("".freeze); end; unless dd.nil?; + ; _slim_controls6 << ("
".freeze); ; if dd.text?; - ; _slim_controls6 << ("

"); _slim_controls6 << (dd.text); - ; _slim_controls6 << ("

"); end; if dd.blocks?; - ; _slim_controls6 << (dd.content); - ; end; _slim_controls6 << ("
"); end; end; _slim_controls6 << ("
"); _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); end; _buf = _buf.join("") + ; _slim_controls6 << ("

".freeze); _slim_controls6 << ((dd.text).to_s); + ; _slim_controls6 << ("

".freeze); end; if dd.blocks?; + ; _slim_controls6 << ((dd.content).to_s); + ; end; _slim_controls6 << ("".freeze); end; end; _slim_controls6 << ("
".freeze); _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf + end + end + + def convert_audio(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['audioblock', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((captioned_title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
Your browser does not support the audio tag.
".freeze); + ; + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_image(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; unless attributes[1] == 'background' || attributes[1] == 'canvas'; + ; inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; '); + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ((convert_image).to_s); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); if title?; + ; _buf << ("
".freeze); _buf << ((captioned_title).to_s); + ; _buf << ("
".freeze); end; end; _buf + end + end + + def convert_toc(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; _buf << ("
".freeze); + ; _buf << (((document.attr 'toc-title')).to_s); + ; _buf << ("
".freeze); + ; _buf << ((converter.convert document, 'outline').to_s); + ; _buf << ("
".freeze); _buf + end + end + + def convert_inline_kbd(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; if (keys = attr 'keys').size == 1; + ; _slim_controls1 = html_tag('kbd', data_attrs(@attributes)) do; _slim_controls2 = ''; + ; _slim_controls2 << ((keys.first).to_s); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else; + ; _slim_controls3 = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = ''; + ; keys.each_with_index do |key, idx|; + ; unless idx.zero?; + ; _slim_controls4 << ("+".freeze); + ; end; _slim_controls4 << ("".freeze); _slim_controls4 << ((key).to_s); + ; _slim_controls4 << ("".freeze); end; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf + end + end + + def convert_title_slide(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil; + ; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; + ; _buf << ("".freeze); + ; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?; + ; _buf << ("

".freeze); _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s); + ; _buf << ("

".freeze); _buf << ((slice_text _title_obj.subtitle, _slice).to_s); + ; _buf << ("

".freeze); else; + ; _buf << ("

".freeze); _buf << ((@header.title).to_s); + ; _buf << ("

".freeze); end; preamble = @document.find_by context: :preamble; + ; unless preamble.nil? or preamble.length == 0; + ; _buf << ("
".freeze); _buf << ((preamble.pop.content).to_s); + ; _buf << ("
".freeze); end; _buf << ((generate_authors(@document)).to_s); + ; _buf << ("".freeze); _buf + end + end + + def convert_inline_quoted(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sub' }; + ; if (quote_tag = quote_tags[@type]); + ; _buf << ((html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)).to_s); + ; else; + ; case @type; + ; when :double; + ; _buf << ((inline_text_container("“#{@text}”")).to_s); + ; when :single; + ; _buf << ((inline_text_container("‘#{@text}’")).to_s); + ; when :asciimath, :latexmath; + ; open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]; + ; _buf << ((inline_text_container("#{open}#{@text}#{close}")).to_s); + ; else; + ; _buf << ((inline_text_container(@text)).to_s); + ; end; end; _buf + end + end + + def convert_inline_callout(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; if @document.attr? :icons, 'font'; + ; _buf << ("".freeze); + ; _buf << (("(#{@text})").to_s); + ; _buf << ("".freeze); elsif @document.attr? :icons; + ; _buf << ("".freeze); + ; else; + ; _buf << ("".freeze); _buf << (("(#{@text})").to_s); + ; _buf << ("".freeze); end; _buf + end + end + + def convert_floating_title(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_htag_filter1 = ((level + 1)).to_s; _buf << ("".freeze); + ; _buf << ((title).to_s); + ; _buf << ("".freeze); _buf + end + end + + def convert_table(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))]; + ; styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; '); + ; _slim_controls1 = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((captioned_title).to_s); + ; _slim_controls2 << ("".freeze); end; unless (attr :rowcount).zero?; + ; _slim_controls2 << ("".freeze); + ; if option? 'autowidth'; + ; @columns.each do; + ; _slim_controls2 << ("".freeze); + ; end; else; + ; @columns.each do |col|; + ; _slim_controls2 << ("".freeze); + ; end; end; _slim_controls2 << ("".freeze); [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|; + ; + ; _slim_controls2 << ("".freeze); + ; @rows[tblsec].each do |row|; + ; _slim_controls2 << ("".freeze); + ; row.each do |cell|; + ; + ; if tblsec == :head; + ; cell_content = cell.text; + ; else; + ; case cell.style; + ; when :literal; + ; cell_content = cell.text; + ; else; + ; cell_content = cell.content; + ; end; end; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td', + :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"], + :colspan=>cell.colspan, :rowspan=>cell.rowspan, + :style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do; _slim_controls4 = ''; + ; if tblsec == :head; + ; _slim_controls4 << ((cell_content).to_s); + ; else; + ; case cell.style; + ; when :asciidoc; + ; _slim_controls4 << ("
".freeze); _slim_controls4 << ((cell_content).to_s); + ; _slim_controls4 << ("
".freeze); when :literal; + ; _slim_controls4 << ("
".freeze); _slim_controls4 << ((cell_content).to_s); 
+      ; _slim_controls4 << ("
".freeze); when :header; + ; cell_content.each do |text|; + ; _slim_controls4 << ("

".freeze); _slim_controls4 << ((text).to_s); + ; _slim_controls4 << ("

".freeze); end; else; + ; cell_content.each do |text|; + ; _slim_controls4 << ("

".freeze); _slim_controls4 << ((text).to_s); + ; _slim_controls4 << ("

".freeze); end; end; end; _slim_controls4; end; _slim_controls2 << ((_slim_controls3).to_s); end; _slim_controls2 << ("".freeze); end; end; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_outline(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; unless sections.empty?; + ; toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i; + ; slevel = section_level sections.first; + ; _buf << ("
    ".freeze); + ; sections.each do |sec|; + ; _buf << ("
  1. ".freeze); _buf << ((section_title sec).to_s); + ; _buf << ("".freeze); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline'); + ; _buf << ((child_toc).to_s); + ; end; _buf << ("
  2. ".freeze); end; _buf << ("
".freeze); end; _buf + end + end + + def convert_inline_button(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('b', { :class => ['button'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ((@text).to_s); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end @@ -648,11 +935,11 @@ def convert_document(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; slides_content = self.content; + _buf = ''; slides_content = self.content; ; content_for :slides do; ; unless noheader; ; unless (header_docinfo = docinfo :header, '-revealjs.html').empty?; - ; _buf << (header_docinfo); + ; _buf << ((header_docinfo).to_s); ; end; if header?; ; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil; ; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil; @@ -671,30 +958,30 @@ def convert_document(node, opts = {}) ; ; ; - ; _buf << (""); + ; _buf << ("".freeze); ; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?; - ; _buf << ("

"); _buf << (slice_text _title_obj.title, (_slice = header.option? :slice)); - ; _buf << ("

"); _buf << (slice_text _title_obj.subtitle, _slice); - ; _buf << ("

"); else; - ; _buf << ("

"); _buf << (@header.title); - ; _buf << ("

"); end; preamble = @document.find_by context: :preamble; + ; _buf << ("

".freeze); _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s); + ; _buf << ("

".freeze); _buf << ((slice_text _title_obj.subtitle, _slice).to_s); + ; _buf << ("

".freeze); else; + ; _buf << ("

".freeze); _buf << ((@header.title).to_s); + ; _buf << ("

".freeze); end; preamble = @document.find_by context: :preamble; ; unless preamble.nil? or preamble.length == 0; - ; _buf << ("
"); _buf << (preamble.pop.content); - ; _buf << ("
"); end; _buf << (generate_authors(@document)); - ; _buf << (""); - ; end; end; _buf << (slides_content); + ; _buf << ("
".freeze); _buf << ((preamble.pop.content).to_s); + ; _buf << ("
".freeze); end; _buf << ((generate_authors(@document)).to_s); + ; _buf << ("".freeze); + ; end; end; _buf << ((slides_content).to_s); ; unless (footer_docinfo = docinfo :footer, '-revealjs.html').empty?; - ; _buf << (footer_docinfo); + ; _buf << ((footer_docinfo).to_s); ; - ; end; end; _buf << (""); + ; end; end; _buf << ("<!DOCTYPE html><html".freeze); + ; _slim_codeattributes16 = (attr :lang, 'en' unless attr? :nolang); if _slim_codeattributes16; if _slim_codeattributes16 == true; _buf << (" lang".freeze); else; _buf << (" lang=\"".freeze); _buf << ((_slim_codeattributes16).to_s); _buf << ("\"".freeze); end; end; _buf << ("><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui\"><title>".freeze); ; ; ; ; - ; _buf << ((doctitle sanitize: true, use_fallback: true)); + ; _buf << (((doctitle sanitize: true, use_fallback: true)).to_s); ; - ; _buf << (""); if RUBY_ENGINE == 'opal' && JAVASCRIPT_PLATFORM == 'node'; + ; _buf << ("".freeze); if RUBY_ENGINE == 'opal' && JAVASCRIPT_PLATFORM == 'node'; ; revealjsdir = (attr :revealjsdir, 'node_modules/reveal.js'); ; else; ; revealjsdir = (attr :revealjsdir, 'reveal.js'); @@ -703,7 +990,7 @@ def convert_document(node, opts = {}) ; end; cdn_base = %(#{asset_uri_scheme}//cdnjs.cloudflare.com/ajax/libs); ; [:description, :keywords, :author, :copyright].each do |key|; ; if attr? key; - ; _buf << (""); + ; _buf << ("".freeze); ; end; end; if attr? 'favicon'; ; if (icon_href = attr 'favicon').empty?; ; icon_href = 'favicon.ico'; @@ -712,13 +999,13 @@ def convert_document(node, opts = {}) ; icon_type = icon_ext == '.ico' ? 'image/x-icon' : %(image/#{icon_ext.slice 1, icon_ext.length}); ; else; ; icon_type = 'image/x-icon'; - ; end; _buf << (""); + ; end; _buf << ("".freeze); ; end; linkcss = (attr? 'linkcss'); - ; _buf << (""); + ; _slim_codeattributes19 = (attr :revealjs_customtheme, %(#{revealjsdir}/dist/theme/#{attr 'revealjs_theme', 'black'}.css)); if _slim_codeattributes19; if _slim_codeattributes19 == true; _buf << (" href".freeze); else; _buf << (" href=\"".freeze); _buf << ((_slim_codeattributes19).to_s); _buf << ("\"".freeze); end; end; _buf << (" id=\"theme\">".freeze); ; ; ; @@ -726,28 +1013,28 @@ def convert_document(node, opts = {}) ; ; if attr? 'iconfont-remote'; ; if (iconfont_cdn = (attr 'iconfont-cdn')); - ; _buf << (""); + ; _buf << ("".freeze); ; else; ; ; font_awesome_version = (attr 'font-awesome-version', '5.15.1'); - ; _buf << (""); + ; _buf << ("".freeze); ; end; else; - ; _buf << (""); - ; end; end; _buf << (generate_stem(cdn_base)); + ; _buf << ("".freeze); + ; end; end; _buf << ((generate_stem(cdn_base)).to_s); ; syntax_hl = self.syntax_highlighter; ; if syntax_hl && (syntax_hl.docinfo? :head); - ; _buf << (syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/'); + ; _buf << ((syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/').to_s); ; end; if attr? :customcss; - ; _buf << (""); + ; _buf << ("".freeze); ; end; unless (_docinfo = docinfo :head, '-revealjs.html').empty?; - ; _buf << (_docinfo); - ; end; _buf << ("
"); + ; _buf << ((_docinfo).to_s); + ; end; _buf << ("
".freeze); ; ; ; ; yield_content :slides; - ; _buf << ("
"); + ; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});".freeze); ; ; ; if syntax_hl && (syntax_hl.docinfo? :footer); - ; _buf << (syntax_hl.docinfo :footer, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/'); + ; _buf << ((syntax_hl.docinfo :footer, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/').to_s); ; ; end; unless (docinfo_content = (docinfo :footer, '.html')).empty?; - ; _buf << (docinfo_content); - ; end; _buf << (""); _buf = _buf.join("") + ; _buf << ((docinfo_content).to_s); + ; end; _buf << ("".freeze); _buf end end - def convert_embedded(node, opts = {}) + def convert_inline_menu(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; unless notitle || !has_header?; - ; _buf << (""); _buf << (@header.title); - ; _buf << (""); end; _buf << (content); - ; unless !footnotes? || attr?(:nofootnotes); - ; _buf << ("

"); - ; - ; footnotes.each do |fn|; - ; _buf << ("
"); _buf << (fn.index); _buf << (". "); _buf << (fn.text); - ; _buf << ("
"); end; _buf << ("
"); end; _buf = _buf.join("") + _buf = ''; menu = attr 'menu'; + ; menuitem = attr 'menuitem'; + ; if !(submenus = attr 'submenus').empty?; + ; _slim_controls1 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((menu).to_s); + ; _slim_controls2 << (" ▸ ".freeze); + ; _slim_controls2 << ((submenus.map {|submenu| %(#{submenu} ▸ ) }.join).to_s); + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((menuitem).to_s); + ; _slim_controls2 << ("".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); elsif !menuitem.nil?; + ; _slim_controls3 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = ''; + ; _slim_controls4 << ("".freeze); _slim_controls4 << ((menu).to_s); + ; _slim_controls4 << (" ▸ ".freeze); + ; _slim_controls4 << ((menuitem).to_s); + ; _slim_controls4 << ("".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else; + ; _slim_controls5 = html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes))) do; _slim_controls6 = ''; + ; _slim_controls6 << ((menu).to_s); + ; _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf end end - def convert_example(node, opts = {}) + def convert_admonition(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['exampleblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; + _buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); + ; _buf << ("".freeze); + ; else; + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['admonitionblock', (attr :name), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ("
".freeze); + ; + ; if @document.attr? :icons, 'font'; + ; icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning']; + ; _slim_controls2 << ("".freeze); + ; elsif @document.attr? :icons; + ; _slim_controls2 << ("".freeze); + ; else; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << (((attr :textlabel) || @caption).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (captioned_title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (content); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf end end - def convert_floating_title(node, opts = {}) + def convert_open(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_htag_filter1 = ((level + 1)).to_s; _buf << (""); - ; _buf << (title); - ; _buf << (""); _buf = _buf.join("") + _buf = ''; if @style == 'abstract'; + ; if @parent == @document && @document.doctype == 'book'; + ; puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'; + ; else; + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book'); + ; puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\'s a child of a book part. Excluding block content.'; + ; else; + ; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); + ; _buf << ("".freeze); + ; else; + ; _slim_controls3 = html_tag('div', { :id => @id, :class => ['openblock', (@style != 'open' ? @style : nil), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls4 = ''; + ; if title?; + ; _slim_controls4 << ("
".freeze); _slim_controls4 << ((title).to_s); + ; _slim_controls4 << ("
".freeze); end; _slim_controls4 << ("
".freeze); _slim_controls4 << ((content).to_s); + ; _slim_controls4 << ("
".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; end; _buf end end - def convert_image(node, opts = {}) + def convert_inline_footnote(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; unless attributes[1] == 'background' || attributes[1] == 'canvas'; - ; inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; '); - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << (convert_image); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); if title?; - ; _buf << ("
"); _buf << (captioned_title); - ; _buf << ("
"); end; end; _buf = _buf.join("") + _buf = ''; footnote = slide_footnote(self); + ; index = footnote.attr(:index); + ; id = footnote.id; + ; if @type == :xref; + ; _slim_controls1 = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ("[".freeze); + ; _slim_controls2 << ((index).to_s); + ; _slim_controls2 << ("]".freeze); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else; + ; _slim_controls3 = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls4 = ''; + ; _slim_controls4 << ("[".freeze); + ; _slim_controls4 << ((index).to_s); + ; _slim_controls4 << ("]".freeze); + ; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf end end - def convert_inline_anchor(node, opts = {}) + def convert_verse(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; case @type; - ; when :xref; - ; refid = (attr :refid) || @target; - ; _slim_controls1 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << ((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); when :ref; - ; _buf << (html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))); - ; when :bibref; - ; _buf << (html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))); - ; _buf << ("["); _buf << (@target); _buf << ("]"); - ; else; - ; _slim_controls3 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact, :target => (attr :window), 'data-preview-link' => (bool_data_attr :preview) }.merge(data_attrs(@attributes))) do; _slim_controls4 = []; - ; _slim_controls4 << (@text); - ; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); end; _buf = _buf.join("") - end - end - - def convert_inline_break(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << (@text); - ; _buf << ("
"); - ; _buf = _buf.join("") + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['verseblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((content).to_s); 
+      ; _slim_controls2 << ("
".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil; + ; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil; + ; if attribution || citetitle; + ; _slim_controls2 << ("
".freeze); + ; if citetitle; + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((citetitle).to_s); + ; _slim_controls2 << ("".freeze); end; if attribution; + ; if citetitle; + ; _slim_controls2 << ("
".freeze); + ; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s); + ; end; _slim_controls2 << ("
".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end - def convert_inline_button(node, opts = {}) + def convert_quote(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('b', { :class => ['button'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << (@text); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil; + ; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil; + ; if attribution || citetitle; + ; _slim_controls2 << ("
".freeze); + ; if citetitle; + ; _slim_controls2 << ("".freeze); _slim_controls2 << ((citetitle).to_s); + ; _slim_controls2 << ("".freeze); end; if attribution; + ; if citetitle; + ; _slim_controls2 << ("
".freeze); + ; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s); + ; end; _slim_controls2 << ("
".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end - def convert_inline_callout(node, opts = {}) + def convert_video(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if @document.attr? :icons, 'font'; - ; _buf << (""); - ; _buf << ("(#{@text})"); - ; _buf << (""); elsif @document.attr? :icons; - ; _buf << (""); + _buf = ''; + ; + ; no_stretch = ((attr? :width) || (attr? :height)); + ; width = (attr? :width) ? (attr :width) : "100%"; + ; height = (attr? :height) ? (attr :height) : "100%"; + ; + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['videoblock', @style, role, (no_stretch ? nil : 'stretch'), ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((captioned_title).to_s); + ; _slim_controls2 << ("
".freeze); end; case attr :poster; + ; when 'vimeo'; + ; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?; + ; asset_uri_scheme = %(#{asset_uri_scheme}:); + ; end; start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil; + ; delimiter = ['?']; + ; loop_param = (option? 'loop') ? %(#{delimiter.pop || '&'}loop=1) : ''; + ; muted_param = (option? 'muted') ? %(#{delimiter.pop || '&'}muted=1) : ''; + ; src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{loop_param}#{muted_param}#{start_anchor}); + ; + ; + ; + ; + ; + ; _slim_controls2 << ("".freeze); + ; when 'youtube'; + ; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?; + ; asset_uri_scheme = %(#{asset_uri_scheme}:); + ; end; params = ['rel=0']; + ; params << "start=#{attr :start}" if attr? :start; + ; params << "end=#{attr :end}" if attr? :end; + ; params << "loop=1" if option? 'loop'; + ; params << "mute=1" if option? 'muted'; + ; params << "controls=0" if option? 'nocontrols'; + ; src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&'}); + ; + ; + ; + ; + ; + ; _slim_controls2 << ("".freeze); ; else; - ; _buf << (""); _buf << ("(#{@text})"); - ; _buf << (""); end; _buf = _buf.join("") - end - end - - def convert_inline_footnote(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; footnote = slide_footnote(self); - ; index = footnote.attr(:index); - ; id = footnote.id; - ; if @type == :xref; - ; _slim_controls1 = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << ("["); - ; _slim_controls2 << (index); - ; _slim_controls2 << ("]"); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); else; - ; _slim_controls3 = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls4 = []; - ; _slim_controls4 << ("["); - ; _slim_controls4 << (index); - ; _slim_controls4 << ("]"); - ; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); end; _buf = _buf.join("") - end - end - - def convert_inline_image(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('span', { :class => [@type, role, ('fragment' if (option? :step) || (attr? 'step'))], :style => ("float: #{attr :float}" if attr? :float) }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << (convert_inline_image); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_inline_indexterm(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if @type == :visible; - ; _buf << (@text); - ; end; _buf = _buf.join("") + ; + ; + ; + ; _slim_controls2 << ("Your browser does not support the video tag.".freeze); + ; + ; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end - def convert_inline_kbd(node, opts = {}) + def convert_thematic_break(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if (keys = attr 'keys').size == 1; - ; _slim_controls1 = html_tag('kbd', data_attrs(@attributes)) do; _slim_controls2 = []; - ; _slim_controls2 << (keys.first); - ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); else; - ; _slim_controls3 = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = []; - ; keys.each_with_index do |key, idx|; - ; unless idx.zero?; - ; _slim_controls4 << ("+"); - ; end; _slim_controls4 << (""); _slim_controls4 << (key); - ; _slim_controls4 << (""); end; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); end; _buf = _buf.join("") + _buf = ''; _buf << ("
".freeze); + ; _buf end end - def convert_inline_menu(node, opts = {}) + def convert_preamble(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; menu = attr 'menu'; - ; menuitem = attr 'menuitem'; - ; if !(submenus = attr 'submenus').empty?; - ; _slim_controls1 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << (""); _slim_controls2 << (menu); - ; _slim_controls2 << (" ▸ "); - ; _slim_controls2 << (submenus.map {|submenu| %(#{submenu} ▸ ) }.join); - ; _slim_controls2 << (""); _slim_controls2 << (menuitem); - ; _slim_controls2 << (""); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); elsif !menuitem.nil?; - ; _slim_controls3 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = []; - ; _slim_controls4 << (""); _slim_controls4 << (menu); - ; _slim_controls4 << (" ▸ "); - ; _slim_controls4 << (menuitem); - ; _slim_controls4 << (""); _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); else; - ; _slim_controls5 = html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes))) do; _slim_controls6 = []; - ; _slim_controls6 << (menu); - ; _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); end; _buf = _buf.join("") + _buf = ''; + ; + ; _buf end end - def convert_inline_quoted(node, opts = {}) + def convert_sidebar(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sub' }; - ; if (quote_tag = quote_tags[@type]); - ; _buf << (html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)); - ; else; - ; case @type; - ; when :double; - ; _buf << (inline_text_container("“#{@text}”")); - ; when :single; - ; _buf << (inline_text_container("‘#{@text}’")); - ; when :asciimath, :latexmath; - ; open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]; - ; _buf << (inline_text_container("#{open}#{@text}#{close}")); + _buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); + ; _buf << ("".freeze); ; else; - ; _buf << (inline_text_container(@text)); - ; end; end; _buf = _buf.join("") + ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['sidebarblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ("
".freeze); + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf end end @@ -1207,7 +1513,7 @@ def convert_listing(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; nowrap = (option? 'nowrap') || !(document.attr? 'prewrap'); + _buf = ''; nowrap = (option? 'nowrap') || !(document.attr? 'prewrap'); ; if @style == 'source'; ; syntax_hl = document.syntax_highlighter; ; lang = attr :language; @@ -1218,42 +1524,31 @@ def convert_listing(node, opts = {}) ; opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {}; ; opts[:nowrap] = nowrap; ; end; - ; end; _slim_controls1 = html_tag('div', { :id => id, :class => ['listingblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes.reject {|key, _| key == 'data-id' }))) do; _slim_controls2 = []; + ; end; _slim_controls1 = html_tag('div', { :id => id, :class => ['listingblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes.reject {|key, _| key == 'data-id' }))) do; _slim_controls2 = ''; ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (captioned_title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((captioned_title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); ; if syntax_hl; - ; _slim_controls2 << ((syntax_hl.format self, lang, opts)); + ; _slim_controls2 << (((syntax_hl.format self, lang, opts)).to_s); ; else; ; if @style == 'source'; - ; _slim_controls2 << (""); - ; _slim_controls2 << (content || ''); - ; _slim_controls2 << (""); else; - ; _slim_controls2 << (""); - ; _slim_controls2 << (content || ''); - ; _slim_controls2 << (""); end; end; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _slim_controls2 << ("".freeze); + ; _slim_controls2 << ((content || '').to_s); + ; _slim_controls2 << ("".freeze); else; + ; _slim_controls2 << ("".freeze); + ; _slim_controls2 << ((content || '').to_s); + ; _slim_controls2 << ("".freeze); end; end; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end - def convert_literal(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (content); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_notes(node, opts = {}) + def convert_inline_indexterm(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << (""); _buf = _buf.join("") + _buf = ''; if @type == :visible; + ; _buf << ((@text).to_s); + ; end; _buf end end @@ -1261,84 +1556,16 @@ def convert_olist(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << (""); + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("".freeze); ; items.each do |item|; - ; _slim_controls2 << ("

"); - ; _slim_controls2 << (item.text); - ; _slim_controls2 << ("

"); if item.blocks?; - ; _slim_controls2 << (item.content); - ; end; _slim_controls2 << (""); end; _slim_controls2 << (""); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_open(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if @style == 'abstract'; - ; if @parent == @document && @document.doctype == 'book'; - ; puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'; - ; else; - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (content); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book'); - ; puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\'s a child of a book part. Excluding block content.'; - ; else; - ; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); - ; _buf << (""); - ; else; - ; _slim_controls3 = html_tag('div', { :id => @id, :class => ['openblock', (@style != 'open' ? @style : nil), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls4 = []; - ; if title?; - ; _slim_controls4 << ("
"); _slim_controls4 << (title); - ; _slim_controls4 << ("
"); end; _slim_controls4 << ("
"); _slim_controls4 << (content); - ; _slim_controls4 << ("
"); _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); end; end; _buf = _buf.join("") - end - end - - def convert_outline(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; unless sections.empty?; - ; toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i; - ; slevel = section_level sections.first; - ; _buf << ("
    "); - ; sections.each do |sec|; - ; _buf << ("
  1. "); _buf << (section_title sec); - ; _buf << (""); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline'); - ; _buf << (child_toc); - ; end; _buf << ("
  2. "); end; _buf << ("
"); end; _buf = _buf.join("") - end - end - - def convert_page_break(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << ("
"); - ; _buf = _buf.join("") - end - end - - def convert_paragraph(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['paragraph', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; if has_role? 'small'; - ; _slim_controls2 << (""); _slim_controls2 << (content); - ; _slim_controls2 << (""); else; - ; _slim_controls2 << ("

"); _slim_controls2 << (content); - ; _slim_controls2 << ("

"); end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _slim_controls2 << ("

".freeze); + ; _slim_controls2 << ((item.text).to_s); + ; _slim_controls2 << ("

".freeze); if item.blocks?; + ; _slim_controls2 << ((item.content).to_s); + ; end; _slim_controls2 << ("".freeze); end; _slim_controls2 << ("".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end @@ -1346,84 +1573,37 @@ def convert_pass(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << (content); - ; _buf = _buf.join("") - end - end - - def convert_preamble(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; - ; - ; _buf = _buf.join("") - end - end - - def convert_quote(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (content); - ; _slim_controls2 << ("
"); attribution = (attr? :attribution) ? (attr :attribution) : nil; - ; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil; - ; if attribution || citetitle; - ; _slim_controls2 << ("
"); - ; if citetitle; - ; _slim_controls2 << (""); _slim_controls2 << (citetitle); - ; _slim_controls2 << (""); end; if attribution; - ; if citetitle; - ; _slim_controls2 << ("
"); - ; end; _slim_controls2 << ("— "); _slim_controls2 << (attribution); - ; end; _slim_controls2 << ("
"); end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + _buf = ''; _buf << ((content).to_s); + ; _buf end end - def convert_ruler(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << ("
"); - ; _buf = _buf.join("") - end - end - - def convert_sidebar(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes'); - ; _buf << (""); - ; else; - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['sidebarblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; _slim_controls2 << ("
"); - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << (content); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; _buf = _buf.join("") - end - end - - def convert_stem(node, opts = {}) + def convert_colist(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; open, close = Asciidoctor::BLOCK_MATH_DELIMITERS[@style.to_sym]; - ; equation = content.strip; - ; if (@subs.nil? || @subs.empty?) && !(attr? 'subs'); - ; equation = sub_specialcharacters equation; - ; end; unless (equation.start_with? open) && (equation.end_with? close); - ; equation = %(#{open}#{equation}#{close}); - ; end; _slim_controls1 = html_tag('div', { :id => @id, :class => ['stemblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['colist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (equation); - ; _slim_controls2 << ("
"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; if @document.attr? :icons; + ; font_icons = @document.attr? :icons, 'font'; + ; _slim_controls2 << ("".freeze); + ; items.each_with_index do |item, i|; + ; num = i + 1; + ; _slim_controls2 << ("".freeze); end; _slim_controls2 << ("
".freeze); + ; + ; if font_icons; + ; _slim_controls2 << ("".freeze); + ; _slim_controls2 << ((num).to_s); + ; _slim_controls2 << ("".freeze); else; + ; _slim_controls2 << ("".freeze); + ; end; _slim_controls2 << ("".freeze); _slim_controls2 << ((item.text).to_s); + ; _slim_controls2 << ("
".freeze); else; + ; _slim_controls2 << ("
    ".freeze); + ; items.each do |item|; + ; _slim_controls2 << ("

    ".freeze); + ; _slim_controls2 << ((item.text).to_s); + ; _slim_controls2 << ("

    ".freeze); end; _slim_controls2 << ("
".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf end end @@ -1431,32 +1611,7 @@ def convert_stretch_nested_elements(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << (""); - ; - ; _buf = _buf.join("") - end - end - - def convert_table(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))]; - ; styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; '); - ; _slim_controls1 = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << (""); _slim_controls2 << (captioned_title); - ; _slim_controls2 << (""); end; unless (attr :rowcount).zero?; - ; _slim_controls2 << (""); - ; if option? 'autowidth'; - ; @columns.each do; - ; _slim_controls2 << (""); - ; end; else; - ; @columns.each do |col|; - ; _slim_controls2 << (""); - ; end; end; _slim_controls2 << (""); [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|; - ; - ; _slim_controls2 << (""); - ; @rows[tblsec].each do |row|; - ; _slim_controls2 << (""); - ; row.each do |cell|; - ; - ; if tblsec == :head; - ; cell_content = cell.text; - ; else; - ; case cell.style; - ; when :literal; - ; cell_content = cell.text; - ; else; - ; cell_content = cell.content; - ; end; end; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td', - :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"], - :colspan=>cell.colspan, :rowspan=>cell.rowspan, - :style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do; _slim_controls4 = []; - ; if tblsec == :head; - ; _slim_controls4 << (cell_content); - ; else; - ; case cell.style; - ; when :asciidoc; - ; _slim_controls4 << ("
"); _slim_controls4 << (cell_content); - ; _slim_controls4 << ("
"); when :literal; - ; _slim_controls4 << ("
"); _slim_controls4 << (cell_content); 
-      ; _slim_controls4 << ("
"); when :header; - ; cell_content.each do |text|; - ; _slim_controls4 << ("

"); _slim_controls4 << (text); - ; _slim_controls4 << ("

"); end; else; - ; cell_content.each do |text|; - ; _slim_controls4 << ("

"); _slim_controls4 << (text); - ; _slim_controls4 << ("

"); end; end; end; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); end; _slim_controls2 << (""); end; end; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_thematic_break(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _buf << ("
"); - ; _buf = _buf.join("") - end - end - - def convert_title_slide(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil; - ; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; _buf << (""); - ; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?; - ; _buf << ("

"); _buf << (slice_text _title_obj.title, (_slice = header.option? :slice)); - ; _buf << ("

"); _buf << (slice_text _title_obj.subtitle, _slice); - ; _buf << ("

"); else; - ; _buf << ("

"); _buf << (@header.title); - ; _buf << ("

"); end; preamble = @document.find_by context: :preamble; - ; unless preamble.nil? or preamble.length == 0; - ; _buf << ("
"); _buf << (preamble.pop.content); - ; _buf << ("
"); end; _buf << (generate_authors(@document)); - ; _buf << (""); _buf = _buf.join("") - end - end - - def convert_toc(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; ; ; ; @@ -1615,120 +1655,28 @@ def convert_toc(node, opts = {}) ; ; ; - ; _buf << ("
"); - ; _buf << ((document.attr 'toc-title')); - ; _buf << ("
"); - ; _buf << (converter.convert document, 'outline'); - ; _buf << ("
"); _buf = _buf.join("") - end - end - - def convert_ulist(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; if (checklist = (option? :checklist) ? 'checklist' : nil); - ; if option? :interactive; - ; marker_checked = ''; - ; marker_unchecked = ''; - ; else; - ; if @document.attr? :icons, 'font'; - ; marker_checked = ''; - ; marker_unchecked = ''; - ; else; ; - ; marker_checked = ''; - ; marker_unchecked = ''; - ; end; end; end; _slim_controls1 = html_tag('div', { :id => @id, :class => ['ulist', checklist, @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << (""); - ; items.each do |item|; - ; _slim_controls2 << ("

"); ; - ; if checklist && (item.attr? :checkbox); - ; _slim_controls2 << (%(#{(item.attr? :checked) ? marker_checked : marker_unchecked}#{item.text})); - ; else; - ; _slim_controls2 << (item.text); - ; end; _slim_controls2 << ("

"); if item.blocks?; - ; _slim_controls2 << (item.content); - ; end; _slim_controls2 << (""); end; _slim_controls2 << (""); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_verse(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; _slim_controls1 = html_tag('div', { :id => @id, :class => ['verseblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (title); - ; _slim_controls2 << ("
"); end; _slim_controls2 << ("
"); _slim_controls2 << (content); 
-      ; _slim_controls2 << ("
"); attribution = (attr? :attribution) ? (attr :attribution) : nil; - ; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil; - ; if attribution || citetitle; - ; _slim_controls2 << ("
"); - ; if citetitle; - ; _slim_controls2 << (""); _slim_controls2 << (citetitle); - ; _slim_controls2 << (""); end; if attribution; - ; if citetitle; - ; _slim_controls2 << ("
"); - ; end; _slim_controls2 << ("— "); _slim_controls2 << (attribution); - ; end; _slim_controls2 << ("
"); end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") - end - end - - def convert_video(node, opts = {}) - node.extend(Helpers) - node.instance_eval do - converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; ; - ; no_stretch = ((attr? :width) || (attr? :height)); - ; width = (attr? :width) ? (attr :width) : "100%"; - ; height = (attr? :height) ? (attr :height) : "100%"; ; - ; _slim_controls1 = html_tag('div', { :id => @id, :class => ['videoblock', @style, role, (no_stretch ? nil : 'stretch'), ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = []; - ; if title?; - ; _slim_controls2 << ("
"); _slim_controls2 << (captioned_title); - ; _slim_controls2 << ("
"); end; case attr :poster; - ; when 'vimeo'; - ; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?; - ; asset_uri_scheme = %(#{asset_uri_scheme}:); - ; end; start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil; - ; delimiter = ['?']; - ; loop_param = (option? 'loop') ? %(#{delimiter.pop || '&'}loop=1) : ''; - ; muted_param = (option? 'muted') ? %(#{delimiter.pop || '&'}muted=1) : ''; - ; src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{loop_param}#{muted_param}#{start_anchor}); ; ; ; ; ; - ; _slim_controls2 << (""); - ; when 'youtube'; - ; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?; - ; asset_uri_scheme = %(#{asset_uri_scheme}:); - ; end; params = ['rel=0']; - ; params << "start=#{attr :start}" if attr? :start; - ; params << "end=#{attr :end}" if attr? :end; - ; params << "loop=1" if option? 'loop'; - ; params << "mute=1" if option? 'muted'; - ; params << "controls=0" if option? 'nocontrols'; - ; src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&'}); ; ; ; ; + ; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('ready', function () {\n layoutSlideContents(".freeze); ; - ; _slim_controls2 << (""); - ; else; ; + ; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('resize', function () {\n layoutSlideContents(".freeze); ; ; - ; _slim_controls2 << ("Your browser does not support the video tag."); + ; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});".freeze); ; - ; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") + ; _buf end end @@ -1736,7 +1684,7 @@ def convert_section(node, opts = {}) node.extend(Helpers) node.instance_eval do converter.set_local_variables(binding, opts) unless opts.empty? - _buf = []; + _buf = ''; ; ; titleless = (title = self.title) == '!'; ; hide_title = (titleless || (option? :notitle) || (option? :conceal)); @@ -1779,12 +1727,12 @@ def convert_section(node, opts = {}) ; content_for :footnotes do; ; slide_footnotes = slide_footnotes(self); ; if document.footnotes? && !(parent.attr? 'nofootnotes') && !slide_footnotes.empty?; - ; _buf << ("
"); + ; _buf << ("
".freeze); ; slide_footnotes.each do |footnote|; - ; _buf << ("
"); - ; _buf << ("#{footnote.index}. #{footnote.text}"); + ; _buf << ("
".freeze); + ; _buf << (("#{footnote.index}. #{footnote.text}").to_s); ; - ; _buf << ("
"); end; _buf << ("
"); end; end; content_for :section do; + ; _buf << ("
".freeze); end; _buf << ("
".freeze); end; end; content_for :section do; ; ; ; @@ -1808,41 +1756,94 @@ def convert_section(node, opts = {}) ; ; ; - ; _buf << (""); + ; _buf << ("".freeze); ; unless hide_title; - ; _buf << ("

"); _buf << (section_title); - ; _buf << ("

"); end; if parent_section_with_vertical_slides; + ; _buf << ("

".freeze); _buf << ((section_title).to_s); + ; _buf << ("

".freeze); end; if parent_section_with_vertical_slides; ; unless (_blocks = blocks - vertical_slides).empty?; - ; _buf << ("
"); + ; _buf << ("
".freeze); ; _blocks.each do |block|; - ; _buf << (block.convert); - ; end; _buf << ("
"); end; yield_content :footnotes; + ; _buf << ((block.convert).to_s); + ; end; _buf << ("
".freeze); end; yield_content :footnotes; ; ; else; ; unless (_content = content.chomp).empty?; - ; _buf << ("
"); - ; _buf << (_content); - ; _buf << ("
"); end; yield_content :footnotes; + ; _buf << ("
".freeze); + ; _buf << ((_content).to_s); + ; _buf << ("
".freeze); end; yield_content :footnotes; ; ; end; clear_slide_footnotes; ; - ; _buf << (""); + ; _buf << ("".freeze); ; ; end; if parent_section_with_vertical_slides; - ; _buf << ("
"); + ; _buf << ("
".freeze); ; yield_content :section; ; vertical_slides.each do |subsection|; - ; _buf << (subsection.convert); + ; _buf << ((subsection.convert).to_s); ; - ; end; _buf << ("
"); + ; end; _buf << ("
".freeze); ; else; ; if @level >= 3; ; - ; _slim_htag_filter1 = ((@level)).to_s; _buf << (""); _buf << (title); - ; _buf << (""); _buf << (content.chomp); + ; _slim_htag_filter1 = ((@level)).to_s; _buf << ("".freeze); _buf << ((title).to_s); + ; _buf << ("".freeze); _buf << ((content.chomp).to_s); ; else; ; yield_content :section; - ; end; end; _buf = _buf.join("") + ; end; end; _buf + end + end + + def convert_inline_image(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('span', { :class => [@type, role, ('fragment' if (option? :step) || (attr? 'step'))], :style => ("float: #{attr :float}" if attr? :float) }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; _slim_controls2 << ((convert_inline_image).to_s); + ; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_example(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['exampleblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((captioned_title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_inline_break(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _buf << ((@text).to_s); + ; _buf << ("
".freeze); + ; _buf + end + end + + def convert_literal(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _slim_controls1 = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = ''; + ; if title?; + ; _slim_controls2 << ("
".freeze); _slim_controls2 << ((title).to_s); + ; _slim_controls2 << ("
".freeze); end; _slim_controls2 << ("
".freeze); _slim_controls2 << ((content).to_s); + ; _slim_controls2 << ("
".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf + end + end + + def convert_page_break(node, opts = {}) + node.extend(Helpers) + node.instance_eval do + converter.set_local_variables(binding, opts) unless opts.empty? + _buf = ''; _buf << ("
".freeze); + ; _buf end end #------------------ End of generated transformation methods ------------------#