templates/document.html.slim in asciidoctor-revealjs-4.1.0 vs templates/document.html.slim in asciidoctor-revealjs-5.0.0.rc1

- old
+ new

@@ -1,5 +1,16 @@ +- slides_content = self.content +- content_for :slides + - unless noheader + - unless (header_docinfo = docinfo :header, '-revealjs.html').empty? + = header_docinfo + - if header? + include title_slide.html.slim + = slides_content + - unless (footer_docinfo = docinfo :footer, '-revealjs.html').empty? + = footer_docinfo + doctype 5 html lang=(attr :lang, 'en' unless attr? :nolang) head meta charset="utf-8" meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" @@ -14,16 +25,25 @@ - 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) + - if attr? 'favicon' + - if (icon_href = attr 'favicon').empty? + - icon_href = 'favicon.ico' + - icon_type = 'image/x-icon' + - elsif (icon_ext = File.extname icon_href) + - icon_type = icon_ext == '.ico' ? 'image/x-icon' : %(image/#{icon_ext.slice 1, icon_ext.length}) + - else + - icon_type = 'image/x-icon' + link rel="icon" type="#{icon_type}" href="#{icon_href}" - linkcss = (attr? 'linkcss') - link rel="stylesheet" href="#{revealjsdir}/css/reset.css" - link rel="stylesheet" href="#{revealjsdir}/css/reveal.css" + link rel="stylesheet" href="#{revealjsdir}/dist/reset.css" + link rel="stylesheet" href="#{revealjsdir}/dist/reveal.css" / Default theme required even when using custom theme - link rel='stylesheet' href=(attr :revealjs_customtheme, %(#{revealjsdir}/css/theme/#{attr 'revealjs_theme', 'black'}.css)) id='theme' + link rel='stylesheet' href=(attr :revealjs_customtheme, %(#{revealjsdir}/dist/theme/#{attr 'revealjs_theme', 'black'}.css)) id='theme' /! This CSS is generated by the Asciidoctor reveal.js converter to further integrate AsciiDoc's existing semantic with reveal.js style type="text/css" include asciidoctor-compatibility.css - if attr? :icons, 'font' / iconfont-remote is implicitly set by Asciidoctor core. See https://github.com/asciidoctor/asciidoctor.org/issues/361 @@ -35,59 +55,24 @@ - font_awesome_version = (attr 'font-awesome-version', '5.15.1') link rel='stylesheet' href=%(#{cdn_base}/font-awesome/#{font_awesome_version}/css/all.min.css) link rel='stylesheet' href=%(#{cdn_base}/font-awesome/#{font_awesome_version}/css/v4-shims.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 == '' - - eqnums_opt = %( equationNumbers: { autoNumber: "#{eqnums_val}" } ) - - mathjaxdir = (attr 'mathjaxdir', "#{cdn_base}/mathjax/2.7.6") - script type='text/x-mathjax-config' - | MathJax.Hub.Config({ - tex2jax: { - inlineMath: [#{Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath].to_s}], - displayMath: [#{Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath].to_s}], - ignoreClass: "nostem|nolatexmath" - }, - asciimath2jax: { - delimiters: [#{Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath].to_s}], - ignoreClass: "nostem|noasciimath" - }, - TeX: {#{eqnums_opt}} - }); - script src='#{mathjaxdir}/MathJax.js?config=TeX-MML-AM_HTMLorMML' - + = generate_stem(cdn_base) - 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: '/' - - /! Printing and PDF exports - javascript: - var link = document.createElement( 'link' ); - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.href = window.location.search.match( /print-pdf/gi ) ? "#{revealjsdir}/css/print/pdf.css" : "#{revealjsdir}/css/print/paper.css"; - document.getElementsByTagName( 'head' )[0].appendChild( link ); - - if attr? :customcss link rel='stylesheet' href=((customcss = attr :customcss).empty? ? 'asciidoctor-revealjs.css' : customcss) - unless (_docinfo = docinfo :head, '-revealjs.html').empty? =_docinfo body .reveal / Any section element inside of this container is displayed as a slide .slides - - unless noheader - - unless (_docinfo = docinfo :header, '-revealjs.html').empty? - = _docinfo - - if header? - include title_slide.html.slim - = content - - unless (_docinfo = docinfo :footer, '-revealjs.html').empty? - = _docinfo - script src="#{revealjsdir}/js/reveal.js" + - yield_content :slides + script src="#{revealjsdir}/dist/reveal.js" / Supports easy AsciiDoc syntax for background color javascript: Array.prototype.slice.call(document.querySelectorAll('.slides section')).forEach(function(slide) { if (slide.getAttribute('data-background-color')) return; // user needs to explicitly say he wants CSS color to override otherwise we might break custom css or theme (#226) @@ -246,15 +231,14 @@ // Optional libraries used to extend on reveal.js dependencies: [ #{revealjs_dependencies(document, self, revealjsdir)} ], - - #{(attr? 'revealjs_plugins_configuration') ? File.read(attr('revealjs_plugins_configuration', '')) : ""} - }); / Workaround the "Only direct descendants of a slide section can be stretched" limitation in reveal.js / https://github.com/hakimel/reveal.js/issues/2584 + + include stretch_nested_elements.js.slim - if syntax_hl && (syntax_hl.docinfo? :footer) =syntax_hl.docinfo :footer, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/'