templates/document.html.slim in asciidoctor-revealjs-2.0.1 vs templates/document.html.slim in asciidoctor-revealjs-3.0.0.pre.rc1

- old
+ new

@@ -10,10 +10,11 @@ - asset_uri_scheme = %(#{asset_uri_scheme}:) - cdn_base = %(#{asset_uri_scheme}//cdnjs.cloudflare.com/ajax/libs) - [:description, :keywords, :author, :copyright].each do |key| - if attr? key meta name=key content=(attr key) + - linkcss = (attr? 'linkcss') title=(doctitle sanitize: true, use_fallback: true) meta content="yes" name="apple-mobile-web-app-capable" meta content="black-translucent" name="apple-mobile-web-app-status-bar-style" meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" name="viewport" link href="#{revealjsdir}/css/reveal.css" rel="stylesheet" @@ -22,12 +23,13 @@ link rel='stylesheet' href=(attr :revealjs_customtheme) id='theme' - else link rel='stylesheet' href='#{revealjsdir}/css/theme/#{attr 'revealjs_theme', 'black'}.css' id='theme' include asciidoctor_revealjs.css.slim - if attr? :icons, 'font' + / iconfont-remote is implicitly set by Asciidoctor core. See https://github.com/asciidoctor/asciidoctor.org/issues/361 - if attr? 'iconfont-remote' - link rel='stylesheet' href=(attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/4.3.0/css/font-awesome.min.css)) + link rel='stylesheet' href=(attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/5.8.2/css/all.min.css)) - else link rel='stylesheet' href=(normalize_web_path %(#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', ''), false) - if attr? :stem - eqnums_val = (attr 'eqnums', 'none') - eqnums_val = 'AMS' if eqnums_val == '' @@ -44,28 +46,14 @@ ignoreClass: "nostem|noasciimath" }, TeX: {#{eqnums_opt}} }); script src='#{cdn_base}/mathjax/2.4.0/MathJax.js?config=TeX-MML-AM_HTMLorMML' - - case document.attr 'source-highlighter' - - when 'coderay' - - if (attr 'coderay-css', 'class') == 'class' - - if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) - link rel='stylesheet' href=normalize_web_path('asciidoctor-coderay.css', (attr :stylesdir, '')) - - else - style=Asciidoctor::Stylesheets.instance.coderay_stylesheet_data - - when 'pygments' - - if (attr 'pygments-css', 'class') == 'class' - - if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) - link rel='stylesheet' href=normalize_web_path('asciidoctor-pygments.css', (attr :stylesdir, '')) - - else - style=Asciidoctor::Stylesheets.instance.pygments_stylesheet_data(attr 'pygments-style') - / For syntax highlighting - - if attr? 'highlightjs-theme' - link href=(attr 'highlightjs-theme') rel="stylesheet" - - else - link href="#{revealjsdir}/lib/css/zenburn.css" rel="stylesheet" + + - syntax_hl = self.syntax_highlighter + - if syntax_hl && (syntax_hl.docinfo? :head) + =syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/' / If the query includes 'print-pdf', use the PDF print sheet javascript: var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; @@ -92,10 +80,11 @@ data-background-size=(attr 'title-slide-background-size') data-background-image=bg_image data-background-video=bg_video data-background-video-loop=(attr 'title-slide-background-video-loop') data-background-video-muted=(attr 'title-slide-background-video-muted') + data-background-opacity=(attr "background-opacity") data-background-iframe=(attr 'title-slide-background-iframe') data-background-color=(attr 'title-slide-background-color') data-background-repeat=(attr 'title-slide-background-repeat') data-background-position=(attr 'title-slide-background-position') data-background-transition=(attr 'title-slide-background-transition')) @@ -227,10 +216,16 @@ // Bounds for smallest/largest possible scale to apply to content minScale: #{attr 'revealjs_minscale', 0.2}, maxScale: #{attr 'revealjs_maxscale', 1.5}, + // PDF Export Options + // Put each fragment on a separate page + pdfSeparateFragments: #{to_boolean(attr 'revealjs_pdfseparatefragments', true)}, + // For slides that do not fit on a page, max number of pages + pdfMaxPagesPerSlide: #{attr 'revealjs_pdfmaxpagesperslide', 1}, + // Optional libraries used to extend on reveal.js dependencies: [ { src: '#{revealjsdir}/lib/js/classList.js', condition: function() { return !document.body.classList; } }, #{(document.attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : nil} #{(attr? 'revealjs_plugin_zoom', 'disabled') ? "" : "{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true }," } @@ -242,7 +237,10 @@ ], #{(attr? 'revealjs_plugins_configuration') ? File.read(attr('revealjs_plugins_configuration', '')) : ""} }); + - if syntax_hl && (syntax_hl.docinfo? :footer) + =syntax_hl.docinfo :footer, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/' + - unless (docinfo_content = (docinfo :footer, '.html')).empty? =docinfo_content