From d7a139ce7cded0350bcc6eecd4ac7e5361505dd7 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 29 Jan 2020 00:57:17 -0500 Subject: [PATCH] Aligned document template with latest reveal.js index.html Dropped a lot of old cruft that accumulated --- templates/document.html.slim | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/templates/document.html.slim b/templates/document.html.slim index 89ae6737..4855fa87 100644 --- a/templates/document.html.slim +++ b/templates/document.html.slim @@ -2,6 +2,10 @@ 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" + + title=(doctitle sanitize: true, use_fallback: true) + - if RUBY_ENGINE == 'opal' && JAVASCRIPT_PLATFORM == 'node' - revealjsdir = (attr :revealjsdir, 'node_modules/reveal.js') - else @@ -13,11 +17,9 @@ html lang=(attr :lang, 'en' unless attr? :nolang) - 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" + link rel="stylesheet" href="#{revealjsdir}/css/reset.css" + link rel="stylesheet" href="#{revealjsdir}/css/reveal.css" + / Default theme required even when using custom theme - if attr? :revealjs_customtheme link rel='stylesheet' href=(attr :revealjs_customtheme) id='theme' @@ -53,15 +55,15 @@ html lang=(attr :lang, 'en' unless attr? :nolang) - 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 + + /! 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 lt IE 9] - + - unless (docinfo_content = docinfo :header, '.html').empty? =docinfo_content - if attr? :customcss @@ -100,8 +102,8 @@ html lang=(attr :lang, 'en' unless attr? :nolang) - unless author.nil? p.author: small=author =content - // FIXME we need to sync with upstream now, see changes in https://github.com/hakimel/reveal.js/blame/master/index.html script src="#{revealjsdir}/js/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; @@ -114,7 +116,9 @@ html lang=(attr :lang, 'en' unless attr? :nolang) } }) - // See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options + // More info about config & dependencies: + // - https://github.com/hakimel/reveal.js#configuration + // - https://github.com/hakimel/reveal.js#dependencies Reveal.initialize({ // Display presentation control arrows controls: #{to_boolean(attr 'revealjs_controls', true)}, @@ -242,13 +246,11 @@ html lang=(attr :lang, 'en' unless attr? :nolang) // 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 }," : nil} #{(attr? 'revealjs_plugin_zoom', 'disabled') ? "" : "{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true }," } #{(attr? 'revealjs_plugin_notes', 'disabled') ? "" : "{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true }," } - #{(attr? 'revealjs_plugin_marked', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }," : "" } - #{(attr? 'revealjs_plugin_markdown', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }," : "" } - #{(attr? 'revealjs_plugin_pdf', 'enabled') ? "{ src: '#{revealjsdir}/plugin/print-pdf/print-pdf.js', async: true }," : "" } + #{(attr? 'revealjs_plugin_marked', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/marked.js' }," : "" } + #{(attr? 'revealjs_plugin_markdown', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/markdown.js' }," : "" } #{(attr? 'revealjs_plugins') ? File.read(attr('revealjs_plugins', '')) : ""} ],