asciidoctor-revealjs 5.0.1 → 5.1.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 +2 -0
- data/asciidoctor-revealjs.gemspec +1 -1
- data/examples/release-5.1.adoc +43 -0
- data/examples/release-5.1.css +7 -0
- data/lib/asciidoctor-revealjs/converter.rb +582 -585
- data/lib/asciidoctor-revealjs/version.rb +1 -1
- data/templates/section.html.slim +1 -0
- metadata +6 -4
@@ -501,78 +501,33 @@ 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 = {})
|
541
|
-
node.extend(Helpers)
|
542
|
-
node.instance_eval do
|
543
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
544
|
-
_buf = ''; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
545
|
-
; _buf << ("</aside>".freeze); _buf
|
546
|
-
end
|
547
|
-
end
|
548
|
-
|
549
|
-
def thematic_break(node, opts = {})
|
550
|
-
node.extend(Helpers)
|
551
|
-
node.instance_eval do
|
552
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
553
|
-
_buf = ''; _buf << ("<hr>".freeze);
|
554
|
-
; _buf
|
555
|
-
end
|
556
|
-
end
|
557
|
-
|
558
|
-
def olist(node, opts = {})
|
518
|
+
def convert_example(node, opts = {})
|
559
519
|
node.extend(Helpers)
|
560
520
|
node.instance_eval do
|
561
521
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
562
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['
|
522
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['exampleblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
563
523
|
; if title?;
|
564
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((
|
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
|
524
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
525
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
526
|
+
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
572
527
|
end
|
573
528
|
end
|
574
529
|
|
575
|
-
def
|
530
|
+
def convert_inline_button(node, opts = {})
|
576
531
|
node.extend(Helpers)
|
577
532
|
node.instance_eval do
|
578
533
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -582,43 +537,45 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
582
537
|
end
|
583
538
|
end
|
584
539
|
|
585
|
-
def
|
540
|
+
def convert_colist(node, opts = {})
|
586
541
|
node.extend(Helpers)
|
587
542
|
node.instance_eval do
|
588
543
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
589
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['
|
544
|
+
_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 = '';
|
590
545
|
; if title?;
|
591
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((
|
592
|
-
; _slim_controls2 << ("</div>".freeze); end;
|
593
|
-
;
|
546
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
547
|
+
; _slim_controls2 << ("</div>".freeze); end; if @document.attr? :icons;
|
548
|
+
; font_icons = @document.attr? :icons, 'font';
|
549
|
+
; _slim_controls2 << ("<table>".freeze);
|
550
|
+
; items.each_with_index do |item, i|;
|
551
|
+
; num = i + 1;
|
552
|
+
; _slim_controls2 << ("<tr><td>".freeze);
|
594
553
|
;
|
595
|
-
;
|
554
|
+
; if font_icons;
|
555
|
+
; _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);
|
556
|
+
; _slim_controls2 << ((num).to_s);
|
557
|
+
; _slim_controls2 << ("</b>".freeze); else;
|
558
|
+
; _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);
|
559
|
+
; end; _slim_controls2 << ("</td><td>".freeze); _slim_controls2 << ((item.text).to_s);
|
560
|
+
; _slim_controls2 << ("</td></tr>".freeze); end; _slim_controls2 << ("</table>".freeze); else;
|
561
|
+
; _slim_controls2 << ("<ol>".freeze);
|
562
|
+
; items.each do |item|;
|
563
|
+
; _slim_controls2 << ("<li><p>".freeze); _slim_controls2 << ((item.text).to_s);
|
564
|
+
; _slim_controls2 << ("</p></li>".freeze); end; _slim_controls2 << ("</ol>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
596
565
|
end
|
597
566
|
end
|
598
567
|
|
599
|
-
def
|
568
|
+
def convert_preamble(node, opts = {})
|
600
569
|
node.extend(Helpers)
|
601
570
|
node.instance_eval do
|
602
571
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
603
|
-
_buf = '';
|
604
|
-
;
|
605
|
-
;
|
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
|
572
|
+
_buf = '';
|
573
|
+
;
|
574
|
+
; _buf
|
618
575
|
end
|
619
576
|
end
|
620
577
|
|
621
|
-
def
|
578
|
+
def convert_sidebar(node, opts = {})
|
622
579
|
node.extend(Helpers)
|
623
580
|
node.instance_eval do
|
624
581
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -626,118 +583,25 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
626
583
|
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
627
584
|
; _buf << ("</aside>".freeze);
|
628
585
|
; else;
|
629
|
-
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['
|
630
|
-
; _slim_controls2 << ("<
|
631
|
-
;
|
632
|
-
; if @document.attr? :icons, 'font';
|
633
|
-
; icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning'];
|
634
|
-
; _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);
|
635
|
-
; elsif @document.attr? :icons;
|
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);
|
586
|
+
; _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 = '';
|
587
|
+
; _slim_controls2 << ("<div class=\"content\">".freeze);
|
640
588
|
; if title?;
|
641
589
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
642
590
|
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
643
|
-
; _slim_controls2 << ("</
|
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
|
661
|
-
end
|
662
|
-
end
|
663
|
-
|
664
|
-
def video(node, opts = {})
|
665
|
-
node.extend(Helpers)
|
666
|
-
node.instance_eval do
|
667
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
668
|
-
_buf = '';
|
669
|
-
;
|
670
|
-
; no_stretch = ((attr? :width) || (attr? :height));
|
671
|
-
; width = (attr? :width) ? (attr :width) : "100%";
|
672
|
-
; height = (attr? :height) ? (attr :height) : "100%";
|
673
|
-
;
|
674
|
-
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['videoblock', @style, role, (no_stretch ? nil : 'stretch'), ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
675
|
-
; if title?;
|
676
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
677
|
-
; _slim_controls2 << ("</div>".freeze); end; case attr :poster;
|
678
|
-
; when 'vimeo';
|
679
|
-
; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?;
|
680
|
-
; asset_uri_scheme = %(#{asset_uri_scheme}:);
|
681
|
-
; end; start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil;
|
682
|
-
; delimiter = ['?'];
|
683
|
-
; loop_param = (option? 'loop') ? %(#{delimiter.pop || '&'}loop=1) : '';
|
684
|
-
; muted_param = (option? 'muted') ? %(#{delimiter.pop || '&'}muted=1) : '';
|
685
|
-
; src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{loop_param}#{muted_param}#{start_anchor});
|
686
|
-
;
|
687
|
-
;
|
688
|
-
;
|
689
|
-
;
|
690
|
-
;
|
691
|
-
; _slim_controls2 << ("<iframe".freeze); _slim_codeattributes1 = (width); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes1).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes2 = (height); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = src; 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 = 0; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" frameborder".freeze); else; _slim_controls2 << (" frameborder=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (" webkitAllowFullScreen mozallowfullscreen allowFullScreen".freeze); _slim_codeattributes5 = (option? 'autoplay'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes5).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes6 = ((option? 'autoplay') ? "autoplay" : nil); if _slim_codeattributes6; if _slim_codeattributes6 == true; _slim_controls2 << (" allow".freeze); else; _slim_controls2 << (" allow=\"".freeze); _slim_controls2 << ((_slim_codeattributes6).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></iframe>".freeze);
|
692
|
-
; when 'youtube';
|
693
|
-
; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?;
|
694
|
-
; asset_uri_scheme = %(#{asset_uri_scheme}:);
|
695
|
-
; end; params = ['rel=0'];
|
696
|
-
; params << "start=#{attr :start}" if attr? :start;
|
697
|
-
; params << "end=#{attr :end}" if attr? :end;
|
698
|
-
; params << "loop=1" if option? 'loop';
|
699
|
-
; params << "mute=1" if option? 'muted';
|
700
|
-
; params << "controls=0" if option? 'nocontrols';
|
701
|
-
; src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&'});
|
702
|
-
;
|
703
|
-
;
|
704
|
-
;
|
705
|
-
;
|
706
|
-
;
|
707
|
-
; _slim_controls2 << ("<iframe".freeze); _slim_codeattributes7 = (width); if _slim_codeattributes7; if _slim_codeattributes7 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes7).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes8 = (height); if _slim_codeattributes8; if _slim_codeattributes8 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes8).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes9 = src; if _slim_codeattributes9; if _slim_codeattributes9 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes9).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes10 = 0; if _slim_codeattributes10; if _slim_codeattributes10 == true; _slim_controls2 << (" frameborder".freeze); else; _slim_controls2 << (" frameborder=\"".freeze); _slim_controls2 << ((_slim_codeattributes10).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes11 = !(option? 'nofullscreen'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _slim_controls2 << (" allowfullscreen".freeze); else; _slim_controls2 << (" allowfullscreen=\"".freeze); _slim_controls2 << ((_slim_codeattributes11).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes12 = (option? 'autoplay'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes12).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes13 = ((option? 'autoplay') ? "autoplay" : nil); if _slim_codeattributes13; if _slim_codeattributes13 == true; _slim_controls2 << (" allow".freeze); else; _slim_controls2 << (" allow=\"".freeze); _slim_controls2 << ((_slim_codeattributes13).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></iframe>".freeze);
|
708
|
-
; else;
|
709
|
-
;
|
710
|
-
;
|
711
|
-
;
|
712
|
-
; _slim_controls2 << ("<video".freeze); _slim_codeattributes14 = media_uri(attr :target); if _slim_codeattributes14; if _slim_codeattributes14 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes14).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes15 = (width); if _slim_codeattributes15; if _slim_codeattributes15 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes15).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes16 = (height); if _slim_codeattributes16; if _slim_codeattributes16 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes16).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes17 = ((attr :poster) ? media_uri(attr :poster) : nil); if _slim_codeattributes17; if _slim_codeattributes17 == true; _slim_controls2 << (" poster".freeze); else; _slim_controls2 << (" poster=\"".freeze); _slim_controls2 << ((_slim_codeattributes17).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes18 = (option? 'autoplay'); if _slim_codeattributes18; if _slim_codeattributes18 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes18).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes19 = !(option? 'nocontrols'); if _slim_codeattributes19; if _slim_codeattributes19 == true; _slim_controls2 << (" controls".freeze); else; _slim_controls2 << (" controls=\"".freeze); _slim_controls2 << ((_slim_codeattributes19).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes20 = (option? 'loop'); if _slim_codeattributes20; if _slim_codeattributes20 == true; _slim_controls2 << (" loop".freeze); else; _slim_controls2 << (" loop=\"".freeze); _slim_controls2 << ((_slim_codeattributes20).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">Your browser does not support the video tag.</video>".freeze);
|
713
|
-
;
|
714
|
-
; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
591
|
+
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
715
592
|
end
|
716
593
|
end
|
717
594
|
|
718
|
-
def
|
595
|
+
def convert_ruler(node, opts = {})
|
719
596
|
node.extend(Helpers)
|
720
597
|
node.instance_eval do
|
721
598
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
722
|
-
_buf = '';
|
723
|
-
;
|
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
|
599
|
+
_buf = ''; _buf << ("<hr>".freeze);
|
600
|
+
; _buf
|
737
601
|
end
|
738
602
|
end
|
739
603
|
|
740
|
-
def
|
604
|
+
def convert_inline_menu(node, opts = {})
|
741
605
|
node.extend(Helpers)
|
742
606
|
node.instance_eval do
|
743
607
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -761,7 +625,49 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
761
625
|
end
|
762
626
|
end
|
763
627
|
|
764
|
-
def
|
628
|
+
def convert_open(node, opts = {})
|
629
|
+
node.extend(Helpers)
|
630
|
+
node.instance_eval do
|
631
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
632
|
+
_buf = ''; if @style == 'abstract';
|
633
|
+
; if @parent == @document && @document.doctype == 'book';
|
634
|
+
; puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.';
|
635
|
+
; else;
|
636
|
+
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
637
|
+
; if title?;
|
638
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
639
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
640
|
+
; _slim_controls2 << ("</blockquote>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book');
|
641
|
+
; 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.';
|
642
|
+
; else;
|
643
|
+
; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
644
|
+
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
645
|
+
; _buf << ("</aside>".freeze);
|
646
|
+
; else;
|
647
|
+
; _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 = '';
|
648
|
+
; if title?;
|
649
|
+
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
650
|
+
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<div class=\"content\">".freeze); _slim_controls4 << ((content).to_s);
|
651
|
+
; _slim_controls4 << ("</div>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; end; _buf
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
def convert_paragraph(node, opts = {})
|
656
|
+
node.extend(Helpers)
|
657
|
+
node.instance_eval do
|
658
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
659
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['paragraph', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
660
|
+
; if title?;
|
661
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
662
|
+
; _slim_controls2 << ("</div>".freeze); end; if has_role? 'small';
|
663
|
+
; _slim_controls2 << ("<small>".freeze); _slim_controls2 << ((content).to_s);
|
664
|
+
; _slim_controls2 << ("</small>".freeze); else;
|
665
|
+
; _slim_controls2 << ("<p>".freeze); _slim_controls2 << ((content).to_s);
|
666
|
+
; _slim_controls2 << ("</p>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
667
|
+
end
|
668
|
+
end
|
669
|
+
|
670
|
+
def convert_toc(node, opts = {})
|
765
671
|
node.extend(Helpers)
|
766
672
|
node.instance_eval do
|
767
673
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -786,125 +692,99 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
786
692
|
end
|
787
693
|
end
|
788
694
|
|
789
|
-
def
|
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 = {})
|
695
|
+
def convert_dlist(node, opts = {})
|
807
696
|
node.extend(Helpers)
|
808
697
|
node.instance_eval do
|
809
698
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
810
|
-
_buf = '';
|
699
|
+
_buf = ''; case @style;
|
700
|
+
; when 'qanda';
|
701
|
+
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['qlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
811
702
|
; if title?;
|
812
703
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
813
|
-
; _slim_controls2 << ("</div>".freeze); end;
|
814
|
-
;
|
815
|
-
; _slim_controls2 << ("<
|
816
|
-
;
|
817
|
-
;
|
818
|
-
; _slim_controls2 << ("
|
819
|
-
;
|
820
|
-
;
|
821
|
-
; _slim_controls2 << ("
|
822
|
-
; _slim_controls2 << ((
|
823
|
-
; _slim_controls2 << ("</
|
824
|
-
;
|
825
|
-
;
|
826
|
-
;
|
827
|
-
;
|
828
|
-
;
|
829
|
-
;
|
830
|
-
;
|
704
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<ol>".freeze);
|
705
|
+
; items.each do |questions, answer|;
|
706
|
+
; _slim_controls2 << ("<li>".freeze);
|
707
|
+
; [*questions].each do |question|;
|
708
|
+
; _slim_controls2 << ("<p><em>".freeze); _slim_controls2 << ((question.text).to_s);
|
709
|
+
; _slim_controls2 << ("</em></p>".freeze); end; unless answer.nil?;
|
710
|
+
; if answer.text?;
|
711
|
+
; _slim_controls2 << ("<p>".freeze); _slim_controls2 << ((answer.text).to_s);
|
712
|
+
; _slim_controls2 << ("</p>".freeze); end; if answer.blocks?;
|
713
|
+
; _slim_controls2 << ((answer.content).to_s);
|
714
|
+
; end; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); when 'horizontal';
|
715
|
+
; _slim_controls3 = html_tag('div', { :id => @id, :class => ['hdlist', role] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
716
|
+
; if title?;
|
717
|
+
; _slim_controls4 << ("<div class=\"title\">".freeze); _slim_controls4 << ((title).to_s);
|
718
|
+
; _slim_controls4 << ("</div>".freeze); end; _slim_controls4 << ("<table>".freeze);
|
719
|
+
; if (attr? :labelwidth) || (attr? :itemwidth);
|
720
|
+
; _slim_controls4 << ("<colgroup><col".freeze);
|
721
|
+
; _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);
|
722
|
+
; _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);
|
723
|
+
; end; items.each do |terms, dd|;
|
724
|
+
; _slim_controls4 << ("<tr><td".freeze);
|
725
|
+
; _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);
|
726
|
+
; terms = [*terms];
|
727
|
+
; last_term = terms.last;
|
728
|
+
; terms.each do |dt|;
|
729
|
+
; _slim_controls4 << ((dt.text).to_s);
|
730
|
+
; if dt != last_term;
|
731
|
+
; _slim_controls4 << ("<br>".freeze);
|
732
|
+
; end; end; _slim_controls4 << ("</td><td class=\"hdlist2\">".freeze);
|
733
|
+
; unless dd.nil?;
|
734
|
+
; if dd.text?;
|
735
|
+
; _slim_controls4 << ("<p>".freeze); _slim_controls4 << ((dd.text).to_s);
|
736
|
+
; _slim_controls4 << ("</p>".freeze); end; if dd.blocks?;
|
737
|
+
; _slim_controls4 << ((dd.content).to_s);
|
738
|
+
; end; end; _slim_controls4 << ("</td></tr>".freeze); end; _slim_controls4 << ("</table>".freeze); _slim_controls4; end; _buf << ((_slim_controls3).to_s); else;
|
739
|
+
; _slim_controls5 = html_tag('div', { :id => @id, :class => ['dlist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls6 = '';
|
740
|
+
; if title?;
|
741
|
+
; _slim_controls6 << ("<div class=\"title\">".freeze); _slim_controls6 << ((title).to_s);
|
742
|
+
; _slim_controls6 << ("</div>".freeze); end; _slim_controls6 << ("<dl>".freeze);
|
743
|
+
; items.each do |terms, dd|;
|
744
|
+
; [*terms].each do |dt|;
|
745
|
+
; _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);
|
746
|
+
; _slim_controls6 << ("</dt>".freeze); end; unless dd.nil?;
|
747
|
+
; _slim_controls6 << ("<dd>".freeze);
|
748
|
+
; if dd.text?;
|
749
|
+
; _slim_controls6 << ("<p>".freeze); _slim_controls6 << ((dd.text).to_s);
|
750
|
+
; _slim_controls6 << ("</p>".freeze); end; if dd.blocks?;
|
751
|
+
; _slim_controls6 << ((dd.content).to_s);
|
752
|
+
; end; _slim_controls6 << ("</dd>".freeze); end; end; _slim_controls6 << ("</dl>".freeze); _slim_controls6; end; _buf << ((_slim_controls5).to_s); end; _buf
|
831
753
|
end
|
832
754
|
end
|
833
755
|
|
834
|
-
def
|
756
|
+
def convert_inline_quoted(node, opts = {})
|
835
757
|
node.extend(Helpers)
|
836
758
|
node.instance_eval do
|
837
759
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
838
|
-
_buf = '';
|
839
|
-
;
|
840
|
-
;
|
841
|
-
;
|
842
|
-
;
|
843
|
-
;
|
844
|
-
;
|
845
|
-
;
|
846
|
-
;
|
847
|
-
;
|
848
|
-
;
|
849
|
-
;
|
850
|
-
;
|
851
|
-
;
|
852
|
-
;
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
;
|
861
|
-
;
|
862
|
-
;
|
863
|
-
;
|
864
|
-
;
|
865
|
-
;
|
866
|
-
;
|
867
|
-
;
|
868
|
-
;
|
869
|
-
;
|
870
|
-
;
|
871
|
-
;
|
872
|
-
;
|
873
|
-
;
|
874
|
-
;
|
875
|
-
;
|
876
|
-
;
|
877
|
-
;
|
878
|
-
;
|
879
|
-
;
|
880
|
-
;
|
881
|
-
;
|
882
|
-
;
|
883
|
-
;
|
884
|
-
;
|
885
|
-
;
|
886
|
-
;
|
887
|
-
;
|
888
|
-
;
|
889
|
-
;
|
890
|
-
;
|
891
|
-
;
|
892
|
-
;
|
893
|
-
;
|
894
|
-
;
|
895
|
-
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('ready', function () {\n layoutSlideContents(".freeze);
|
896
|
-
;
|
897
|
-
;
|
898
|
-
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('resize', function () {\n layoutSlideContents(".freeze);
|
899
|
-
;
|
900
|
-
;
|
901
|
-
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});</script>".freeze);
|
902
|
-
;
|
760
|
+
_buf = ''; quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sub' };
|
761
|
+
; if (quote_tag = quote_tags[@type]);
|
762
|
+
; _buf << ((html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)).to_s);
|
763
|
+
; else;
|
764
|
+
; case @type;
|
765
|
+
; when :double;
|
766
|
+
; _buf << ((inline_text_container("“#{@text}”")).to_s);
|
767
|
+
; when :single;
|
768
|
+
; _buf << ((inline_text_container("‘#{@text}’")).to_s);
|
769
|
+
; when :asciimath, :latexmath;
|
770
|
+
; open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type];
|
771
|
+
; _buf << ((inline_text_container("#{open}#{@text}#{close}")).to_s);
|
772
|
+
; else;
|
773
|
+
; _buf << ((inline_text_container(@text)).to_s);
|
774
|
+
; end; end; _buf
|
775
|
+
end
|
776
|
+
end
|
777
|
+
|
778
|
+
def convert_thematic_break(node, opts = {})
|
779
|
+
node.extend(Helpers)
|
780
|
+
node.instance_eval do
|
781
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
782
|
+
_buf = ''; _buf << ("<hr>".freeze);
|
903
783
|
; _buf
|
904
784
|
end
|
905
785
|
end
|
906
786
|
|
907
|
-
def
|
787
|
+
def convert_stem(node, opts = {})
|
908
788
|
node.extend(Helpers)
|
909
789
|
node.instance_eval do
|
910
790
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -922,36 +802,28 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
922
802
|
end
|
923
803
|
end
|
924
804
|
|
925
|
-
def
|
926
|
-
node.extend(Helpers)
|
927
|
-
node.instance_eval do
|
928
|
-
converter.set_local_variables(binding, opts) unless opts.empty?
|
929
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
930
|
-
; if title?;
|
931
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
932
|
-
; _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);
|
933
|
-
; _slim_controls2 << ("</pre></div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
934
|
-
end
|
935
|
-
end
|
936
|
-
|
937
|
-
def embedded(node, opts = {})
|
805
|
+
def convert_inline_anchor(node, opts = {})
|
938
806
|
node.extend(Helpers)
|
939
807
|
node.instance_eval do
|
940
808
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
941
|
-
_buf = '';
|
942
|
-
;
|
943
|
-
;
|
944
|
-
;
|
945
|
-
;
|
946
|
-
;
|
947
|
-
;
|
948
|
-
;
|
949
|
-
; _buf << ((
|
950
|
-
; _buf << ("
|
809
|
+
_buf = ''; case @type;
|
810
|
+
; when :xref;
|
811
|
+
; refid = (attr :refid) || @target;
|
812
|
+
; _slim_controls1 = html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
813
|
+
; _slim_controls2 << (((@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')).to_s);
|
814
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); when :ref;
|
815
|
+
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
816
|
+
; when :bibref;
|
817
|
+
; _buf << ((html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))).to_s);
|
818
|
+
; _buf << ("[".freeze); _buf << ((@target).to_s); _buf << ("]".freeze);
|
819
|
+
; else;
|
820
|
+
; _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 = '';
|
821
|
+
; _slim_controls4 << ((@text).to_s);
|
822
|
+
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
951
823
|
end
|
952
824
|
end
|
953
825
|
|
954
|
-
def
|
826
|
+
def convert_document(node, opts = {})
|
955
827
|
node.extend(Helpers)
|
956
828
|
node.instance_eval do
|
957
829
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1297,105 +1169,110 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1297
1169
|
end
|
1298
1170
|
end
|
1299
1171
|
|
1300
|
-
def
|
1172
|
+
def convert_floating_title(node, opts = {})
|
1301
1173
|
node.extend(Helpers)
|
1302
1174
|
node.instance_eval do
|
1303
1175
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1304
|
-
_buf = ''; if (
|
1305
|
-
; _buf << (
|
1306
|
-
; _buf << ("</
|
1176
|
+
_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);
|
1177
|
+
; _buf << ((title).to_s);
|
1178
|
+
; _buf << ("</h".freeze); _buf << ((_slim_htag_filter1).to_s); _buf << (">".freeze); _buf
|
1179
|
+
end
|
1180
|
+
end
|
1181
|
+
|
1182
|
+
def convert_page_break(node, opts = {})
|
1183
|
+
node.extend(Helpers)
|
1184
|
+
node.instance_eval do
|
1185
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1186
|
+
_buf = ''; _buf << ("<div style=\"page-break-after: always;\"></div>".freeze);
|
1187
|
+
; _buf
|
1188
|
+
end
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
def convert_inline_callout(node, opts = {})
|
1192
|
+
node.extend(Helpers)
|
1193
|
+
node.instance_eval do
|
1194
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1195
|
+
_buf = ''; if @document.attr? :icons, 'font';
|
1196
|
+
; _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);
|
1197
|
+
; _buf << (("(#{@text})").to_s);
|
1198
|
+
; _buf << ("</b>".freeze); elsif @document.attr? :icons;
|
1199
|
+
; _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);
|
1307
1200
|
; else;
|
1308
|
-
;
|
1309
|
-
;
|
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
|
1201
|
+
; _buf << ("<b>".freeze); _buf << (("(#{@text})").to_s);
|
1202
|
+
; _buf << ("</b>".freeze); end; _buf
|
1314
1203
|
end
|
1315
1204
|
end
|
1316
1205
|
|
1317
|
-
def
|
1206
|
+
def convert_pass(node, opts = {})
|
1318
1207
|
node.extend(Helpers)
|
1319
1208
|
node.instance_eval do
|
1320
1209
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1321
|
-
_buf = ''; _buf << ((
|
1322
|
-
; _buf << ("<br>".freeze);
|
1210
|
+
_buf = ''; _buf << ((content).to_s);
|
1323
1211
|
; _buf
|
1324
1212
|
end
|
1325
1213
|
end
|
1326
1214
|
|
1327
|
-
def
|
1215
|
+
def convert_embedded(node, opts = {})
|
1328
1216
|
node.extend(Helpers)
|
1329
1217
|
node.instance_eval do
|
1330
1218
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1331
|
-
_buf = '';
|
1332
|
-
; _buf << ((@
|
1333
|
-
; end; _buf
|
1219
|
+
_buf = ''; unless notitle || !has_header?;
|
1220
|
+
; _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);
|
1221
|
+
; _buf << ("</h1>".freeze); end; _buf << ((content).to_s);
|
1222
|
+
; unless !footnotes? || attr?(:nofootnotes);
|
1223
|
+
; _buf << ("<div id=\"footnotes\"><hr>".freeze);
|
1224
|
+
;
|
1225
|
+
; footnotes.each do |fn|;
|
1226
|
+
; _buf << ("<div class=\"footnote\" id=\"_footnote_".freeze); _buf << ((fn.index).to_s); _buf << ("\"><a href=\"#_footnoteref_".freeze);
|
1227
|
+
; _buf << ((fn.index).to_s); _buf << ("\">".freeze); _buf << ((fn.index).to_s); _buf << ("</a>. ".freeze); _buf << ((fn.text).to_s);
|
1228
|
+
; _buf << ("</div>".freeze); end; _buf << ("</div>".freeze); end; _buf
|
1334
1229
|
end
|
1335
1230
|
end
|
1336
1231
|
|
1337
|
-
def
|
1232
|
+
def convert_listing(node, opts = {})
|
1338
1233
|
node.extend(Helpers)
|
1339
1234
|
node.instance_eval do
|
1340
1235
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1341
|
-
_buf = '';
|
1342
|
-
;
|
1343
|
-
;
|
1236
|
+
_buf = ''; nowrap = (option? 'nowrap') || !(document.attr? 'prewrap');
|
1237
|
+
; if @style == 'source';
|
1238
|
+
; syntax_hl = document.syntax_highlighter;
|
1239
|
+
; lang = attr :language;
|
1240
|
+
; if syntax_hl;
|
1241
|
+
; doc_attrs = document.attributes;
|
1242
|
+
; css_mode = (doc_attrs[%(#{syntax_hl.name}-css)] || :class).to_sym;
|
1243
|
+
; style = doc_attrs[%(#{syntax_hl.name}-style)];
|
1244
|
+
; opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {};
|
1245
|
+
; opts[:nowrap] = nowrap;
|
1246
|
+
; end;
|
1247
|
+
; 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 = '';
|
1344
1248
|
; if title?;
|
1345
|
-
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((
|
1346
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<
|
1347
|
-
;
|
1348
|
-
; _slim_controls2 << (
|
1349
|
-
;
|
1350
|
-
;
|
1351
|
-
; _slim_controls2 << ("
|
1352
|
-
; if
|
1353
|
-
; _slim_controls2 << (
|
1354
|
-
; _slim_controls2 << ("</
|
1355
|
-
; _slim_controls2 << ((
|
1356
|
-
;
|
1357
|
-
;
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
;
|
1367
|
-
;
|
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
|
1249
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1250
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze);
|
1251
|
+
; if syntax_hl;
|
1252
|
+
; _slim_controls2 << (((syntax_hl.format self, lang, opts)).to_s);
|
1253
|
+
; else;
|
1254
|
+
; if @style == 'source';
|
1255
|
+
; _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);
|
1256
|
+
; _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);
|
1257
|
+
; _slim_controls2 << ((content || '').to_s);
|
1258
|
+
; _slim_controls2 << ("</code></pre>".freeze); else;
|
1259
|
+
; _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);
|
1260
|
+
; _slim_controls2 << ((content || '').to_s);
|
1261
|
+
; _slim_controls2 << ("</pre>".freeze); end; end; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1262
|
+
end
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
def convert_inline_break(node, opts = {})
|
1266
|
+
node.extend(Helpers)
|
1267
|
+
node.instance_eval do
|
1268
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1269
|
+
_buf = ''; _buf << ((@text).to_s);
|
1270
|
+
; _buf << ("<br>".freeze);
|
1271
|
+
; _buf
|
1395
1272
|
end
|
1396
1273
|
end
|
1397
1274
|
|
1398
|
-
def
|
1275
|
+
def convert_ulist(node, opts = {})
|
1399
1276
|
node.extend(Helpers)
|
1400
1277
|
node.instance_eval do
|
1401
1278
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1428,134 +1305,222 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1428
1305
|
end
|
1429
1306
|
end
|
1430
1307
|
|
1431
|
-
def
|
1308
|
+
def convert_quote(node, opts = {})
|
1432
1309
|
node.extend(Helpers)
|
1433
1310
|
node.instance_eval do
|
1434
1311
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1435
|
-
_buf = '';
|
1436
|
-
;
|
1312
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['quoteblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1313
|
+
; if title?;
|
1314
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1315
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<blockquote>".freeze); _slim_controls2 << ((content).to_s);
|
1316
|
+
; _slim_controls2 << ("</blockquote>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
1317
|
+
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
1318
|
+
; if attribution || citetitle;
|
1319
|
+
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
1320
|
+
; if citetitle;
|
1321
|
+
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
1322
|
+
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
1323
|
+
; if citetitle;
|
1324
|
+
; _slim_controls2 << ("<br>".freeze);
|
1325
|
+
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
1326
|
+
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1437
1327
|
end
|
1438
1328
|
end
|
1439
1329
|
|
1440
|
-
def
|
1330
|
+
def convert_verse(node, opts = {})
|
1441
1331
|
node.extend(Helpers)
|
1442
1332
|
node.instance_eval do
|
1443
1333
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1444
|
-
_buf = '';
|
1445
|
-
; styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; ');
|
1446
|
-
; _slim_controls1 = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1334
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['verseblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1447
1335
|
; if title?;
|
1448
|
-
; _slim_controls2 << ("<
|
1449
|
-
; _slim_controls2 << ("</
|
1450
|
-
; _slim_controls2 << ("
|
1451
|
-
;
|
1452
|
-
;
|
1453
|
-
; _slim_controls2 << ("<
|
1454
|
-
;
|
1455
|
-
;
|
1456
|
-
; _slim_controls2 << ("
|
1457
|
-
;
|
1336
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1337
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<pre class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
1338
|
+
; _slim_controls2 << ("</pre>".freeze); attribution = (attr? :attribution) ? (attr :attribution) : nil;
|
1339
|
+
; citetitle = (attr? :citetitle) ? (attr :citetitle) : nil;
|
1340
|
+
; if attribution || citetitle;
|
1341
|
+
; _slim_controls2 << ("<div class=\"attribution\">".freeze);
|
1342
|
+
; if citetitle;
|
1343
|
+
; _slim_controls2 << ("<cite>".freeze); _slim_controls2 << ((citetitle).to_s);
|
1344
|
+
; _slim_controls2 << ("</cite>".freeze); end; if attribution;
|
1345
|
+
; if citetitle;
|
1346
|
+
; _slim_controls2 << ("<br>".freeze);
|
1347
|
+
; end; _slim_controls2 << ("— ".freeze); _slim_controls2 << ((attribution).to_s);
|
1348
|
+
; end; _slim_controls2 << ("</div>".freeze); end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1349
|
+
end
|
1350
|
+
end
|
1351
|
+
|
1352
|
+
def convert_video(node, opts = {})
|
1353
|
+
node.extend(Helpers)
|
1354
|
+
node.instance_eval do
|
1355
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1356
|
+
_buf = '';
|
1458
1357
|
;
|
1459
|
-
;
|
1460
|
-
;
|
1461
|
-
;
|
1462
|
-
; row.each do |cell|;
|
1358
|
+
; no_stretch = ((attr? :width) || (attr? :height));
|
1359
|
+
; width = (attr? :width) ? (attr :width) : "100%";
|
1360
|
+
; height = (attr? :height) ? (attr :height) : "100%";
|
1463
1361
|
;
|
1464
|
-
; if
|
1465
|
-
;
|
1466
|
-
;
|
1467
|
-
;
|
1468
|
-
; when
|
1469
|
-
;
|
1470
|
-
;
|
1471
|
-
;
|
1472
|
-
;
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
;
|
1477
|
-
;
|
1362
|
+
; _slim_controls1 = html_tag('div', { :id => @id, :class => ['videoblock', @style, role, (no_stretch ? nil : 'stretch'), ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1363
|
+
; if title?;
|
1364
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1365
|
+
; _slim_controls2 << ("</div>".freeze); end; case attr :poster;
|
1366
|
+
; when 'vimeo';
|
1367
|
+
; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?;
|
1368
|
+
; asset_uri_scheme = %(#{asset_uri_scheme}:);
|
1369
|
+
; end; start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil;
|
1370
|
+
; delimiter = ['?'];
|
1371
|
+
; loop_param = (option? 'loop') ? %(#{delimiter.pop || '&'}loop=1) : '';
|
1372
|
+
; muted_param = (option? 'muted') ? %(#{delimiter.pop || '&'}muted=1) : '';
|
1373
|
+
; src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{loop_param}#{muted_param}#{start_anchor});
|
1374
|
+
;
|
1375
|
+
;
|
1376
|
+
;
|
1377
|
+
;
|
1378
|
+
;
|
1379
|
+
; _slim_controls2 << ("<iframe".freeze); _slim_codeattributes1 = (width); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes1).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes2 = (height); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes2).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes3 = src; 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 = 0; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" frameborder".freeze); else; _slim_controls2 << (" frameborder=\"".freeze); _slim_controls2 << ((_slim_codeattributes4).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (" webkitAllowFullScreen mozallowfullscreen allowFullScreen".freeze); _slim_codeattributes5 = (option? 'autoplay'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes5).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes6 = ((option? 'autoplay') ? "autoplay" : nil); if _slim_codeattributes6; if _slim_codeattributes6 == true; _slim_controls2 << (" allow".freeze); else; _slim_controls2 << (" allow=\"".freeze); _slim_controls2 << ((_slim_codeattributes6).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></iframe>".freeze);
|
1380
|
+
; when 'youtube';
|
1381
|
+
; unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?;
|
1382
|
+
; asset_uri_scheme = %(#{asset_uri_scheme}:);
|
1383
|
+
; end; params = ['rel=0'];
|
1384
|
+
; params << "start=#{attr :start}" if attr? :start;
|
1385
|
+
; params << "end=#{attr :end}" if attr? :end;
|
1386
|
+
; params << "loop=1" if option? 'loop';
|
1387
|
+
; params << "mute=1" if option? 'muted';
|
1388
|
+
; params << "controls=0" if option? 'nocontrols';
|
1389
|
+
; src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&'});
|
1390
|
+
;
|
1391
|
+
;
|
1392
|
+
;
|
1393
|
+
;
|
1394
|
+
;
|
1395
|
+
; _slim_controls2 << ("<iframe".freeze); _slim_codeattributes7 = (width); if _slim_codeattributes7; if _slim_codeattributes7 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes7).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes8 = (height); if _slim_codeattributes8; if _slim_codeattributes8 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes8).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes9 = src; if _slim_codeattributes9; if _slim_codeattributes9 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes9).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes10 = 0; if _slim_codeattributes10; if _slim_codeattributes10 == true; _slim_controls2 << (" frameborder".freeze); else; _slim_controls2 << (" frameborder=\"".freeze); _slim_controls2 << ((_slim_codeattributes10).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes11 = !(option? 'nofullscreen'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _slim_controls2 << (" allowfullscreen".freeze); else; _slim_controls2 << (" allowfullscreen=\"".freeze); _slim_controls2 << ((_slim_codeattributes11).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes12 = (option? 'autoplay'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes12).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes13 = ((option? 'autoplay') ? "autoplay" : nil); if _slim_codeattributes13; if _slim_codeattributes13 == true; _slim_controls2 << (" allow".freeze); else; _slim_controls2 << (" allow=\"".freeze); _slim_controls2 << ((_slim_codeattributes13).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << ("></iframe>".freeze);
|
1478
1396
|
; else;
|
1479
|
-
;
|
1480
|
-
;
|
1481
|
-
;
|
1482
|
-
;
|
1483
|
-
;
|
1484
|
-
;
|
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
|
1397
|
+
;
|
1398
|
+
;
|
1399
|
+
;
|
1400
|
+
; _slim_controls2 << ("<video".freeze); _slim_codeattributes14 = media_uri(attr :target); if _slim_codeattributes14; if _slim_codeattributes14 == true; _slim_controls2 << (" src".freeze); else; _slim_controls2 << (" src=\"".freeze); _slim_controls2 << ((_slim_codeattributes14).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes15 = (width); if _slim_codeattributes15; if _slim_codeattributes15 == true; _slim_controls2 << (" width".freeze); else; _slim_controls2 << (" width=\"".freeze); _slim_controls2 << ((_slim_codeattributes15).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes16 = (height); if _slim_codeattributes16; if _slim_codeattributes16 == true; _slim_controls2 << (" height".freeze); else; _slim_controls2 << (" height=\"".freeze); _slim_controls2 << ((_slim_codeattributes16).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes17 = ((attr :poster) ? media_uri(attr :poster) : nil); if _slim_codeattributes17; if _slim_codeattributes17 == true; _slim_controls2 << (" poster".freeze); else; _slim_controls2 << (" poster=\"".freeze); _slim_controls2 << ((_slim_codeattributes17).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes18 = (option? 'autoplay'); if _slim_codeattributes18; if _slim_codeattributes18 == true; _slim_controls2 << (" data-autoplay".freeze); else; _slim_controls2 << (" data-autoplay=\"".freeze); _slim_controls2 << ((_slim_codeattributes18).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes19 = !(option? 'nocontrols'); if _slim_codeattributes19; if _slim_codeattributes19 == true; _slim_controls2 << (" controls".freeze); else; _slim_controls2 << (" controls=\"".freeze); _slim_controls2 << ((_slim_codeattributes19).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_codeattributes20 = (option? 'loop'); if _slim_codeattributes20; if _slim_codeattributes20 == true; _slim_controls2 << (" loop".freeze); else; _slim_controls2 << (" loop=\"".freeze); _slim_controls2 << ((_slim_codeattributes20).to_s); _slim_controls2 << ("\"".freeze); end; end; _slim_controls2 << (">Your browser does not support the video tag.</video>".freeze);
|
1401
|
+
;
|
1402
|
+
; end; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1491
1403
|
end
|
1492
1404
|
end
|
1493
1405
|
|
1494
|
-
def
|
1406
|
+
def convert_outline(node, opts = {})
|
1495
1407
|
node.extend(Helpers)
|
1496
1408
|
node.instance_eval do
|
1497
1409
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1498
|
-
_buf = '';
|
1410
|
+
_buf = ''; unless sections.empty?;
|
1411
|
+
; toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i;
|
1412
|
+
; slevel = section_level sections.first;
|
1413
|
+
; _buf << ("<ol class=\"sectlevel".freeze); _buf << ((slevel).to_s); _buf << ("\">".freeze);
|
1414
|
+
; sections.each do |sec|;
|
1415
|
+
; _buf << ("<li><a href=\"#".freeze);
|
1416
|
+
; _buf << ((sec.id).to_s); _buf << ("\">".freeze); _buf << ((section_title sec).to_s);
|
1417
|
+
; _buf << ("</a>".freeze); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline');
|
1418
|
+
; _buf << ((child_toc).to_s);
|
1419
|
+
; end; _buf << ("</li>".freeze); end; _buf << ("</ol>".freeze); end; _buf
|
1420
|
+
end
|
1421
|
+
end
|
1422
|
+
|
1423
|
+
def convert_inline_indexterm(node, opts = {})
|
1424
|
+
node.extend(Helpers)
|
1425
|
+
node.instance_eval do
|
1426
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1427
|
+
_buf = ''; if @type == :visible;
|
1428
|
+
; _buf << ((@text).to_s);
|
1429
|
+
; end; _buf
|
1430
|
+
end
|
1431
|
+
end
|
1432
|
+
|
1433
|
+
def convert_title_slide(node, opts = {})
|
1434
|
+
node.extend(Helpers)
|
1435
|
+
node.instance_eval do
|
1436
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1437
|
+
_buf = ''; bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil;
|
1438
|
+
; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil;
|
1499
1439
|
;
|
1500
|
-
;
|
1440
|
+
;
|
1441
|
+
;
|
1442
|
+
;
|
1443
|
+
;
|
1444
|
+
;
|
1445
|
+
;
|
1446
|
+
;
|
1447
|
+
;
|
1448
|
+
;
|
1449
|
+
;
|
1450
|
+
;
|
1451
|
+
;
|
1452
|
+
;
|
1453
|
+
;
|
1454
|
+
; _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);
|
1455
|
+
; if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?;
|
1456
|
+
; _buf << ("<h1>".freeze); _buf << ((slice_text _title_obj.title, (_slice = header.option? :slice)).to_s);
|
1457
|
+
; _buf << ("</h1><h2>".freeze); _buf << ((slice_text _title_obj.subtitle, _slice).to_s);
|
1458
|
+
; _buf << ("</h2>".freeze); else;
|
1459
|
+
; _buf << ("<h1>".freeze); _buf << ((@header.title).to_s);
|
1460
|
+
; _buf << ("</h1>".freeze); end; preamble = @document.find_by context: :preamble;
|
1461
|
+
; unless preamble.nil? or preamble.length == 0;
|
1462
|
+
; _buf << ("<div class=\"preamble\">".freeze); _buf << ((preamble.pop.content).to_s);
|
1463
|
+
; _buf << ("</div>".freeze); end; _buf << ((generate_authors(@document)).to_s);
|
1464
|
+
; _buf << ("</section>".freeze); _buf
|
1501
1465
|
end
|
1502
1466
|
end
|
1503
1467
|
|
1504
|
-
def
|
1468
|
+
def convert_admonition(node, opts = {})
|
1505
1469
|
node.extend(Helpers)
|
1506
1470
|
node.instance_eval do
|
1507
1471
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1508
|
-
_buf = '';
|
1509
|
-
;
|
1510
|
-
;
|
1511
|
-
; lang = attr :language;
|
1512
|
-
; if syntax_hl;
|
1513
|
-
; doc_attrs = document.attributes;
|
1514
|
-
; css_mode = (doc_attrs[%(#{syntax_hl.name}-css)] || :class).to_sym;
|
1515
|
-
; style = doc_attrs[%(#{syntax_hl.name}-style)];
|
1516
|
-
; opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {};
|
1517
|
-
; opts[:nowrap] = nowrap;
|
1518
|
-
; end;
|
1519
|
-
; 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 = '';
|
1520
|
-
; if title?;
|
1521
|
-
; _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
|
-
; if syntax_hl;
|
1524
|
-
; _slim_controls2 << (((syntax_hl.format self, lang, opts)).to_s);
|
1472
|
+
_buf = ''; if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes');
|
1473
|
+
; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
1474
|
+
; _buf << ("</aside>".freeze);
|
1525
1475
|
; else;
|
1526
|
-
; if @
|
1527
|
-
; _slim_controls2 << ("<
|
1528
|
-
;
|
1529
|
-
;
|
1530
|
-
;
|
1531
|
-
; _slim_controls2 << ("<
|
1532
|
-
;
|
1533
|
-
; _slim_controls2 << ("
|
1476
|
+
; _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 = '';
|
1477
|
+
; _slim_controls2 << ("<table><tr><td class=\"icon\">".freeze);
|
1478
|
+
;
|
1479
|
+
; if @document.attr? :icons, 'font';
|
1480
|
+
; icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning'];
|
1481
|
+
; _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);
|
1482
|
+
; elsif @document.attr? :icons;
|
1483
|
+
; _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);
|
1484
|
+
; else;
|
1485
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << (((attr :textlabel) || @caption).to_s);
|
1486
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("</td><td class=\"content\">".freeze);
|
1487
|
+
; if title?;
|
1488
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1489
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ((content).to_s);
|
1490
|
+
; _slim_controls2 << ("</td></tr></table>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); end; _buf
|
1534
1491
|
end
|
1535
1492
|
end
|
1536
1493
|
|
1537
|
-
def
|
1494
|
+
def convert_inline_kbd(node, opts = {})
|
1538
1495
|
node.extend(Helpers)
|
1539
1496
|
node.instance_eval do
|
1540
1497
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1541
|
-
_buf = '';
|
1542
|
-
;
|
1543
|
-
;
|
1544
|
-
;
|
1545
|
-
;
|
1546
|
-
;
|
1547
|
-
;
|
1548
|
-
;
|
1549
|
-
;
|
1550
|
-
;
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1498
|
+
_buf = ''; if (keys = attr 'keys').size == 1;
|
1499
|
+
; _slim_controls1 = html_tag('kbd', data_attrs(@attributes)) do; _slim_controls2 = '';
|
1500
|
+
; _slim_controls2 << ((keys.first).to_s);
|
1501
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
1502
|
+
; _slim_controls3 = html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes))) do; _slim_controls4 = '';
|
1503
|
+
; keys.each_with_index do |key, idx|;
|
1504
|
+
; unless idx.zero?;
|
1505
|
+
; _slim_controls4 << ("+".freeze);
|
1506
|
+
; end; _slim_controls4 << ("<kbd>".freeze); _slim_controls4 << ((key).to_s);
|
1507
|
+
; _slim_controls4 << ("</kbd>".freeze); end; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1508
|
+
end
|
1509
|
+
end
|
1510
|
+
|
1511
|
+
def convert_literal(node, opts = {})
|
1512
|
+
node.extend(Helpers)
|
1513
|
+
node.instance_eval do
|
1514
|
+
converter.set_local_variables(binding, opts) unless opts.empty?
|
1515
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1516
|
+
; if title?;
|
1517
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1518
|
+
; _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);
|
1519
|
+
; _slim_controls2 << ("</pre></div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1555
1520
|
end
|
1556
1521
|
end
|
1557
1522
|
|
1558
|
-
def
|
1523
|
+
def convert_section(node, opts = {})
|
1559
1524
|
node.extend(Helpers)
|
1560
1525
|
node.instance_eval do
|
1561
1526
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
@@ -1630,7 +1595,8 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1630
1595
|
;
|
1631
1596
|
;
|
1632
1597
|
;
|
1633
|
-
;
|
1598
|
+
;
|
1599
|
+
; _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
1600
|
; unless hide_title;
|
1635
1601
|
; _buf << ("<h2>".freeze); _buf << ((section_title).to_s);
|
1636
1602
|
; _buf << ("</h2>".freeze); end; if parent_section_with_vertical_slides;
|
@@ -1668,74 +1634,65 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1668
1634
|
end
|
1669
1635
|
end
|
1670
1636
|
|
1671
|
-
def
|
1637
|
+
def convert_table(node, opts = {})
|
1672
1638
|
node.extend(Helpers)
|
1673
1639
|
node.instance_eval do
|
1674
1640
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1675
|
-
_buf = ''; if
|
1676
|
-
;
|
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 = '';
|
1641
|
+
_buf = ''; classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))];
|
1642
|
+
; styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; ');
|
1643
|
+
; _slim_controls1 = html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1680
1644
|
; if title?;
|
1681
|
-
; _slim_controls2 << ("<
|
1682
|
-
; _slim_controls2 << ("</
|
1683
|
-
; _slim_controls2 << ("
|
1684
|
-
;
|
1645
|
+
; _slim_controls2 << ("<caption class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1646
|
+
; _slim_controls2 << ("</caption>".freeze); end; unless (attr :rowcount).zero?;
|
1647
|
+
; _slim_controls2 << ("<colgroup>".freeze);
|
1648
|
+
; if option? 'autowidth';
|
1649
|
+
; @columns.each do;
|
1650
|
+
; _slim_controls2 << ("<col>".freeze);
|
1651
|
+
; end; else;
|
1652
|
+
; @columns.each do |col|;
|
1653
|
+
; _slim_controls2 << ("<col style=\"width:".freeze); _slim_controls2 << ((col.attr :colpcwidth).to_s); _slim_controls2 << ("%\">".freeze);
|
1654
|
+
; end; end; _slim_controls2 << ("</colgroup>".freeze); [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|;
|
1655
|
+
;
|
1656
|
+
; _slim_controls2 << ("<t".freeze); _slim_controls2 << ((tblsec).to_s); _slim_controls2 << (">".freeze);
|
1657
|
+
; @rows[tblsec].each do |row|;
|
1658
|
+
; _slim_controls2 << ("<tr>".freeze);
|
1659
|
+
; row.each do |cell|;
|
1660
|
+
;
|
1661
|
+
; if tblsec == :head;
|
1662
|
+
; cell_content = cell.text;
|
1685
1663
|
; else;
|
1686
|
-
;
|
1687
|
-
;
|
1688
|
-
;
|
1664
|
+
; case cell.style;
|
1665
|
+
; when :literal;
|
1666
|
+
; cell_content = cell.text;
|
1689
1667
|
; else;
|
1690
|
-
;
|
1691
|
-
;
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
;
|
1704
|
-
;
|
1705
|
-
;
|
1706
|
-
;
|
1707
|
-
;
|
1708
|
-
;
|
1709
|
-
; _slim_controls2 << ("</
|
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
|
1668
|
+
; cell_content = cell.content;
|
1669
|
+
; end; end; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
|
1670
|
+
:class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
|
1671
|
+
:colspan=>cell.colspan, :rowspan=>cell.rowspan,
|
1672
|
+
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) do; _slim_controls4 = '';
|
1673
|
+
; if tblsec == :head;
|
1674
|
+
; _slim_controls4 << ((cell_content).to_s);
|
1675
|
+
; else;
|
1676
|
+
; case cell.style;
|
1677
|
+
; when :asciidoc;
|
1678
|
+
; _slim_controls4 << ("<div>".freeze); _slim_controls4 << ((cell_content).to_s);
|
1679
|
+
; _slim_controls4 << ("</div>".freeze); when :literal;
|
1680
|
+
; _slim_controls4 << ("<div class=\"literal\"><pre>".freeze); _slim_controls4 << ((cell_content).to_s);
|
1681
|
+
; _slim_controls4 << ("</pre></div>".freeze); when :header;
|
1682
|
+
; cell_content.each do |text|;
|
1683
|
+
; _slim_controls4 << ("<p class=\"tableblock header\">".freeze); _slim_controls4 << ((text).to_s);
|
1684
|
+
; _slim_controls4 << ("</p>".freeze); end; else;
|
1685
|
+
; cell_content.each do |text|;
|
1686
|
+
; _slim_controls4 << ("<p class=\"tableblock\">".freeze); _slim_controls4 << ((text).to_s);
|
1687
|
+
; _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
|
1730
1688
|
end
|
1731
1689
|
end
|
1732
1690
|
|
1733
|
-
def
|
1691
|
+
def convert_stretch_nested_elements(node, opts = {})
|
1734
1692
|
node.extend(Helpers)
|
1735
1693
|
node.instance_eval do
|
1736
1694
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1737
|
-
_buf = '';
|
1738
|
-
; bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil;
|
1695
|
+
_buf = ''; _buf << ("<script>var dom = {};\ndom.slides = document.querySelector('.reveal .slides');\n\nfunction getRemainingHeight(element, slideElement, height) {\n height = height || 0;\n if (element) {\n var newHeight, oldHeight = element.style.height;\n // Change the .stretch element height to 0 in order find the height of all\n // the other elements\n element.style.height = '0px';\n // In Overview mode, the parent (.slide) height is set of 700px.\n // Restore it temporarily to its natural height.\n slideElement.style.height = 'auto';\n newHeight = height - slideElement.offsetHeight;\n // Restore the old height, just in case\n element.style.height = oldHeight + 'px';\n // Clear the parent (.slide) height. .removeProperty works in IE9+\n slideElement.style.removeProperty('height');\n return newHeight;\n }\n return height;\n}\n\nfunction layoutSlideContents(width, height) {\n // Handle sizing of elements with the 'stretch' class\n toArray(dom.slides.querySelectorAll('section .stretch')).forEach(function (element) {\n // Determine how much vertical space we can use\n var limit = 5; // hard limit\n var parent = element.parentNode;\n while (parent.nodeName !== 'SECTION' && limit > 0) {\n parent = parent.parentNode;\n limit--;\n }\n if (limit === 0) {\n // unable to find parent, aborting!\n return;\n }\n var remainingHeight = getRemainingHeight(element, parent, height);\n // Consider the aspect ratio of media elements\n if (/(img|video)/gi.test(element.nodeName)) {\n var nw = element.naturalWidth || element.videoWidth, nh = element.naturalHeight || element.videoHeight;\n var es = Math.min(width / nw, remainingHeight / nh);\n element.style.width = (nw * es) + 'px';\n element.style.height = (nh * es) + 'px';\n } else {\n element.style.width = width + 'px';\n element.style.height = remainingHeight + 'px';\n }\n });\n}\n\nfunction toArray(o) {\n return Array.prototype.slice.call(o);\n}\n\nReveal.addEventListener('slidechanged', function () {\n layoutSlideContents(".freeze);
|
1739
1696
|
;
|
1740
1697
|
;
|
1741
1698
|
;
|
@@ -1751,101 +1708,141 @@ class Asciidoctor::Revealjs::Converter < ::Asciidoctor::Converter::Base
|
|
1751
1708
|
;
|
1752
1709
|
;
|
1753
1710
|
;
|
1754
|
-
;
|
1755
|
-
;
|
1756
|
-
;
|
1757
|
-
;
|
1758
|
-
;
|
1759
|
-
;
|
1760
|
-
;
|
1761
|
-
;
|
1762
|
-
;
|
1763
|
-
;
|
1764
|
-
;
|
1711
|
+
;
|
1712
|
+
;
|
1713
|
+
;
|
1714
|
+
;
|
1715
|
+
;
|
1716
|
+
;
|
1717
|
+
;
|
1718
|
+
;
|
1719
|
+
;
|
1720
|
+
;
|
1721
|
+
;
|
1722
|
+
;
|
1723
|
+
;
|
1724
|
+
;
|
1725
|
+
;
|
1726
|
+
;
|
1727
|
+
;
|
1728
|
+
;
|
1729
|
+
;
|
1730
|
+
;
|
1731
|
+
;
|
1732
|
+
;
|
1733
|
+
;
|
1734
|
+
;
|
1735
|
+
;
|
1736
|
+
;
|
1737
|
+
;
|
1738
|
+
;
|
1739
|
+
;
|
1740
|
+
;
|
1741
|
+
;
|
1742
|
+
;
|
1743
|
+
;
|
1744
|
+
;
|
1745
|
+
;
|
1746
|
+
;
|
1747
|
+
;
|
1748
|
+
;
|
1749
|
+
;
|
1750
|
+
;
|
1751
|
+
;
|
1752
|
+
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('ready', function () {\n layoutSlideContents(".freeze);
|
1753
|
+
;
|
1754
|
+
;
|
1755
|
+
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});\nReveal.addEventListener('resize', function () {\n layoutSlideContents(".freeze);
|
1756
|
+
;
|
1757
|
+
;
|
1758
|
+
; _buf << ((attr 'revealjs_width', 960).to_s); _buf << (", ".freeze); _buf << ((attr 'revealjs_height', 700).to_s); _buf << (")\n});</script>".freeze);
|
1759
|
+
;
|
1760
|
+
; _buf
|
1765
1761
|
end
|
1766
1762
|
end
|
1767
1763
|
|
1768
|
-
def
|
1764
|
+
def convert_olist(node, opts = {})
|
1769
1765
|
node.extend(Helpers)
|
1770
1766
|
node.instance_eval do
|
1771
1767
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1772
|
-
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['
|
1768
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1773
1769
|
; if title?;
|
1774
1770
|
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((title).to_s);
|
1775
|
-
; _slim_controls2 << ("</div>".freeze); end;
|
1776
|
-
;
|
1777
|
-
; _slim_controls2 << ("
|
1778
|
-
; _slim_controls2 << (
|
1779
|
-
; _slim_controls2 << ("</p>".freeze);
|
1771
|
+
; _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);
|
1772
|
+
; items.each do |item|;
|
1773
|
+
; _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);
|
1774
|
+
; _slim_controls2 << ((item.text).to_s);
|
1775
|
+
; _slim_controls2 << ("</p>".freeze); if item.blocks?;
|
1776
|
+
; _slim_controls2 << ((item.content).to_s);
|
1777
|
+
; end; _slim_controls2 << ("</li>".freeze); end; _slim_controls2 << ("</ol>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1780
1778
|
end
|
1781
1779
|
end
|
1782
1780
|
|
1783
|
-
def
|
1781
|
+
def convert_audio(node, opts = {})
|
1784
1782
|
node.extend(Helpers)
|
1785
1783
|
node.instance_eval do
|
1786
1784
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1787
|
-
_buf = '';
|
1788
|
-
;
|
1789
|
-
;
|
1785
|
+
_buf = ''; _slim_controls1 = html_tag('div', { :id => @id, :class => ['audioblock', @style, role] }.merge(data_attrs(@attributes))) do; _slim_controls2 = '';
|
1786
|
+
; if title?;
|
1787
|
+
; _slim_controls2 << ("<div class=\"title\">".freeze); _slim_controls2 << ((captioned_title).to_s);
|
1788
|
+
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\"><audio".freeze);
|
1789
|
+
; _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);
|
1790
|
+
;
|
1791
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1790
1792
|
end
|
1791
1793
|
end
|
1792
1794
|
|
1793
|
-
def
|
1795
|
+
def convert_image(node, opts = {})
|
1794
1796
|
node.extend(Helpers)
|
1795
1797
|
node.instance_eval do
|
1796
1798
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1797
|
-
_buf = '';
|
1798
|
-
;
|
1799
|
-
;
|
1800
|
-
;
|
1801
|
-
;
|
1802
|
-
;
|
1803
|
-
; _buf << ("
|
1804
|
-
; _buf << ("</b>".freeze); end; _buf
|
1799
|
+
_buf = ''; unless attributes[1] == 'background' || attributes[1] == 'canvas';
|
1800
|
+
; inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ');
|
1801
|
+
; _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 = '';
|
1802
|
+
; _slim_controls2 << ((convert_image).to_s);
|
1803
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); if title?;
|
1804
|
+
; _buf << ("<div class=\"title\">".freeze); _buf << ((captioned_title).to_s);
|
1805
|
+
; _buf << ("</div>".freeze); end; end; _buf
|
1805
1806
|
end
|
1806
1807
|
end
|
1807
1808
|
|
1808
|
-
def
|
1809
|
+
def convert_inline_footnote(node, opts = {})
|
1809
1810
|
node.extend(Helpers)
|
1810
1811
|
node.instance_eval do
|
1811
1812
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1812
|
-
_buf = '';
|
1813
|
-
;
|
1814
|
-
;
|
1813
|
+
_buf = ''; footnote = slide_footnote(self);
|
1814
|
+
; index = footnote.attr(:index);
|
1815
|
+
; id = footnote.id;
|
1816
|
+
; if @type == :xref;
|
1817
|
+
; _slim_controls1 = html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls2 = '';
|
1818
|
+
; _slim_controls2 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
1819
|
+
; _slim_controls2 << ((index).to_s);
|
1820
|
+
; _slim_controls2 << ("</span>]".freeze);
|
1821
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); else;
|
1822
|
+
; _slim_controls3 = html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes))) do; _slim_controls4 = '';
|
1823
|
+
; _slim_controls4 << ("[<span class=\"footnote\" title=\"View footnote.\">".freeze);
|
1824
|
+
; _slim_controls4 << ((index).to_s);
|
1825
|
+
; _slim_controls4 << ("</span>]".freeze);
|
1826
|
+
; _slim_controls4; end; _buf << ((_slim_controls3).to_s); end; _buf
|
1815
1827
|
end
|
1816
1828
|
end
|
1817
1829
|
|
1818
|
-
def
|
1830
|
+
def convert_notes(node, opts = {})
|
1819
1831
|
node.extend(Helpers)
|
1820
1832
|
node.instance_eval do
|
1821
1833
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1822
|
-
_buf = '';
|
1823
|
-
;
|
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
|
1834
|
+
_buf = ''; _buf << ("<aside class=\"notes\">".freeze); _buf << ((resolve_content).to_s);
|
1835
|
+
; _buf << ("</aside>".freeze); _buf
|
1837
1836
|
end
|
1838
1837
|
end
|
1839
1838
|
|
1840
|
-
def
|
1839
|
+
def convert_inline_image(node, opts = {})
|
1841
1840
|
node.extend(Helpers)
|
1842
1841
|
node.instance_eval do
|
1843
1842
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
1844
|
-
_buf = ''; _slim_controls1 = html_tag('
|
1845
|
-
;
|
1846
|
-
; _slim_controls2
|
1847
|
-
; _slim_controls2 << ("</div>".freeze); end; _slim_controls2 << ("<div class=\"content\">".freeze); _slim_controls2 << ((content).to_s);
|
1848
|
-
; _slim_controls2 << ("</div>".freeze); _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1843
|
+
_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 = '';
|
1844
|
+
; _slim_controls2 << ((convert_inline_image).to_s);
|
1845
|
+
; _slim_controls2; end; _buf << ((_slim_controls1).to_s); _buf
|
1849
1846
|
end
|
1850
1847
|
end
|
1851
1848
|
#------------------ End of generated transformation methods ------------------#
|