asciidoctor-revealjs 5.0.1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Rakefile +3 -0
- data/asciidoctor-revealjs.gemspec +2 -2
- data/examples/release-5.1.adoc +43 -0
- data/examples/release-5.1.css +7 -0
- data/examples/release-5.2.adoc +49 -0
- data/examples/steps.adoc +13 -0
- data/lib/asciidoctor-revealjs/converter.rb +576 -578
- data/lib/asciidoctor-revealjs/highlightjs.rb +7 -1
- data/lib/asciidoctor-revealjs/version.rb +1 -1
- data/templates/colist.html.slim +4 -3
- data/templates/section.html.slim +1 -0
- metadata +15 -6
@@ -501,167 +501,114 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
501
501
|
end
|
502
502
|
|
503
503
|
def convert(node, transform = nil, opts = {})
|
504
|
-
transform
|
504
|
+
meth_name = "convert_#{transform || node.node_name}"
|
505
505
|
opts ||= {}
|
506
|
-
converter = respond_to?(
|
506
|
+
converter = respond_to?(meth_name) ? self : @delegate_converter
|
507
507
|
|
508
508
|
if opts.empty?
|
509
|
-
converter.send(
|
509
|
+
converter.send(meth_name, node)
|
510
510
|
else
|
511
|
-
converter.send(
|
511
|
+
converter.send(meth_name, node, opts)
|
512
512
|
end
|
513
513
|
end
|
514
514
|
|
515
|
-
def handles?(transform)
|
516
|
-
respond_to?("convert_#{transform}") || respond_to?(transform)
|
517
|
-
end
|
518
|
-
|
519
515
|
#----------------- Begin of generated transformation methods -----------------#
|
520
516
|
|
521
517
|
|
522
|
-
def
|
523
|
-
node.extend(Helpers)
|
524
|
-
node.instance_eval do
|
525
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
526
|
-
_buf = ''; _buf << ("<hr>".freeze);
|
527
|
-
; _buf
|
528
|
-
end
|
529
|
-
end
|
530
|
-
|
531
|
-
def pass(node, opts = {})
|
532
|
-
node.extend(Helpers)
|
533
|
-
node.instance_eval do
|
534
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
535
|
-
_buf = ''; _buf << ((content).to_s);
|
536
|
-
; _buf
|
537
|
-
end
|
538
|
-
end
|
539
|
-
|
540
|
-
def notes(node, opts = {})
|
518
|
+
def convert_title_slide(node, opts = {})
|
541
519
|
node.extend(Helpers)
|
542
520
|
node.instance_eval do
|
543
521
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
544
|
-
_buf = '';
|
545
|
-
;
|
522
|
+
_buf = ''; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil;
|
523
|
+
; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil;
|
524
|
+
;
|
525
|
+
;
|
526
|
+
;
|
527
|
+
;
|
528
|
+
;
|
529
|
+
;
|
530
|
+
;
|
531
|
+
;
|
532
|
+
;
|
533
|
+
;
|
534
|
+
;
|
535
|
+
;
|
536
|
+
;
|
537
|
+
;
|
538
|
+
;
|
539
|
+
; _buf << ("<section".freeze); _temple_html_attributeremover1 = ''; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "title"; _temple_html_attributemerger1[1] = ''; _slim_codeattributes1 = role; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s); end; _temple_html_attributemerger1[1]; _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s); _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << (" data-state=\"title\"".freeze); _slim_codeattributes2 = (attr 'title-slide-transition'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" data-transition".freeze); else; _buf << (" data-transition=\"".freeze); _buf << ((_slim_codeattributes2).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes3 = (attr 'title-slide-transition-speed'); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" data-transition-speed".freeze); else; _buf << (" data-transition-speed=\"".freeze); _buf << ((_slim_codeattributes3).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes4 = (attr 'title-slide-background'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" data-background".freeze); else; _buf << (" data-background=\"".freeze); _buf << ((_slim_codeattributes4).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes5 = (attr 'title-slide-background-size'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" data-background-size".freeze); else; _buf << (" data-background-size=\"".freeze); _buf << ((_slim_codeattributes5).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes6 = bg_image; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" data-background-image".freeze); else; _buf << (" data-background-image=\"".freeze); _buf << ((_slim_codeattributes6).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes7 = bg_video; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" data-background-video".freeze); else; _buf << (" data-background-video=\"".freeze); _buf << ((_slim_codeattributes7).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes8 = (attr 'title-slide-background-video-loop'); if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" data-background-video-loop".freeze); else; _buf << (" data-background-video-loop=\"".freeze); _buf << ((_slim_codeattributes8).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes9 = (attr 'title-slide-background-video-muted'); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" data-background-video-muted".freeze); else; _buf << (" data-background-video-muted=\"".freeze); _buf << ((_slim_codeattributes9).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes10 = (attr 'title-slide-background-opacity'); if _slim_codeattributes10; if _slim_codeattributes10 == true; _buf << (" data-background-opacity".freeze); else; _buf << (" data-background-opacity=\"".freeze); _buf << ((_slim_codeattributes10).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes11 = (attr 'title-slide-background-iframe'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _buf << (" data-background-iframe".freeze); else; _buf << (" data-background-iframe=\"".freeze); _buf << ((_slim_codeattributes11).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes12 = (attr 'title-slide-background-color'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _buf << (" data-background-color".freeze); else; _buf << (" data-background-color=\"".freeze); _buf << ((_slim_codeattributes12).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes13 = (attr 'title-slide-background-repeat'); if _slim_codeattributes13; if _slim_codeattributes13 == true; _buf << (" data-background-repeat".freeze); else; _buf << (" data-background-repeat=\"".freeze); _buf << ((_slim_codeattributes13).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes14 = (attr 'title-slide-background-position'); if _slim_codeattributes14; if _slim_codeattributes14 == true; _buf << (" data-background-position".freeze); else; _buf << (" data-background-position=\"".freeze); _buf << ((_slim_codeattributes14).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes15 = (attr 'title-slide-background-transition'); if _slim_codeattributes15; if _slim_codeattributes15 == true; _buf << (" data-background-transition".freeze); else; _buf << (" data-background-transition=\"".freeze); _buf << ((_slim_codeattributes15).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze);
|
540
|
+
; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?;
|
541
|
+
; _buf << ("<h1>".freeze); _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s);
|
542
|
+
; _buf << ("</h1><h2>".freeze); _buf << ((slice_text _title_obj.subtitle, _slice).to_s);
|
543
|
+
; _buf << ("</h2>".freeze); else;
|
544
|
+
; _buf << ("<h1>".freeze); _buf << ((@header.title).to_s);
|
545
|
+
; _buf << ("</h1>".freeze); end; preamble = @document.find_by context: :preamble;
|
546
|
+
; unless preamble.nil? or preamble.length == 0;
|
547
|
+
; _buf << ("<div class=\"preamble\">".freeze); _buf << ((preamble.pop.content).to_s);
|
548
|
+
; _buf << ("</div>".freeze); end; _buf << ((generate_authors(@document)).to_s);
|
549
|
+
; _buf << ("</section>".freeze); _buf
|
546
550
|
end
|
547
551
|
end
|
548
552
|
|
549
|
-
def
|
553
|
+
def convert_inline_image(node, opts = {})
|
550
554
|
node.extend(Helpers)
|
551
555
|
node.instance_eval do
|
552
556
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
553
|
-
_buf = '';
|
554
|
-
;
|
557
|
+
_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 = '';
|
558
|
+
; _slim_controls2 << ((convert_inline_image).to_s);
|
559
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
555
560
|
end
|
556
561
|
end
|
557
562
|
|
558
|
-
def
|
563
|
+
def convert_literal(node, opts = {})
|
559
564
|
node.extend(Helpers)
|
560
565
|
node.instance_eval do
|
561
566
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
562
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id =>
|
567
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
563
568
|
; if title?;
|
564
569
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
565
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<
|
566
|
-
;
|
567
|
-
; _slim_controls2 << ("<li".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes4 = ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step')); if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover2).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << ("><p>".freeze);
|
568
|
-
; _slim_controls2 << ((item.text).to_s);
|
569
|
-
; _slim_controls2 << ("</p>".freeze); if item.blocks?;
|
570
|
-
; _slim_controls2 << ((item.content).to_s);
|
571
|
-
; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
570
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\"><pre".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = (!(@document.attr? :prewrap) || (option? 'nowrap') ? 'nowrap' : nil); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover1).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << (">".freeze); _slim_controls2 << ((content).to_s);
|
571
|
+
; _slim_controls2 << ("</pre></div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
572
572
|
end
|
573
573
|
end
|
574
574
|
|
575
|
-
def
|
575
|
+
def convert_notes(node, opts = {})
|
576
576
|
node.extend(Helpers)
|
577
577
|
node.instance_eval do
|
578
578
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
579
|
-
_buf = '';
|
580
|
-
;
|
581
|
-
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
579
|
+
_buf = ''; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
580
|
+
; _buf << ("</aside>".freeze); _buf
|
582
581
|
end
|
583
582
|
end
|
584
583
|
|
585
|
-
def
|
584
|
+
def convert_inline_button(node, opts = {})
|
586
585
|
node.extend(Helpers)
|
587
586
|
node.instance_eval do
|
588
587
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
589
|
-
_buf = ''; _slim_controls1 = html_tag('
|
590
|
-
;
|
591
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
592
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\"><audio".freeze);
|
593
|
-
; _slim_codeattributes1 = media_uri(attr :target); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes1).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes2 = (option? 'autoplay'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" autoplay".freeze); else; _slim_controls2 << (" autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = !(option? 'nocontrols'); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" controls".freeze); else; _slim_controls2 << (" controls=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes4 = (option? 'loop'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" loop".freeze); else; _slim_controls2 << (" loop=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">Your browser does not support the audio tag.</audio></div>".freeze);
|
594
|
-
;
|
588
|
+
_buf = ''; _slim_controls1 = html_tag('b', { :class => ['button'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
589
|
+
; _slim_controls2 << ((@text).to_s);
|
595
590
|
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
596
591
|
end
|
597
592
|
end
|
598
593
|
|
599
|
-
def
|
600
|
-
node.extend(Helpers)
|
601
|
-
node.instance_eval do
|
602
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
603
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
604
|
-
; if title?;
|
605
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
606
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
607
|
-
; _slim_controls2 << ("</blockquote>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
608
|
-
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
609
|
-
; if attribution || citetitle;
|
610
|
-
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
611
|
-
; if citetitle;
|
612
|
-
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
613
|
-
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
614
|
-
; if citetitle;
|
615
|
-
; _slim_controls2 << ("<br>".freeze);
|
616
|
-
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
617
|
-
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
618
|
-
end
|
619
|
-
end
|
620
|
-
|
621
|
-
def admonition(node, opts = {})
|
594
|
+
def convert_embedded(node, opts = {})
|
622
595
|
node.extend(Helpers)
|
623
596
|
node.instance_eval do
|
624
597
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
625
|
-
_buf = '';
|
626
|
-
; _buf << ("<
|
627
|
-
; _buf << ("</
|
628
|
-
;
|
629
|
-
;
|
630
|
-
; _slim_controls2 << ("<table><tr><td class=\"icon\">".freeze);
|
598
|
+
_buf = ''; unless notitle || !has_header?;
|
599
|
+
; _buf << ("<h1".freeze); _slim_codeattributes1 = @id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id".freeze); else; _buf << (" id=\"".freeze); _buf << ((_slim_codeattributes1).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze); _buf << ((@header.title).to_s);
|
600
|
+
; _buf << ("</h1>".freeze); end; _buf << ((content).to_s);
|
601
|
+
; unless !footnotes? || attr?(:nofootnotes);
|
602
|
+
; _buf << ("<div id=\"footnotes\"><hr>".freeze);
|
631
603
|
;
|
632
|
-
;
|
633
|
-
;
|
634
|
-
;
|
635
|
-
;
|
636
|
-
; _slim_controls2 << ("<img".freeze); _slim_codeattributes3 = icon_uri(attr :name); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes4 = @caption; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" alt".freeze); else; _slim_controls2 << (" alt=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
637
|
-
; else;
|
638
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << (((attr :textlabel) || @caption).to_s);
|
639
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("</td><td class=\"content\">".freeze);
|
640
|
-
; if title?;
|
641
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
642
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
643
|
-
; _slim_controls2 << ("</td></tr></table>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
644
|
-
end
|
645
|
-
end
|
646
|
-
|
647
|
-
def outline(node, opts = {})
|
648
|
-
node.extend(Helpers)
|
649
|
-
node.instance_eval do
|
650
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
651
|
-
_buf = ''; unless sections.empty?;
|
652
|
-
; toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i;
|
653
|
-
; slevel = section_level sections.first;
|
654
|
-
; _buf << ("<ol class=\"sectlevel".freeze); _buf << ((slevel).to_s); _buf << ("\">".freeze);
|
655
|
-
; sections.each do |sec|;
|
656
|
-
; _buf << ("<li><a href=\"#".freeze);
|
657
|
-
; _buf << ((sec.id).to_s); _buf << ("\">".freeze); _buf << ((section_title sec).to_s);
|
658
|
-
; _buf << ("</a>".freeze); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline');
|
659
|
-
; _buf << ((child_toc).to_s);
|
660
|
-
; end; _buf << ("</li>".freeze); end; _buf << ("</ol>".freeze); end; _buf
|
604
|
+
; footnotes.each do |fn|;
|
605
|
+
; _buf << ("<div class=\"footnote\" id=\"_footnote_".freeze); _buf << ((fn.index).to_s); _buf << ("\"><a href=\"#_footnoteref_".freeze);
|
606
|
+
; _buf << ((fn.index).to_s); _buf << ("\">".freeze); _buf << ((fn.index).to_s); _buf << ("</a>. ".freeze); _buf << ((fn.text).to_s);
|
607
|
+
; _buf << ("</div>".freeze); end; _buf << ("</div>".freeze); end; _buf
|
661
608
|
end
|
662
609
|
end
|
663
610
|
|
664
|
-
def
|
611
|
+
def convert_video(node, opts = {})
|
665
612
|
node.extend(Helpers)
|
666
613
|
node.instance_eval do
|
667
614
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -715,123 +662,7 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
715
662
|
end
|
716
663
|
end
|
717
664
|
|
718
|
-
def
|
719
|
-
node.extend(Helpers)
|
720
|
-
node.instance_eval do
|
721
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
722
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['verseblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
723
|
-
; if title?;
|
724
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
725
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<pre class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
726
|
-
; _slim_controls2 << ("</pre>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
727
|
-
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
728
|
-
; if attribution || citetitle;
|
729
|
-
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
730
|
-
; if citetitle;
|
731
|
-
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
732
|
-
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
733
|
-
; if citetitle;
|
734
|
-
; _slim_controls2 << ("<br>".freeze);
|
735
|
-
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
736
|
-
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
737
|
-
end
|
738
|
-
end
|
739
|
-
|
740
|
-
def inline_menu(node, opts = {})
|
741
|
-
node.extend(Helpers)
|
742
|
-
node.instance_eval do
|
743
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
744
|
-
_buf = ''; menu = attr 'menu';
|
745
|
-
; menuitem = attr 'menuitem';
|
746
|
-
; if !(submenus = attr 'submenus').empty?;
|
747
|
-
; _slim_controls1 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
748
|
-
; _slim_controls2 << ("<span class=\"menu\">".freeze); _slim_controls2 << ((menu).to_s);
|
749
|
-
; _slim_controls2 << ("</span> ▸ ".freeze);
|
750
|
-
; _slim_controls2 << ((submenus.map {|submenu| %(<span class="submenu">#{submenu}</span> ▸ ) }.join).to_s);
|
751
|
-
; _slim_controls2 << ("<span class=\"menuitem\">".freeze); _slim_controls2 << ((menuitem).to_s);
|
752
|
-
; _slim_controls2 << ("</span>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); elsif !menuitem.nil?;
|
753
|
-
; _slim_controls3 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
754
|
-
; _slim_controls4 << ("<span class=\"menu\">".freeze); _slim_controls4 << ((menu).to_s);
|
755
|
-
; _slim_controls4 << ("</span> ▸ <span class=\"menuitem\">".freeze);
|
756
|
-
; _slim_controls4 << ((menuitem).to_s);
|
757
|
-
; _slim_controls4 << ("</span>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else;
|
758
|
-
; _slim_controls5 = html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes))) do; _slim_controls6 = '';
|
759
|
-
; _slim_controls6 << ((menu).to_s);
|
760
|
-
; _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf
|
761
|
-
end
|
762
|
-
end
|
763
|
-
|
764
|
-
def toc(node, opts = {})
|
765
|
-
node.extend(Helpers)
|
766
|
-
node.instance_eval do
|
767
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
768
|
-
_buf = '';
|
769
|
-
;
|
770
|
-
;
|
771
|
-
;
|
772
|
-
;
|
773
|
-
;
|
774
|
-
;
|
775
|
-
;
|
776
|
-
;
|
777
|
-
;
|
778
|
-
;
|
779
|
-
;
|
780
|
-
;
|
781
|
-
; _buf << ("<div id=\"toc\"".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = (document.attr 'toc-class', 'toc'); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << ("><div id=\"toctitle\">".freeze);
|
782
|
-
; _buf << (((document.attr 'toc-title')).to_s);
|
783
|
-
; _buf << ("</div>".freeze);
|
784
|
-
; _buf << ((converter.convert document, 'outline').to_s);
|
785
|
-
; _buf << ("</div>".freeze); _buf
|
786
|
-
end
|
787
|
-
end
|
788
|
-
|
789
|
-
def inline_kbd(node, opts = {})
|
790
|
-
node.extend(Helpers)
|
791
|
-
node.instance_eval do
|
792
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
793
|
-
_buf = ''; if (keys = attr 'keys').size == 1;
|
794
|
-
; _slim_controls1 = html_tag('kbd', data_attrs(@attributes)) do; _slim_controls2 = '';
|
795
|
-
; _slim_controls2 << ((keys.first).to_s);
|
796
|
-
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
797
|
-
; _slim_controls3 = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
798
|
-
; keys.each_with_index do |key, idx|;
|
799
|
-
; unless idx.zero?;
|
800
|
-
; _slim_controls4 << ("+".freeze);
|
801
|
-
; end; _slim_controls4 << ("<kbd>".freeze); _slim_controls4 << ((key).to_s);
|
802
|
-
; _slim_controls4 << ("</kbd>".freeze); end; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
803
|
-
end
|
804
|
-
end
|
805
|
-
|
806
|
-
def colist(node, opts = {})
|
807
|
-
node.extend(Helpers)
|
808
|
-
node.instance_eval do
|
809
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
810
|
-
_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 = '';
|
811
|
-
; if title?;
|
812
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
813
|
-
; _slim_controls2 << ("</div>".freeze); end; if @document.attr? :icons;
|
814
|
-
; font_icons = @document.attr? :icons, 'font';
|
815
|
-
; _slim_controls2 << ("<table>".freeze);
|
816
|
-
; items.each_with_index do |item, i|;
|
817
|
-
; num = i + 1;
|
818
|
-
; _slim_controls2 << ("<tr><td>".freeze);
|
819
|
-
;
|
820
|
-
; if font_icons;
|
821
|
-
; _slim_controls2 << ("<i class=\"conum\"".freeze); _slim_codeattributes1 = num; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" data-value".freeze); else; _slim_controls2 << (" data-value=\"".freeze); _slim_controls2 << ((_slim_codeattributes1).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></i><b>".freeze);
|
822
|
-
; _slim_controls2 << ((num).to_s);
|
823
|
-
; _slim_controls2 << ("</b>".freeze); else;
|
824
|
-
; _slim_controls2 << ("<img".freeze); _slim_codeattributes2 = icon_uri("callouts/#{num}"); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = num; if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" alt".freeze); else; _slim_controls2 << (" alt=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
825
|
-
; end; _slim_controls2 << ("</td><td>".freeze); _slim_controls2 << ((item.text).to_s);
|
826
|
-
; _slim_controls2 << ("</td></tr>".freeze); end; _slim_controls2 << ("</table>".freeze); else;
|
827
|
-
; _slim_controls2 << ("<ol>".freeze);
|
828
|
-
; items.each do |item|;
|
829
|
-
; _slim_controls2 << ("<li><p>".freeze); _slim_controls2 << ((item.text).to_s);
|
830
|
-
; _slim_controls2 << ("</p></li>".freeze); end; _slim_controls2 << ("</ol>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
831
|
-
end
|
832
|
-
end
|
833
|
-
|
834
|
-
def stretch_nested_elements(node, opts = {})
|
665
|
+
def convert_stretch_nested_elements(node, opts = {})
|
835
666
|
node.extend(Helpers)
|
836
667
|
node.instance_eval do
|
837
668
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -904,54 +735,295 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
904
735
|
end
|
905
736
|
end
|
906
737
|
|
907
|
-
def
|
738
|
+
def convert_floating_title(node, opts = {})
|
908
739
|
node.extend(Helpers)
|
909
740
|
node.instance_eval do
|
910
741
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
911
|
-
_buf = '';
|
912
|
-
;
|
913
|
-
;
|
914
|
-
; equation = sub_specialcharacters equation;
|
915
|
-
; end; unless (equation.start_with? open) && (equation.end_with? close);
|
916
|
-
; equation = %(#{open}#{equation}#{close});
|
917
|
-
; 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 = '';
|
918
|
-
; if title?;
|
919
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
920
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze); _slim_controls2 << ((equation).to_s);
|
921
|
-
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
742
|
+
_buf = ''; _slim_htag_filter1 = ((level + 1)).to_s; _buf << ("<h".freeze); _buf << ((_slim_htag_filter1).to_s); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id".freeze); else; _buf << (" id=\"".freeze); _buf << ((_slim_codeattributes1).to_s); _buf << ("\"".freeze); end; end; _temple_html_attributeremover1 = ''; _slim_codeattributes2 = [style, role]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << (">".freeze);
|
743
|
+
; _buf << ((title).to_s);
|
744
|
+
; _buf << ("</h".freeze); _buf << ((_slim_htag_filter1).to_s); _buf << (">".freeze); _buf
|
922
745
|
end
|
923
746
|
end
|
924
747
|
|
925
|
-
def
|
748
|
+
def convert_admonition(node, opts = {})
|
926
749
|
node.extend(Helpers)
|
927
750
|
node.instance_eval do
|
928
751
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
929
|
-
_buf = '';
|
752
|
+
_buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
753
|
+
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
754
|
+
; _buf << ("</aside>".freeze);
|
755
|
+
; else;
|
756
|
+
; _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 = '';
|
757
|
+
; _slim_controls2 << ("<table><tr><td class=\"icon\">".freeze);
|
758
|
+
;
|
759
|
+
; if @document.attr? :icons, 'font';
|
760
|
+
; icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning'];
|
761
|
+
; _slim_controls2 << ("<i".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = %(fa fa-#{icon_mapping[attr :name]}); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover1).to_s); _slim_controls2 << ("\"".freeze); end; _slim_codeattributes2 = (attr :textlabel || @caption); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" title".freeze); else; _slim_controls2 << (" title=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></i>".freeze);
|
762
|
+
; elsif @document.attr? :icons;
|
763
|
+
; _slim_controls2 << ("<img".freeze); _slim_codeattributes3 = icon_uri(attr :name); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes4 = @caption; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" alt".freeze); else; _slim_controls2 << (" alt=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
764
|
+
; else;
|
765
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << (((attr :textlabel) || @caption).to_s);
|
766
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("</td><td class=\"content\">".freeze);
|
930
767
|
; if title?;
|
931
768
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
932
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << (
|
933
|
-
; _slim_controls2 << ("</
|
769
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
770
|
+
; _slim_controls2 << ("</td></tr></table>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
934
771
|
end
|
935
772
|
end
|
936
773
|
|
937
|
-
def
|
774
|
+
def convert_quote(node, opts = {})
|
938
775
|
node.extend(Helpers)
|
939
776
|
node.instance_eval do
|
940
777
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
941
|
-
_buf = '';
|
942
|
-
;
|
943
|
-
;
|
944
|
-
;
|
945
|
-
;
|
778
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
779
|
+
; if title?;
|
780
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
781
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
782
|
+
; _slim_controls2 << ("</blockquote>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
783
|
+
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
784
|
+
; if attribution || citetitle;
|
785
|
+
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
786
|
+
; if citetitle;
|
787
|
+
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
788
|
+
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
789
|
+
; if citetitle;
|
790
|
+
; _slim_controls2 << ("<br>".freeze);
|
791
|
+
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
792
|
+
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
def convert_olist(node, opts = {})
|
797
|
+
node.extend(Helpers)
|
798
|
+
node.instance_eval do
|
799
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
800
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
801
|
+
; if title?;
|
802
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
803
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<ol".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = @style; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover1).to_s); _slim_controls2 << ("\"".freeze); end; _slim_codeattributes2 = (attr :start); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" start".freeze); else; _slim_controls2 << (" start=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = list_marker_keyword; if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" type".freeze); else; _slim_controls2 << (" type=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
804
|
+
; items.each do |item|;
|
805
|
+
; _slim_controls2 << ("<li".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes4 = ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step')); if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover2).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << ("><p>".freeze);
|
806
|
+
; _slim_controls2 << ((item.text).to_s);
|
807
|
+
; _slim_controls2 << ("</p>".freeze); if item.blocks?;
|
808
|
+
; _slim_controls2 << ((item.content).to_s);
|
809
|
+
; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
810
|
+
end
|
811
|
+
end
|
812
|
+
|
813
|
+
def convert_inline_footnote(node, opts = {})
|
814
|
+
node.extend(Helpers)
|
815
|
+
node.instance_eval do
|
816
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
817
|
+
_buf = ''; footnote = slide_footnote(self);
|
818
|
+
; index = footnote.attr(:index);
|
819
|
+
; id = footnote.id;
|
820
|
+
; if @type == :xref;
|
821
|
+
; _slim_controls1 = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls2 = '';
|
822
|
+
; _slim_controls2 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
823
|
+
; _slim_controls2 << ((index).to_s);
|
824
|
+
; _slim_controls2 << ("</span>]".freeze);
|
825
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
826
|
+
; _slim_controls3 = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls4 = '';
|
827
|
+
; _slim_controls4 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
828
|
+
; _slim_controls4 << ((index).to_s);
|
829
|
+
; _slim_controls4 << ("</span>]".freeze);
|
830
|
+
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
834
|
+
def convert_preamble(node, opts = {})
|
835
|
+
node.extend(Helpers)
|
836
|
+
node.instance_eval do
|
837
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
838
|
+
_buf = '';
|
946
839
|
;
|
947
|
-
;
|
948
|
-
|
949
|
-
|
950
|
-
|
840
|
+
; _buf
|
841
|
+
end
|
842
|
+
end
|
843
|
+
|
844
|
+
def convert_inline_menu(node, opts = {})
|
845
|
+
node.extend(Helpers)
|
846
|
+
node.instance_eval do
|
847
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
848
|
+
_buf = ''; menu = attr 'menu';
|
849
|
+
; menuitem = attr 'menuitem';
|
850
|
+
; if !(submenus = attr 'submenus').empty?;
|
851
|
+
; _slim_controls1 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
852
|
+
; _slim_controls2 << ("<span class=\"menu\">".freeze); _slim_controls2 << ((menu).to_s);
|
853
|
+
; _slim_controls2 << ("</span> ▸ ".freeze);
|
854
|
+
; _slim_controls2 << ((submenus.map {|submenu| %(<span class="submenu">#{submenu}</span> ▸ ) }.join).to_s);
|
855
|
+
; _slim_controls2 << ("<span class=\"menuitem\">".freeze); _slim_controls2 << ((menuitem).to_s);
|
856
|
+
; _slim_controls2 << ("</span>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); elsif !menuitem.nil?;
|
857
|
+
; _slim_controls3 = html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
858
|
+
; _slim_controls4 << ("<span class=\"menu\">".freeze); _slim_controls4 << ((menu).to_s);
|
859
|
+
; _slim_controls4 << ("</span> ▸ <span class=\"menuitem\">".freeze);
|
860
|
+
; _slim_controls4 << ((menuitem).to_s);
|
861
|
+
; _slim_controls4 << ("</span>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else;
|
862
|
+
; _slim_controls5 = html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes))) do; _slim_controls6 = '';
|
863
|
+
; _slim_controls6 << ((menu).to_s);
|
864
|
+
; _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf
|
865
|
+
end
|
866
|
+
end
|
867
|
+
|
868
|
+
def convert_colist(node, opts = {})
|
869
|
+
node.extend(Helpers)
|
870
|
+
node.instance_eval do
|
871
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
872
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['colist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
873
|
+
; if title?;
|
874
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
875
|
+
; _slim_controls2 << ("</div>".freeze); end; if @document.attr? :icons;
|
876
|
+
; font_icons = @document.attr? :icons, 'font';
|
877
|
+
; _slim_controls2 << ("<table>".freeze);
|
878
|
+
; items.each_with_index do |item, i|;
|
879
|
+
; num = i + 1;
|
880
|
+
; _slim_controls2 << ("<tr".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step')); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover1).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << ("><td>".freeze);
|
881
|
+
;
|
882
|
+
; if font_icons;
|
883
|
+
; _slim_controls2 << ("<i class=\"conum\"".freeze); _slim_codeattributes2 = num; if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" data-value".freeze); else; _slim_controls2 << (" data-value=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></i><b>".freeze);
|
884
|
+
; _slim_controls2 << ((num).to_s);
|
885
|
+
; _slim_controls2 << ("</b>".freeze); else;
|
886
|
+
; _slim_controls2 << ("<img".freeze); _slim_codeattributes3 = icon_uri("callouts/#{num}"); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes4 = num; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" alt".freeze); else; _slim_controls2 << (" alt=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
887
|
+
; end; _slim_controls2 << ("</td><td>".freeze); _slim_controls2 << ((item.text).to_s);
|
888
|
+
; _slim_controls2 << ("</td></tr>".freeze); end; _slim_controls2 << ("</table>".freeze); else;
|
889
|
+
; _slim_controls2 << ("<ol>".freeze);
|
890
|
+
; items.each do |item|;
|
891
|
+
; _slim_controls2 << ("<li".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes5 = ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step')); if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes5.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes5).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover2).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << ("><p>".freeze);
|
892
|
+
; _slim_controls2 << ((item.text).to_s);
|
893
|
+
; _slim_controls2 << ("</p></li>".freeze); end; _slim_controls2 << ("</ol>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
def convert_paragraph(node, opts = {})
|
898
|
+
node.extend(Helpers)
|
899
|
+
node.instance_eval do
|
900
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
901
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['paragraph', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
902
|
+
; if title?;
|
903
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
904
|
+
; _slim_controls2 << ("</div>".freeze); end; if has_role? 'small';
|
905
|
+
; _slim_controls2 << ("<small>".freeze); _slim_controls2 << ((content).to_s);
|
906
|
+
; _slim_controls2 << ("</small>".freeze); else;
|
907
|
+
; _slim_controls2 << ("<p>".freeze); _slim_controls2 << ((content).to_s);
|
908
|
+
; _slim_controls2 << ("</p>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
909
|
+
end
|
910
|
+
end
|
911
|
+
|
912
|
+
def convert_listing(node, opts = {})
|
913
|
+
node.extend(Helpers)
|
914
|
+
node.instance_eval do
|
915
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
916
|
+
_buf = ''; nowrap = (option? 'nowrap') || !(document.attr? 'prewrap');
|
917
|
+
; if @style == 'source';
|
918
|
+
; syntax_hl = document.syntax_highlighter;
|
919
|
+
; lang = attr :language;
|
920
|
+
; if syntax_hl;
|
921
|
+
; doc_attrs = document.attributes;
|
922
|
+
; css_mode = (doc_attrs[%(#{syntax_hl.name}-css)] || :class).to_sym;
|
923
|
+
; style = doc_attrs[%(#{syntax_hl.name}-style)];
|
924
|
+
; opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {};
|
925
|
+
; opts[:nowrap] = nowrap;
|
926
|
+
; end;
|
927
|
+
; 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 = '';
|
928
|
+
; if title?;
|
929
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
930
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze);
|
931
|
+
; if syntax_hl;
|
932
|
+
; _slim_controls2 << (((syntax_hl.format self, lang, opts)).to_s);
|
933
|
+
; else;
|
934
|
+
; if @style == 'source';
|
935
|
+
; _slim_controls2 << ("<pre".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = ['highlight', ('nowrap' if nowrap)]; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover1).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << ("><code".freeze);
|
936
|
+
; _temple_html_attributeremover2 = ''; _slim_codeattributes2 = [("language-#{lang}" if lang)]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes2.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes2).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover2).to_s); _slim_controls2 << ("\"".freeze); end; _slim_codeattributes3 = ("#{lang}" if lang); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" data-lang".freeze); else; _slim_controls2 << (" data-lang=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">".freeze);
|
937
|
+
; _slim_controls2 << ((content || '').to_s);
|
938
|
+
; _slim_controls2 << ("</code></pre>".freeze); else;
|
939
|
+
; _slim_controls2 << ("<pre".freeze); _temple_html_attributeremover3 = ''; _slim_codeattributes4 = [('nowrap' if nowrap)]; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover3 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover3 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover3; if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover3).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << (">".freeze);
|
940
|
+
; _slim_controls2 << ((content || '').to_s);
|
941
|
+
; _slim_controls2 << ("</pre>".freeze); end; end; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
942
|
+
end
|
943
|
+
end
|
944
|
+
|
945
|
+
def convert_inline_indexterm(node, opts = {})
|
946
|
+
node.extend(Helpers)
|
947
|
+
node.instance_eval do
|
948
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
949
|
+
_buf = ''; if @type == :visible;
|
950
|
+
; _buf << ((@text).to_s);
|
951
|
+
; end; _buf
|
952
|
+
end
|
953
|
+
end
|
954
|
+
|
955
|
+
def convert_table(node, opts = {})
|
956
|
+
node.extend(Helpers)
|
957
|
+
node.instance_eval do
|
958
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
959
|
+
_buf = ''; classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))];
|
960
|
+
; styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; ');
|
961
|
+
; _slim_controls1 = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
962
|
+
; if title?;
|
963
|
+
; _slim_controls2 << ("<caption class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
964
|
+
; _slim_controls2 << ("</caption>".freeze); end; unless (attr :rowcount).zero?;
|
965
|
+
; _slim_controls2 << ("<colgroup>".freeze);
|
966
|
+
; if option? 'autowidth';
|
967
|
+
; @columns.each do;
|
968
|
+
; _slim_controls2 << ("<col>".freeze);
|
969
|
+
; end; else;
|
970
|
+
; @columns.each do |col|;
|
971
|
+
; _slim_controls2 << ("<col style=\"width:".freeze); _slim_controls2 << ((col.attr :colpcwidth).to_s); _slim_controls2 << ("%\">".freeze);
|
972
|
+
; end; end; _slim_controls2 << ("</colgroup>".freeze); [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|;
|
973
|
+
;
|
974
|
+
; _slim_controls2 << ("<t".freeze); _slim_controls2 << ((tblsec).to_s); _slim_controls2 << (">".freeze);
|
975
|
+
; @rows[tblsec].each do |row|;
|
976
|
+
; _slim_controls2 << ("<tr>".freeze);
|
977
|
+
; row.each do |cell|;
|
978
|
+
;
|
979
|
+
; if tblsec == :head;
|
980
|
+
; cell_content = cell.text;
|
981
|
+
; else;
|
982
|
+
; case cell.style;
|
983
|
+
; when :literal;
|
984
|
+
; cell_content = cell.text;
|
985
|
+
; else;
|
986
|
+
; cell_content = cell.content;
|
987
|
+
; end; end; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
|
988
|
+
:class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
|
989
|
+
:colspan=>cell.colspan, :rowspan=>cell.rowspan,
|
990
|
+
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do; _slim_controls4 = '';
|
991
|
+
; if tblsec == :head;
|
992
|
+
; _slim_controls4 << ((cell_content).to_s);
|
993
|
+
; else;
|
994
|
+
; case cell.style;
|
995
|
+
; when :asciidoc;
|
996
|
+
; _slim_controls4 << ("<div>".freeze); _slim_controls4 << ((cell_content).to_s);
|
997
|
+
; _slim_controls4 << ("</div>".freeze); when :literal;
|
998
|
+
; _slim_controls4 << ("<div class=\"literal\"><pre>".freeze); _slim_controls4 << ((cell_content).to_s);
|
999
|
+
; _slim_controls4 << ("</pre></div>".freeze); when :header;
|
1000
|
+
; cell_content.each do |text|;
|
1001
|
+
; _slim_controls4 << ("<p class=\"tableblock header\">".freeze); _slim_controls4 << ((text).to_s);
|
1002
|
+
; _slim_controls4 << ("</p>".freeze); end; else;
|
1003
|
+
; cell_content.each do |text|;
|
1004
|
+
; _slim_controls4 << ("<p class=\"tableblock\">".freeze); _slim_controls4 << ((text).to_s);
|
1005
|
+
; _slim_controls4 << ("</p>".freeze); end; end; end; _slim_controls4; end; _slim_controls2 << ((_slim_controls3).to_s); end; _slim_controls2 << ("</tr>".freeze); end; end; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
def convert_sidebar(node, opts = {})
|
1010
|
+
node.extend(Helpers)
|
1011
|
+
node.instance_eval do
|
1012
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1013
|
+
_buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
1014
|
+
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
1015
|
+
; _buf << ("</aside>".freeze);
|
1016
|
+
; else;
|
1017
|
+
; _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 = '';
|
1018
|
+
; _slim_controls2 << ("<div class=\"content\">".freeze);
|
1019
|
+
; if title?;
|
1020
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1021
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
1022
|
+
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
951
1023
|
end
|
952
1024
|
end
|
953
1025
|
|
954
|
-
def
|
1026
|
+
def convert_document(node, opts = {})
|
955
1027
|
node.extend(Helpers)
|
956
1028
|
node.instance_eval do
|
957
1029
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1293,109 +1365,67 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1293
1365
|
;
|
1294
1366
|
; end; unless (docinfo_content = (docinfo :footer, '.html')).empty?;
|
1295
1367
|
; _buf << ((docinfo_content).to_s);
|
1296
|
-
; end; _buf << ("</body></html>".freeze); _buf
|
1297
|
-
end
|
1298
|
-
end
|
1299
|
-
|
1300
|
-
def sidebar(node, opts = {})
|
1301
|
-
node.extend(Helpers)
|
1302
|
-
node.instance_eval do
|
1303
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
1304
|
-
_buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
1305
|
-
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
1306
|
-
; _buf << ("</aside>".freeze);
|
1307
|
-
; else;
|
1308
|
-
; _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 = '';
|
1309
|
-
; _slim_controls2 << ("<div class=\"content\">".freeze);
|
1310
|
-
; if title?;
|
1311
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1312
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
1313
|
-
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
1368
|
+
; end; _buf << ("</body></html>".freeze); _buf
|
1314
1369
|
end
|
1315
1370
|
end
|
1316
1371
|
|
1317
|
-
def
|
1372
|
+
def convert_outline(node, opts = {})
|
1318
1373
|
node.extend(Helpers)
|
1319
1374
|
node.instance_eval do
|
1320
1375
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1321
|
-
_buf = '';
|
1322
|
-
;
|
1323
|
-
;
|
1376
|
+
_buf = ''; unless sections.empty?;
|
1377
|
+
; toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i;
|
1378
|
+
; slevel = section_level sections.first;
|
1379
|
+
; _buf << ("<ol class=\"sectlevel".freeze); _buf << ((slevel).to_s); _buf << ("\">".freeze);
|
1380
|
+
; sections.each do |sec|;
|
1381
|
+
; _buf << ("<li><a href=\"#".freeze);
|
1382
|
+
; _buf << ((sec.id).to_s); _buf << ("\">".freeze); _buf << ((section_title sec).to_s);
|
1383
|
+
; _buf << ("</a>".freeze); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline');
|
1384
|
+
; _buf << ((child_toc).to_s);
|
1385
|
+
; end; _buf << ("</li>".freeze); end; _buf << ("</ol>".freeze); end; _buf
|
1324
1386
|
end
|
1325
1387
|
end
|
1326
1388
|
|
1327
|
-
def
|
1389
|
+
def convert_inline_anchor(node, opts = {})
|
1328
1390
|
node.extend(Helpers)
|
1329
1391
|
node.instance_eval do
|
1330
1392
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1331
|
-
_buf = '';
|
1332
|
-
;
|
1333
|
-
;
|
1393
|
+
_buf = ''; case @type;
|
1394
|
+
; when :xref;
|
1395
|
+
; refid = (attr :refid) || @target;
|
1396
|
+
; _slim_controls1 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1397
|
+
; _slim_controls2 << (((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')).to_s);
|
1398
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); when :ref;
|
1399
|
+
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
1400
|
+
; when :bibref;
|
1401
|
+
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
1402
|
+
; _buf << ("[".freeze); _buf << ((@target).to_s); _buf << ("]".freeze);
|
1403
|
+
; else;
|
1404
|
+
; _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 = '';
|
1405
|
+
; _slim_controls4 << ((@text).to_s);
|
1406
|
+
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1334
1407
|
end
|
1335
1408
|
end
|
1336
1409
|
|
1337
|
-
def
|
1410
|
+
def convert_stem(node, opts = {})
|
1338
1411
|
node.extend(Helpers)
|
1339
1412
|
node.instance_eval do
|
1340
1413
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1341
|
-
_buf = '';
|
1342
|
-
;
|
1343
|
-
;
|
1414
|
+
_buf = ''; open, close = Asciidoctor::BLOCK_MATH_DELIMITERS[@style.to_sym];
|
1415
|
+
; equation = content.strip;
|
1416
|
+
; if (@subs.nil? || @subs.empty?) && !(attr? 'subs');
|
1417
|
+
; equation = sub_specialcharacters equation;
|
1418
|
+
; end; unless (equation.start_with? open) && (equation.end_with? close);
|
1419
|
+
; equation = %(#{open}#{equation}#{close});
|
1420
|
+
; 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 = '';
|
1344
1421
|
; if title?;
|
1345
1422
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1346
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<
|
1347
|
-
;
|
1348
|
-
; _slim_controls2 << ("<li>".freeze);
|
1349
|
-
; [*questions].each do |question|;
|
1350
|
-
; _slim_controls2 << ("<p><em>".freeze); _slim_controls2 << ((question.text).to_s);
|
1351
|
-
; _slim_controls2 << ("</em></p>".freeze); end; unless answer.nil?;
|
1352
|
-
; if answer.text?;
|
1353
|
-
; _slim_controls2 << ("<p>".freeze); _slim_controls2 << ((answer.text).to_s);
|
1354
|
-
; _slim_controls2 << ("</p>".freeze); end; if answer.blocks?;
|
1355
|
-
; _slim_controls2 << ((answer.content).to_s);
|
1356
|
-
; end; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); when 'horizontal';
|
1357
|
-
; _slim_controls3 = html_tag('div', { :id => @id, :class => ['hdlist', role] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
1358
|
-
; if title?;
|
1359
|
-
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
1360
|
-
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<table>".freeze);
|
1361
|
-
; if (attr? :labelwidth) || (attr? :itemwidth);
|
1362
|
-
; _slim_controls4 << ("<colgroup><col".freeze);
|
1363
|
-
; _slim_codeattributes1 = ((attr? :labelwidth) ? %(width:#{(attr :labelwidth).chomp '%'}%;) : nil); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls4 << (" style".freeze); else; _slim_controls4 << (" style=\"".freeze); _slim_controls4 << ((_slim_codeattributes1).to_s); _slim_controls4 << ("\"".freeze); end; end; _slim_controls4 << ("><col".freeze);
|
1364
|
-
; _slim_codeattributes2 = ((attr? :itemwidth) ? %(width:#{(attr :itemwidth).chomp '%'}%;) : nil); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls4 << (" style".freeze); else; _slim_controls4 << (" style=\"".freeze); _slim_controls4 << ((_slim_codeattributes2).to_s); _slim_controls4 << ("\"".freeze); end; end; _slim_controls4 << ("></colgroup>".freeze);
|
1365
|
-
; end; items.each do |terms, dd|;
|
1366
|
-
; _slim_controls4 << ("<tr><td".freeze);
|
1367
|
-
; _temple_html_attributeremover1 = ''; _slim_codeattributes3 = ['hdlist1',('strong' if option? 'strong')]; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes3.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes3).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls4 << (" class=\"".freeze); _slim_controls4 << ((_temple_html_attributeremover1).to_s); _slim_controls4 << ("\"".freeze); end; _slim_controls4 << (">".freeze);
|
1368
|
-
; terms = [*terms];
|
1369
|
-
; last_term = terms.last;
|
1370
|
-
; terms.each do |dt|;
|
1371
|
-
; _slim_controls4 << ((dt.text).to_s);
|
1372
|
-
; if dt != last_term;
|
1373
|
-
; _slim_controls4 << ("<br>".freeze);
|
1374
|
-
; end; end; _slim_controls4 << ("</td><td class=\"hdlist2\">".freeze);
|
1375
|
-
; unless dd.nil?;
|
1376
|
-
; if dd.text?;
|
1377
|
-
; _slim_controls4 << ("<p>".freeze); _slim_controls4 << ((dd.text).to_s);
|
1378
|
-
; _slim_controls4 << ("</p>".freeze); end; if dd.blocks?;
|
1379
|
-
; _slim_controls4 << ((dd.content).to_s);
|
1380
|
-
; end; end; _slim_controls4 << ("</td></tr>".freeze); end; _slim_controls4 << ("</table>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else;
|
1381
|
-
; _slim_controls5 = html_tag('div', { :id => @id, :class => ['dlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls6 = '';
|
1382
|
-
; if title?;
|
1383
|
-
; _slim_controls6 << ("<div class=\"title\">".freeze); _slim_controls6 << ((title).to_s);
|
1384
|
-
; _slim_controls6 << ("</div>".freeze); end; _slim_controls6 << ("<dl>".freeze);
|
1385
|
-
; items.each do |terms, dd|;
|
1386
|
-
; [*terms].each do |dt|;
|
1387
|
-
; _slim_controls6 << ("<dt".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes4 = ('hdlist1' unless @style); if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls6 << (" class=\"".freeze); _slim_controls6 << ((_temple_html_attributeremover2).to_s); _slim_controls6 << ("\"".freeze); end; _slim_controls6 << (">".freeze); _slim_controls6 << ((dt.text).to_s);
|
1388
|
-
; _slim_controls6 << ("</dt>".freeze); end; unless dd.nil?;
|
1389
|
-
; _slim_controls6 << ("<dd>".freeze);
|
1390
|
-
; if dd.text?;
|
1391
|
-
; _slim_controls6 << ("<p>".freeze); _slim_controls6 << ((dd.text).to_s);
|
1392
|
-
; _slim_controls6 << ("</p>".freeze); end; if dd.blocks?;
|
1393
|
-
; _slim_controls6 << ((dd.content).to_s);
|
1394
|
-
; end; _slim_controls6 << ("</dd>".freeze); end; end; _slim_controls6 << ("</dl>".freeze); _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf
|
1423
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze); _slim_controls2 << ((equation).to_s);
|
1424
|
+
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1395
1425
|
end
|
1396
1426
|
end
|
1397
1427
|
|
1398
|
-
def
|
1428
|
+
def convert_ulist(node, opts = {})
|
1399
1429
|
node.extend(Helpers)
|
1400
1430
|
node.instance_eval do
|
1401
1431
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1428,7 +1458,34 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1428
1458
|
end
|
1429
1459
|
end
|
1430
1460
|
|
1431
|
-
def
|
1461
|
+
def convert_inline_break(node, opts = {})
|
1462
|
+
node.extend(Helpers)
|
1463
|
+
node.instance_eval do
|
1464
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1465
|
+
_buf = ''; _buf << ((@text).to_s);
|
1466
|
+
; _buf << ("<br>".freeze);
|
1467
|
+
; _buf
|
1468
|
+
end
|
1469
|
+
end
|
1470
|
+
|
1471
|
+
def convert_inline_kbd(node, opts = {})
|
1472
|
+
node.extend(Helpers)
|
1473
|
+
node.instance_eval do
|
1474
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1475
|
+
_buf = ''; if (keys = attr 'keys').size == 1;
|
1476
|
+
; _slim_controls1 = html_tag('kbd', data_attrs(@attributes)) do; _slim_controls2 = '';
|
1477
|
+
; _slim_controls2 << ((keys.first).to_s);
|
1478
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
1479
|
+
; _slim_controls3 = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
1480
|
+
; keys.each_with_index do |key, idx|;
|
1481
|
+
; unless idx.zero?;
|
1482
|
+
; _slim_controls4 << ("+".freeze);
|
1483
|
+
; end; _slim_controls4 << ("<kbd>".freeze); _slim_controls4 << ((key).to_s);
|
1484
|
+
; _slim_controls4 << ("</kbd>".freeze); end; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1485
|
+
end
|
1486
|
+
end
|
1487
|
+
|
1488
|
+
def convert_page_break(node, opts = {})
|
1432
1489
|
node.extend(Helpers)
|
1433
1490
|
node.instance_eval do
|
1434
1491
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1437,125 +1494,127 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1437
1494
|
end
|
1438
1495
|
end
|
1439
1496
|
|
1440
|
-
def
|
1497
|
+
def convert_thematic_break(node, opts = {})
|
1441
1498
|
node.extend(Helpers)
|
1442
1499
|
node.instance_eval do
|
1443
1500
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1444
|
-
_buf = '';
|
1445
|
-
;
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
;
|
1454
|
-
;
|
1455
|
-
; @
|
1456
|
-
;
|
1457
|
-
; end; end;
|
1458
|
-
;
|
1459
|
-
; _slim_controls2 << ("<t".freeze); _slim_controls2 << ((tblsec).to_s); _slim_controls2 << (">".freeze);
|
1460
|
-
; @rows[tblsec].each do |row|;
|
1461
|
-
; _slim_controls2 << ("<tr>".freeze);
|
1462
|
-
; row.each do |cell|;
|
1463
|
-
;
|
1464
|
-
; if tblsec == :head;
|
1465
|
-
; cell_content = cell.text;
|
1466
|
-
; else;
|
1467
|
-
; case cell.style;
|
1468
|
-
; when :literal;
|
1469
|
-
; cell_content = cell.text;
|
1470
|
-
; else;
|
1471
|
-
; cell_content = cell.content;
|
1472
|
-
; end; end; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
|
1473
|
-
:class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
|
1474
|
-
:colspan=>cell.colspan, :rowspan=>cell.rowspan,
|
1475
|
-
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do; _slim_controls4 = '';
|
1476
|
-
; if tblsec == :head;
|
1477
|
-
; _slim_controls4 << ((cell_content).to_s);
|
1501
|
+
_buf = ''; _buf << ("<hr>".freeze);
|
1502
|
+
; _buf
|
1503
|
+
end
|
1504
|
+
end
|
1505
|
+
|
1506
|
+
def convert_inline_callout(node, opts = {})
|
1507
|
+
node.extend(Helpers)
|
1508
|
+
node.instance_eval do
|
1509
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1510
|
+
_buf = ''; if @document.attr? :icons, 'font';
|
1511
|
+
; _buf << ("<i class=\"conum\"".freeze); _slim_codeattributes1 = @text; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" data-value".freeze); else; _buf << (" data-value=\"".freeze); _buf << ((_slim_codeattributes1).to_s); _buf << ("\"".freeze); end; end; _buf << ("></i><b>".freeze);
|
1512
|
+
; _buf << (("(#{@text})").to_s);
|
1513
|
+
; _buf << ("</b>".freeze); elsif @document.attr? :icons;
|
1514
|
+
; _buf << ("<img".freeze); _slim_codeattributes2 = icon_uri("callouts/#{@text}"); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" src".freeze); else; _buf << (" src=\"".freeze); _buf << ((_slim_codeattributes2).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes3 = @text; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" alt".freeze); else; _buf << (" alt=\"".freeze); _buf << ((_slim_codeattributes3).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze);
|
1478
1515
|
; else;
|
1479
|
-
;
|
1480
|
-
;
|
1481
|
-
; _slim_controls4 << ("<div>".freeze); _slim_controls4 << ((cell_content).to_s);
|
1482
|
-
; _slim_controls4 << ("</div>".freeze); when :literal;
|
1483
|
-
; _slim_controls4 << ("<div class=\"literal\"><pre>".freeze); _slim_controls4 << ((cell_content).to_s);
|
1484
|
-
; _slim_controls4 << ("</pre></div>".freeze); when :header;
|
1485
|
-
; cell_content.each do |text|;
|
1486
|
-
; _slim_controls4 << ("<p class=\"tableblock header\">".freeze); _slim_controls4 << ((text).to_s);
|
1487
|
-
; _slim_controls4 << ("</p>".freeze); end; else;
|
1488
|
-
; cell_content.each do |text|;
|
1489
|
-
; _slim_controls4 << ("<p class=\"tableblock\">".freeze); _slim_controls4 << ((text).to_s);
|
1490
|
-
; _slim_controls4 << ("</p>".freeze); end; end; end; _slim_controls4; end; _slim_controls2 << ((_slim_controls3).to_s); end; _slim_controls2 << ("</tr>".freeze); end; end; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1516
|
+
; _buf << ("<b>".freeze); _buf << (("(#{@text})").to_s);
|
1517
|
+
; _buf << ("</b>".freeze); end; _buf
|
1491
1518
|
end
|
1492
1519
|
end
|
1493
1520
|
|
1494
|
-
def
|
1521
|
+
def convert_ruler(node, opts = {})
|
1495
1522
|
node.extend(Helpers)
|
1496
1523
|
node.instance_eval do
|
1497
1524
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1498
|
-
_buf = '';
|
1499
|
-
;
|
1525
|
+
_buf = ''; _buf << ("<hr>".freeze);
|
1500
1526
|
; _buf
|
1501
1527
|
end
|
1502
1528
|
end
|
1503
1529
|
|
1504
|
-
def
|
1530
|
+
def convert_image(node, opts = {})
|
1505
1531
|
node.extend(Helpers)
|
1506
1532
|
node.instance_eval do
|
1507
1533
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1508
|
-
_buf = '';
|
1509
|
-
; if
|
1510
|
-
;
|
1511
|
-
;
|
1512
|
-
;
|
1513
|
-
;
|
1514
|
-
;
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1534
|
+
_buf = ''; unless attributes[1] == 'background' || attributes[1] == 'canvas';
|
1535
|
+
; inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ');
|
1536
|
+
; _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 = '';
|
1537
|
+
; _slim_controls2 << ((convert_image).to_s);
|
1538
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); if title?;
|
1539
|
+
; _buf << ("<div class=\"title\">".freeze); _buf << ((captioned_title).to_s);
|
1540
|
+
; _buf << ("</div>".freeze); end; end; _buf
|
1541
|
+
end
|
1542
|
+
end
|
1543
|
+
|
1544
|
+
def convert_example(node, opts = {})
|
1545
|
+
node.extend(Helpers)
|
1546
|
+
node.instance_eval do
|
1547
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1548
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['exampleblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1520
1549
|
; if title?;
|
1521
1550
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1522
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze);
|
1523
|
-
;
|
1524
|
-
|
1551
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
1552
|
+
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1553
|
+
end
|
1554
|
+
end
|
1555
|
+
|
1556
|
+
def convert_toc(node, opts = {})
|
1557
|
+
node.extend(Helpers)
|
1558
|
+
node.instance_eval do
|
1559
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1560
|
+
_buf = '';
|
1561
|
+
;
|
1562
|
+
;
|
1563
|
+
;
|
1564
|
+
;
|
1565
|
+
;
|
1566
|
+
;
|
1567
|
+
;
|
1568
|
+
;
|
1569
|
+
;
|
1570
|
+
;
|
1571
|
+
;
|
1572
|
+
;
|
1573
|
+
; _buf << ("<div id=\"toc\"".freeze); _temple_html_attributeremover1 = ''; _slim_codeattributes1 = (document.attr 'toc-class', 'toc'); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes1).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << ("><div id=\"toctitle\">".freeze);
|
1574
|
+
; _buf << (((document.attr 'toc-title')).to_s);
|
1575
|
+
; _buf << ("</div>".freeze);
|
1576
|
+
; _buf << ((converter.convert document, 'outline').to_s);
|
1577
|
+
; _buf << ("</div>".freeze); _buf
|
1578
|
+
end
|
1579
|
+
end
|
1580
|
+
|
1581
|
+
def convert_open(node, opts = {})
|
1582
|
+
node.extend(Helpers)
|
1583
|
+
node.instance_eval do
|
1584
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1585
|
+
_buf = ''; if @style == 'abstract';
|
1586
|
+
; if @parent == @document && @document.doctype == 'book';
|
1587
|
+
; puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.';
|
1588
|
+
; else;
|
1589
|
+
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1590
|
+
; if title?;
|
1591
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1592
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
1593
|
+
; _slim_controls2 << ("</blockquote>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book');
|
1594
|
+
; 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.';
|
1595
|
+
; else;
|
1596
|
+
; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
1597
|
+
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
1598
|
+
; _buf << ("</aside>".freeze);
|
1525
1599
|
; else;
|
1526
|
-
;
|
1527
|
-
;
|
1528
|
-
;
|
1529
|
-
;
|
1530
|
-
;
|
1531
|
-
; _slim_controls2 << ("<pre".freeze); _temple_html_attributeremover3 = ''; _slim_codeattributes4 = [('nowrap' if nowrap)]; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover3 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover3 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover3; if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\"".freeze); _slim_controls2 << ((_temple_html_attributeremover3).to_s); _slim_controls2 << ("\"".freeze); end; _slim_controls2 << (">".freeze);
|
1532
|
-
; _slim_controls2 << ((content || '').to_s);
|
1533
|
-
; _slim_controls2 << ("</pre>".freeze); end; end; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1600
|
+
; _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 = '';
|
1601
|
+
; if title?;
|
1602
|
+
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
1603
|
+
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<div class=\"content\">".freeze); _slim_controls4 << ((content).to_s);
|
1604
|
+
; _slim_controls4 << ("</div>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; end; _buf
|
1534
1605
|
end
|
1535
1606
|
end
|
1536
1607
|
|
1537
|
-
def
|
1608
|
+
def convert_pass(node, opts = {})
|
1538
1609
|
node.extend(Helpers)
|
1539
1610
|
node.instance_eval do
|
1540
1611
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1541
|
-
_buf = '';
|
1542
|
-
;
|
1543
|
-
; refid = (attr :refid) || @target;
|
1544
|
-
; _slim_controls1 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1545
|
-
; _slim_controls2 << (((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')).to_s);
|
1546
|
-
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); when :ref;
|
1547
|
-
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
1548
|
-
; when :bibref;
|
1549
|
-
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
1550
|
-
; _buf << ("[".freeze); _buf << ((@target).to_s); _buf << ("]".freeze);
|
1551
|
-
; else;
|
1552
|
-
; _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 = '';
|
1553
|
-
; _slim_controls4 << ((@text).to_s);
|
1554
|
-
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1612
|
+
_buf = ''; _buf << ((content).to_s);
|
1613
|
+
; _buf
|
1555
1614
|
end
|
1556
1615
|
end
|
1557
1616
|
|
1558
|
-
def
|
1617
|
+
def convert_section(node, opts = {})
|
1559
1618
|
node.extend(Helpers)
|
1560
1619
|
node.instance_eval do
|
1561
1620
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1630,7 +1689,8 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1630
1689
|
;
|
1631
1690
|
;
|
1632
1691
|
;
|
1633
|
-
;
|
1692
|
+
;
|
1693
|
+
; _buf << ("<section".freeze); _slim_codeattributes1 = (titleless ? nil : id); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id".freeze); else; _buf << (" id=\"".freeze); _buf << ((_slim_codeattributes1).to_s); _buf << ("\"".freeze); end; end; _temple_html_attributeremover1 = ''; _slim_codeattributes2 = roles; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes2.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes2).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _slim_codeattributes3 = (attr "background-gradient"); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" data-background-gradient".freeze); else; _buf << (" data-background-gradient=\"".freeze); _buf << ((_slim_codeattributes3).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes4 = (attr 'transition'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" data-transition".freeze); else; _buf << (" data-transition=\"".freeze); _buf << ((_slim_codeattributes4).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes5 = (attr 'transition-speed'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" data-transition-speed".freeze); else; _buf << (" data-transition-speed=\"".freeze); _buf << ((_slim_codeattributes5).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes6 = data_background_color; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" data-background-color".freeze); else; _buf << (" data-background-color=\"".freeze); _buf << ((_slim_codeattributes6).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes7 = data_background_image; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" data-background-image".freeze); else; _buf << (" data-background-image=\"".freeze); _buf << ((_slim_codeattributes7).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes8 = (data_background_size || attr('background-size')); if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" data-background-size".freeze); else; _buf << (" data-background-size=\"".freeze); _buf << ((_slim_codeattributes8).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes9 = (data_background_repeat || attr('background-repeat')); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" data-background-repeat".freeze); else; _buf << (" data-background-repeat=\"".freeze); _buf << ((_slim_codeattributes9).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes10 = (data_background_transition || attr('background-transition')); if _slim_codeattributes10; if _slim_codeattributes10 == true; _buf << (" data-background-transition".freeze); else; _buf << (" data-background-transition=\"".freeze); _buf << ((_slim_codeattributes10).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes11 = (data_background_position || attr('background-position')); if _slim_codeattributes11; if _slim_codeattributes11 == true; _buf << (" data-background-position".freeze); else; _buf << (" data-background-position=\"".freeze); _buf << ((_slim_codeattributes11).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes12 = (attr "background-iframe"); if _slim_codeattributes12; if _slim_codeattributes12 == true; _buf << (" data-background-iframe".freeze); else; _buf << (" data-background-iframe=\"".freeze); _buf << ((_slim_codeattributes12).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes13 = data_background_video; if _slim_codeattributes13; if _slim_codeattributes13 == true; _buf << (" data-background-video".freeze); else; _buf << (" data-background-video=\"".freeze); _buf << ((_slim_codeattributes13).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes14 = ((attr? 'background-video-loop') || (option? 'loop')); if _slim_codeattributes14; if _slim_codeattributes14 == true; _buf << (" data-background-video-loop".freeze); else; _buf << (" data-background-video-loop=\"".freeze); _buf << ((_slim_codeattributes14).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes15 = ((attr? 'background-video-muted') || (option? 'muted')); if _slim_codeattributes15; if _slim_codeattributes15 == true; _buf << (" data-background-video-muted".freeze); else; _buf << (" data-background-video-muted=\"".freeze); _buf << ((_slim_codeattributes15).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes16 = (attr "background-opacity"); if _slim_codeattributes16; if _slim_codeattributes16 == true; _buf << (" data-background-opacity".freeze); else; _buf << (" data-background-opacity=\"".freeze); _buf << ((_slim_codeattributes16).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes17 = (attr "autoslide"); if _slim_codeattributes17; if _slim_codeattributes17 == true; _buf << (" data-autoslide".freeze); else; _buf << (" data-autoslide=\"".freeze); _buf << ((_slim_codeattributes17).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes18 = (attr 'state'); if _slim_codeattributes18; if _slim_codeattributes18 == true; _buf << (" data-state".freeze); else; _buf << (" data-state=\"".freeze); _buf << ((_slim_codeattributes18).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes19 = ((attr? 'auto-animate') || (option? 'auto-animate')); if _slim_codeattributes19; if _slim_codeattributes19 == true; _buf << (" data-auto-animate".freeze); else; _buf << (" data-auto-animate=\"".freeze); _buf << ((_slim_codeattributes19).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes20 = ((attr 'auto-animate-easing') || (option? 'auto-animate-easing')); if _slim_codeattributes20; if _slim_codeattributes20 == true; _buf << (" data-auto-animate-easing".freeze); else; _buf << (" data-auto-animate-easing=\"".freeze); _buf << ((_slim_codeattributes20).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes21 = ((attr 'auto-animate-unmatched') || (option? 'auto-animate-unmatched')); if _slim_codeattributes21; if _slim_codeattributes21 == true; _buf << (" data-auto-animate-unmatched".freeze); else; _buf << (" data-auto-animate-unmatched=\"".freeze); _buf << ((_slim_codeattributes21).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes22 = ((attr 'auto-animate-duration') || (option? 'auto-animate-duration')); if _slim_codeattributes22; if _slim_codeattributes22 == true; _buf << (" data-auto-animate-duration".freeze); else; _buf << (" data-auto-animate-duration=\"".freeze); _buf << ((_slim_codeattributes22).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes23 = (attr 'auto-animate-id'); if _slim_codeattributes23; if _slim_codeattributes23 == true; _buf << (" data-auto-animate-id".freeze); else; _buf << (" data-auto-animate-id=\"".freeze); _buf << ((_slim_codeattributes23).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes24 = ((attr? 'auto-animate-restart') || (option? 'auto-animate-restart')); if _slim_codeattributes24; if _slim_codeattributes24 == true; _buf << (" data-auto-animate-restart".freeze); else; _buf << (" data-auto-animate-restart=\"".freeze); _buf << ((_slim_codeattributes24).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze);
|
1634
1694
|
; unless hide_title;
|
1635
1695
|
; _buf << ("<h2>".freeze); _buf << ((section_title).to_s);
|
1636
1696
|
; _buf << ("</h2>".freeze); end; if parent_section_with_vertical_slides;
|
@@ -1668,184 +1728,122 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1668
1728
|
end
|
1669
1729
|
end
|
1670
1730
|
|
1671
|
-
def
|
1731
|
+
def convert_inline_quoted(node, opts = {})
|
1672
1732
|
node.extend(Helpers)
|
1673
1733
|
node.instance_eval do
|
1674
1734
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1675
|
-
_buf = '';
|
1676
|
-
; if
|
1677
|
-
;
|
1678
|
-
; else;
|
1679
|
-
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1680
|
-
; if title?;
|
1681
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1682
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
1683
|
-
; _slim_controls2 << ("</blockquote>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book');
|
1684
|
-
; 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.';
|
1735
|
+
_buf = ''; quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sub' };
|
1736
|
+
; if (quote_tag = quote_tags[@type]);
|
1737
|
+
; _buf << ((html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)).to_s);
|
1685
1738
|
; else;
|
1686
|
-
;
|
1687
|
-
;
|
1688
|
-
; _buf << ("
|
1739
|
+
; case @type;
|
1740
|
+
; when :double;
|
1741
|
+
; _buf << ((inline_text_container("“#{@text}”")).to_s);
|
1742
|
+
; when :single;
|
1743
|
+
; _buf << ((inline_text_container("‘#{@text}’")).to_s);
|
1744
|
+
; when :asciimath, :latexmath;
|
1745
|
+
; open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type];
|
1746
|
+
; _buf << ((inline_text_container("#{open}#{@text}#{close}")).to_s);
|
1689
1747
|
; else;
|
1690
|
-
;
|
1691
|
-
;
|
1692
|
-
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
1693
|
-
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<div class=\"content\">".freeze); _slim_controls4 << ((content).to_s);
|
1694
|
-
; _slim_controls4 << ("</div>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; end; _buf
|
1695
|
-
end
|
1696
|
-
end
|
1697
|
-
|
1698
|
-
def inline_footnote(node, opts = {})
|
1699
|
-
node.extend(Helpers)
|
1700
|
-
node.instance_eval do
|
1701
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
1702
|
-
_buf = ''; footnote = slide_footnote(self);
|
1703
|
-
; index = footnote.attr(:index);
|
1704
|
-
; id = footnote.id;
|
1705
|
-
; if @type == :xref;
|
1706
|
-
; _slim_controls1 = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls2 = '';
|
1707
|
-
; _slim_controls2 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
1708
|
-
; _slim_controls2 << ((index).to_s);
|
1709
|
-
; _slim_controls2 << ("</span>]".freeze);
|
1710
|
-
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
1711
|
-
; _slim_controls3 = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls4 = '';
|
1712
|
-
; _slim_controls4 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
1713
|
-
; _slim_controls4 << ((index).to_s);
|
1714
|
-
; _slim_controls4 << ("</span>]".freeze);
|
1715
|
-
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1716
|
-
end
|
1717
|
-
end
|
1718
|
-
|
1719
|
-
def image(node, opts = {})
|
1720
|
-
node.extend(Helpers)
|
1721
|
-
node.instance_eval do
|
1722
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
1723
|
-
_buf = ''; unless attributes[1] == 'background' || attributes[1] == 'canvas';
|
1724
|
-
; inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ');
|
1725
|
-
; _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 = '';
|
1726
|
-
; _slim_controls2 << ((convert_image).to_s);
|
1727
|
-
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); if title?;
|
1728
|
-
; _buf << ("<div class=\"title\">".freeze); _buf << ((captioned_title).to_s);
|
1729
|
-
; _buf << ("</div>".freeze); end; end; _buf
|
1730
|
-
end
|
1731
|
-
end
|
1732
|
-
|
1733
|
-
def title_slide(node, opts = {})
|
1734
|
-
node.extend(Helpers)
|
1735
|
-
node.instance_eval do
|
1736
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
1737
|
-
_buf = ''; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil;
|
1738
|
-
; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil;
|
1739
|
-
;
|
1740
|
-
;
|
1741
|
-
;
|
1742
|
-
;
|
1743
|
-
;
|
1744
|
-
;
|
1745
|
-
;
|
1746
|
-
;
|
1747
|
-
;
|
1748
|
-
;
|
1749
|
-
;
|
1750
|
-
;
|
1751
|
-
;
|
1752
|
-
;
|
1753
|
-
;
|
1754
|
-
; _buf << ("<section".freeze); _temple_html_attributeremover1 = ''; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "title"; _temple_html_attributemerger1[1] = ''; _slim_codeattributes1 = role; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << ((_slim_codeattributes1.join(" ")).to_s); else; _temple_html_attributemerger1[1] << ((_slim_codeattributes1).to_s); end; _temple_html_attributemerger1[1]; _temple_html_attributeremover1 << ((_temple_html_attributemerger1.reject(&:empty?).join(" ")).to_s); _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _buf << (" class=\"".freeze); _buf << ((_temple_html_attributeremover1).to_s); _buf << ("\"".freeze); end; _buf << (" data-state=\"title\"".freeze); _slim_codeattributes2 = (attr 'title-slide-transition'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" data-transition".freeze); else; _buf << (" data-transition=\"".freeze); _buf << ((_slim_codeattributes2).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes3 = (attr 'title-slide-transition-speed'); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" data-transition-speed".freeze); else; _buf << (" data-transition-speed=\"".freeze); _buf << ((_slim_codeattributes3).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes4 = (attr 'title-slide-background'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" data-background".freeze); else; _buf << (" data-background=\"".freeze); _buf << ((_slim_codeattributes4).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes5 = (attr 'title-slide-background-size'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" data-background-size".freeze); else; _buf << (" data-background-size=\"".freeze); _buf << ((_slim_codeattributes5).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes6 = bg_image; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" data-background-image".freeze); else; _buf << (" data-background-image=\"".freeze); _buf << ((_slim_codeattributes6).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes7 = bg_video; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" data-background-video".freeze); else; _buf << (" data-background-video=\"".freeze); _buf << ((_slim_codeattributes7).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes8 = (attr 'title-slide-background-video-loop'); if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" data-background-video-loop".freeze); else; _buf << (" data-background-video-loop=\"".freeze); _buf << ((_slim_codeattributes8).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes9 = (attr 'title-slide-background-video-muted'); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" data-background-video-muted".freeze); else; _buf << (" data-background-video-muted=\"".freeze); _buf << ((_slim_codeattributes9).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes10 = (attr 'title-slide-background-opacity'); if _slim_codeattributes10; if _slim_codeattributes10 == true; _buf << (" data-background-opacity".freeze); else; _buf << (" data-background-opacity=\"".freeze); _buf << ((_slim_codeattributes10).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes11 = (attr 'title-slide-background-iframe'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _buf << (" data-background-iframe".freeze); else; _buf << (" data-background-iframe=\"".freeze); _buf << ((_slim_codeattributes11).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes12 = (attr 'title-slide-background-color'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _buf << (" data-background-color".freeze); else; _buf << (" data-background-color=\"".freeze); _buf << ((_slim_codeattributes12).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes13 = (attr 'title-slide-background-repeat'); if _slim_codeattributes13; if _slim_codeattributes13 == true; _buf << (" data-background-repeat".freeze); else; _buf << (" data-background-repeat=\"".freeze); _buf << ((_slim_codeattributes13).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes14 = (attr 'title-slide-background-position'); if _slim_codeattributes14; if _slim_codeattributes14 == true; _buf << (" data-background-position".freeze); else; _buf << (" data-background-position=\"".freeze); _buf << ((_slim_codeattributes14).to_s); _buf << ("\"".freeze); end; end; _slim_codeattributes15 = (attr 'title-slide-background-transition'); if _slim_codeattributes15; if _slim_codeattributes15 == true; _buf << (" data-background-transition".freeze); else; _buf << (" data-background-transition=\"".freeze); _buf << ((_slim_codeattributes15).to_s); _buf << ("\"".freeze); end; end; _buf << (">".freeze);
|
1755
|
-
; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?;
|
1756
|
-
; _buf << ("<h1>".freeze); _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s);
|
1757
|
-
; _buf << ("</h1><h2>".freeze); _buf << ((slice_text _title_obj.subtitle, _slice).to_s);
|
1758
|
-
; _buf << ("</h2>".freeze); else;
|
1759
|
-
; _buf << ("<h1>".freeze); _buf << ((@header.title).to_s);
|
1760
|
-
; _buf << ("</h1>".freeze); end; preamble = @document.find_by context: :preamble;
|
1761
|
-
; unless preamble.nil? or preamble.length == 0;
|
1762
|
-
; _buf << ("<div class=\"preamble\">".freeze); _buf << ((preamble.pop.content).to_s);
|
1763
|
-
; _buf << ("</div>".freeze); end; _buf << ((generate_authors(@document)).to_s);
|
1764
|
-
; _buf << ("</section>".freeze); _buf
|
1748
|
+
; _buf << ((inline_text_container(@text)).to_s);
|
1749
|
+
; end; end; _buf
|
1765
1750
|
end
|
1766
1751
|
end
|
1767
1752
|
|
1768
|
-
def
|
1753
|
+
def convert_dlist(node, opts = {})
|
1769
1754
|
node.extend(Helpers)
|
1770
1755
|
node.instance_eval do
|
1771
1756
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1772
|
-
_buf = '';
|
1757
|
+
_buf = ''; case @style;
|
1758
|
+
; when 'qanda';
|
1759
|
+
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['qlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1773
1760
|
; if title?;
|
1774
1761
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1775
|
-
; _slim_controls2 << ("</div>".freeze); end;
|
1776
|
-
;
|
1777
|
-
; _slim_controls2 << ("
|
1778
|
-
;
|
1779
|
-
; _slim_controls2 << ("
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
;
|
1789
|
-
;
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
;
|
1799
|
-
;
|
1800
|
-
;
|
1801
|
-
;
|
1802
|
-
;
|
1803
|
-
;
|
1804
|
-
;
|
1762
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<ol>".freeze);
|
1763
|
+
; items.each do |questions, answer|;
|
1764
|
+
; _slim_controls2 << ("<li>".freeze);
|
1765
|
+
; [*questions].each do |question|;
|
1766
|
+
; _slim_controls2 << ("<p><em>".freeze); _slim_controls2 << ((question.text).to_s);
|
1767
|
+
; _slim_controls2 << ("</em></p>".freeze); end; unless answer.nil?;
|
1768
|
+
; if answer.text?;
|
1769
|
+
; _slim_controls2 << ("<p>".freeze); _slim_controls2 << ((answer.text).to_s);
|
1770
|
+
; _slim_controls2 << ("</p>".freeze); end; if answer.blocks?;
|
1771
|
+
; _slim_controls2 << ((answer.content).to_s);
|
1772
|
+
; end; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); when 'horizontal';
|
1773
|
+
; _slim_controls3 = html_tag('div', { :id => @id, :class => ['hdlist', role] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
1774
|
+
; if title?;
|
1775
|
+
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
1776
|
+
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<table>".freeze);
|
1777
|
+
; if (attr? :labelwidth) || (attr? :itemwidth);
|
1778
|
+
; _slim_controls4 << ("<colgroup><col".freeze);
|
1779
|
+
; _slim_codeattributes1 = ((attr? :labelwidth) ? %(width:#{(attr :labelwidth).chomp '%'}%;) : nil); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls4 << (" style".freeze); else; _slim_controls4 << (" style=\"".freeze); _slim_controls4 << ((_slim_codeattributes1).to_s); _slim_controls4 << ("\"".freeze); end; end; _slim_controls4 << ("><col".freeze);
|
1780
|
+
; _slim_codeattributes2 = ((attr? :itemwidth) ? %(width:#{(attr :itemwidth).chomp '%'}%;) : nil); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls4 << (" style".freeze); else; _slim_controls4 << (" style=\"".freeze); _slim_controls4 << ((_slim_codeattributes2).to_s); _slim_controls4 << ("\"".freeze); end; end; _slim_controls4 << ("></colgroup>".freeze);
|
1781
|
+
; end; items.each do |terms, dd|;
|
1782
|
+
; _slim_controls4 << ("<tr><td".freeze);
|
1783
|
+
; _temple_html_attributeremover1 = ''; _slim_codeattributes3 = ['hdlist1',('strong' if option? 'strong')]; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover1 << ((_slim_codeattributes3.join(" ")).to_s); else; _temple_html_attributeremover1 << ((_slim_codeattributes3).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; _slim_controls4 << (" class=\"".freeze); _slim_controls4 << ((_temple_html_attributeremover1).to_s); _slim_controls4 << ("\"".freeze); end; _slim_controls4 << (">".freeze);
|
1784
|
+
; terms = [*terms];
|
1785
|
+
; last_term = terms.last;
|
1786
|
+
; terms.each do |dt|;
|
1787
|
+
; _slim_controls4 << ((dt.text).to_s);
|
1788
|
+
; if dt != last_term;
|
1789
|
+
; _slim_controls4 << ("<br>".freeze);
|
1790
|
+
; end; end; _slim_controls4 << ("</td><td class=\"hdlist2\">".freeze);
|
1791
|
+
; unless dd.nil?;
|
1792
|
+
; if dd.text?;
|
1793
|
+
; _slim_controls4 << ("<p>".freeze); _slim_controls4 << ((dd.text).to_s);
|
1794
|
+
; _slim_controls4 << ("</p>".freeze); end; if dd.blocks?;
|
1795
|
+
; _slim_controls4 << ((dd.content).to_s);
|
1796
|
+
; end; end; _slim_controls4 << ("</td></tr>".freeze); end; _slim_controls4 << ("</table>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else;
|
1797
|
+
; _slim_controls5 = html_tag('div', { :id => @id, :class => ['dlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls6 = '';
|
1798
|
+
; if title?;
|
1799
|
+
; _slim_controls6 << ("<div class=\"title\">".freeze); _slim_controls6 << ((title).to_s);
|
1800
|
+
; _slim_controls6 << ("</div>".freeze); end; _slim_controls6 << ("<dl>".freeze);
|
1801
|
+
; items.each do |terms, dd|;
|
1802
|
+
; [*terms].each do |dt|;
|
1803
|
+
; _slim_controls6 << ("<dt".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes4 = ('hdlist1' unless @style); if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << ((_slim_codeattributes4.join(" ")).to_s); else; _temple_html_attributeremover2 << ((_slim_codeattributes4).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; _slim_controls6 << (" class=\"".freeze); _slim_controls6 << ((_temple_html_attributeremover2).to_s); _slim_controls6 << ("\"".freeze); end; _slim_controls6 << (">".freeze); _slim_controls6 << ((dt.text).to_s);
|
1804
|
+
; _slim_controls6 << ("</dt>".freeze); end; unless dd.nil?;
|
1805
|
+
; _slim_controls6 << ("<dd>".freeze);
|
1806
|
+
; if dd.text?;
|
1807
|
+
; _slim_controls6 << ("<p>".freeze); _slim_controls6 << ((dd.text).to_s);
|
1808
|
+
; _slim_controls6 << ("</p>".freeze); end; if dd.blocks?;
|
1809
|
+
; _slim_controls6 << ((dd.content).to_s);
|
1810
|
+
; end; _slim_controls6 << ("</dd>".freeze); end; end; _slim_controls6 << ("</dl>".freeze); _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf
|
1805
1811
|
end
|
1806
1812
|
end
|
1807
1813
|
|
1808
|
-
def
|
1814
|
+
def convert_audio(node, opts = {})
|
1809
1815
|
node.extend(Helpers)
|
1810
1816
|
node.instance_eval do
|
1811
1817
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1812
|
-
_buf = ''; _slim_controls1 = html_tag('
|
1813
|
-
;
|
1818
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['audioblock', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1819
|
+
; if title?;
|
1820
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1821
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\"><audio".freeze);
|
1822
|
+
; _slim_codeattributes1 = media_uri(attr :target); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes1).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes2 = (option? 'autoplay'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" autoplay".freeze); else; _slim_controls2 << (" autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = !(option? 'nocontrols'); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" controls".freeze); else; _slim_controls2 << (" controls=\"".freeze); _slim_controls2 << ((_slim_codeattributes3).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes4 = (option? 'loop'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" loop".freeze); else; _slim_controls2 << (" loop=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">Your browser does not support the audio tag.</audio></div>".freeze);
|
1823
|
+
;
|
1814
1824
|
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1815
1825
|
end
|
1816
1826
|
end
|
1817
1827
|
|
1818
|
-
def
|
1819
|
-
node.extend(Helpers)
|
1820
|
-
node.instance_eval do
|
1821
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
1822
|
-
_buf = ''; quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sub' };
|
1823
|
-
; if (quote_tag = quote_tags[@type]);
|
1824
|
-
; _buf << ((html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)).to_s);
|
1825
|
-
; else;
|
1826
|
-
; case @type;
|
1827
|
-
; when :double;
|
1828
|
-
; _buf << ((inline_text_container("“#{@text}”")).to_s);
|
1829
|
-
; when :single;
|
1830
|
-
; _buf << ((inline_text_container("‘#{@text}’")).to_s);
|
1831
|
-
; when :asciimath, :latexmath;
|
1832
|
-
; open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type];
|
1833
|
-
; _buf << ((inline_text_container("#{open}#{@text}#{close}")).to_s);
|
1834
|
-
; else;
|
1835
|
-
; _buf << ((inline_text_container(@text)).to_s);
|
1836
|
-
; end; end; _buf
|
1837
|
-
end
|
1838
|
-
end
|
1839
|
-
|
1840
|
-
def example(node, opts = {})
|
1828
|
+
def convert_verse(node, opts = {})
|
1841
1829
|
node.extend(Helpers)
|
1842
1830
|
node.instance_eval do
|
1843
1831
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1844
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['
|
1832
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['verseblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1845
1833
|
; if title?;
|
1846
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((
|
1847
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<
|
1848
|
-
; _slim_controls2 << ("</
|
1834
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1835
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<pre class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
1836
|
+
; _slim_controls2 << ("</pre>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
1837
|
+
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
1838
|
+
; if attribution || citetitle;
|
1839
|
+
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
1840
|
+
; if citetitle;
|
1841
|
+
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
1842
|
+
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
1843
|
+
; if citetitle;
|
1844
|
+
; _slim_controls2 << ("<br>".freeze);
|
1845
|
+
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
1846
|
+
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1849
1847
|
end
|
1850
1848
|
end
|
1851
1849
|
#------------------ End of generated transformation methods ------------------#
|